After Andrew III's death in early 1301, the majority of the Hungarian lords and prelates elected Wenceslaus king, although Pope Boniface VIII supported another claimant, Charles Robert, a member of the royal house of the Kingdom of Naples.
[3] Andrew III was the last male member of the House of Árpád, the native royal dynasty of Hungary, but the legitimacy of his rule had not been unanimously acknowledged.
[7] After his main opponent, Władysław the Elbow-high, was forced to leave the kingdom, Wenceslaus II was crowned king of Poland in Gniezno in late September 1300.
[3] In contrast with their Hungarian peers, the Croatian lords did not acknowledge Wenceslaus-Ladislaus as a lawful king and remained faithful to Charles of Anjou.
[20] The Illuminated Chronicle writes that the Hungarian lords did not "grant a castle, or might and power, or royal authority"[21] either to Wenceslaus-Ladislaus or to Charles of Anjou.
[15] In his letters to Wenceslaus II of Bohemia and Archbishop John of Kalocsa, Pope Boniface VIII emphasized that Wenceslaus-Ladislaus had been crowned without the authorization of the Holy See.
[22] The papal legate, Niccolo Boccasini, who came to Hungary in September, started negotiations with the Hungarian prelates to convince them to abandon Wenceslaus-Ladislaus and support Charles of Anjou's case.
[16] In the first half of that year, many prelates (including Stephen, the new Archbishop of Kalocsa) abandoned Wenceslaus-Ladislaus; even Jan Muskata left Hungary.
[24] Taking advantage of the weakened position of his rival, Charles of Anjou attempted to capture Buda, the capital of Wenceslaus-Ladislaus, in September 1302.
[8][24] The mainly German citizenry and their major, Werner, remained faithful to the young king and Ivan Kőszegi relieved the city in the same month.
[26] On 31 May 1303, Pope Boniface VIII declared Charles of Anjou the lawful king of Hungary, stating that Wenceslaus-Ladislaus's election had been invalid.
[15][29] Charles of Anjou and Rudolf III of Austria invaded Moravia in September, but did not defeat Wenceslaus II's army.
[3][29] Wenceslaus III succeeded his father in both kingdoms, but his position in Poland was precarious because Władysław the Elbow-high continued his fight for the Polish throne.
[8][29] In the same months, Wenceslaus, who had meanwhile broken his engagement to Elizabeth of Hungary, married Viola of Teschen upon the Bohemian lords' advice.
[35][36] After deciding to invade Poland, Wenceslaus dismissed his young favourites and made his brother-in-law, Henry of Carinthia, governor.