Matthew II remained partisan of the king at all times, in accordance with the Csák tradition. In contrast, the Kőszegi family gradually manifested its disloyalty to the Árpád dynasty, first of all, when Henry the Great returned to Hungary from exile in Bohemia in 1272, assassinated Béla of Macsó, a grandson of the late Béla IV and partitioned the territory of the Duchy of Macsó among the barons. In 1272, he and Joachim Gutkeled captured and imprisoned the child Ladislaus IV himself and after the release of the royal, they also thrown into prison the king's younger brother, prince Andrew two years later. In August 1274, an armed conflict broke out between the two baronial groups. Meanwhile, Matthew II fought against Ottokar II of Bohemia in early 1273 at Styria and Carinthia, who also laid claim to the title king of Germany. Matthew was one of the two commanders (the other one was his rival, Stephen II Gutkeled) of the Hungarian army in the Battle on the Marchfeld on 26 August 1278, where Ottokar II was killed. His bravery and heroism during the battle had been documented by German chronicles.