The Hungarian bishops and Andrew's maternal family from Venice were his principal supporters, but the leading Croatian and Slavonian lords were opposed to his rule.
The Kőszegis, the Csáks, and other powerful families autonomously governed their domains, rising up nearly every year in open rebellion against Andrew.
A civil war ensued which lasted for more than two decades and ended with the victory of Mary of Hungary's grandson, Charles Robert.
[3] However, Andrew II's two elder sons, Béla IV of Hungary and Coloman of Halych, accused Beatrice D'Este of adultery and refused to acknowledge Stephen the Posthumous as their legitimate brother.
[6][7][8] Stephen the Posthumous nominated his wife's two kinsmen, including her brother Albertino Morosini, as Andrew's guardians before his death in 1272.
[8] Andrew, who was the only male member of the royal family besides the king, adopted the title of "Duke of Slavonia, Dalmatia and Croatia" and marched as far as Lake Balaton.
[7][10] Three Cuman assassins murdered Ladislaus IV on 10 July 1290,[12][13] and Archbishop Lodomer subsequently dispatched two monks to Vienna to inform Andrew of the king's death.
[14] Upon Andrew's arrival, his opponents tried to bribe Theodore Tengerdi, Provost of the Székesfehérvár Chapter, not to hand over the Holy Crown of Hungary to the soon-to-be-king, but the prior refused them.
[15][16] The lords and prelates swore loyalty to Andrew only after he issued a charter promising the restoration of internal peace and respect for the privileges of the nobility and the clergymen.
[13] To put an end to anarchy, the "prelates, barons and noblemen" ordered the destruction of castles which had been erected without royal permission and the restoration of estates that had been unlawfully seized to their rightful owners.
[23][24] Andrew then held a general assembly for the barons and the noblemen of five counties to the east of the river Tisza—Bihar, Kraszna, Szabolcs, Szatmár, and Szolnok—at Nagyvárad (Oradea) in early 1291.
[23][27] Ladislaus IV's sister Mary, wife of Charles II of Naples, announced her claim to the throne in April 1291.
[30] He invaded Austria, forcing Albert to withdraw his garrisons from the towns and fortresses—including Pressburg (Bratislava) and Sopron—that he had captured years before, many of which were held by the Kőszegis before their conquest.
[16][23] The Peace of Hainburg, which concluded the war, was signed on 26 August, and three days later Andrew and Albert of Austria confirmed it at their meeting in Köpcsény (Kopčany).
[31] The Kőszegis rose up in open rebellion against Andrew in spring 1292, acknowledging Mary's son, Charles Martel, as King of Hungary.
[36] In August, Andrew arranged a marriage between his cousin, Constance Morosini, and Vladislav, son of Stefan Dragutin of Serbia, who had earlier acknowledged Charles Martel's claim to Hungary.
[26] Andrew replaced Roland Borsa with Ladislaus III Kán as voivode of Transylvania, but the former preserved all his domains in the lands east of the Tisza.
[40] Early the next year, the recently widowed King Andrew visited Vienna and arranged a marriage with Duke Albert's daughter Agnes.
[42] In early February 1298, Andrew visited Albert of Austria in Vienna and promised to support him against Adolf of Nassau, King of Germany.
[45] After the close of the diet, Andrew entered into a formal alliance with five influential noblemen – Amadeus Aba, Stephen Ákos, Dominic Rátót, Demetrius Balassa and Paul Szécs – who stated that they were willing to support him against the Pope and the bishops.
[18][60] The civil war ended with Charles Robert's victory, but he was forced to continue fighting against the Kőszegis, the Abas, Matthew Csák, and other powerful lords up to the early 1320s.