Charles I, also known as Charles Robert (Károly Róbert; Karlo Robert; Karol Róbert; 1288 16 July 1342) was King of Hungary and Croatia from 1308 to his death. He was a member of the Capetian House of Anjou and the only son of Charles Martel, Prince of Salerno. His father was the eldest son of Charles II of Naples and Mary of Hungary. Mary laid claim to Hungary after her brother, Ladislaus IV of Hungary, died in 1290, but the Hungarian prelates and lords elected her cousin, Andrew III, king. Instead of abandoning her claim to Hungary, she transferred it to her son, Charles Martel, and after his death in 1295, to her grandson, Charles. On the other hand, her husband, Charles II of Naples, made their third son, Robert, heir to the Kingdom of Naples, thus disinheriting Charles. Charles came to the Kingdom of Hungary upon the invitation of an influential Croatian lord, Paul Šubić, in August 1300. Andrew III died on 14 January 1301, and within four months Charles was crowned king, but with a provisional crown instead of the Holy Crown of Hungary. Most Hungarian noblemen refused to yield to him and elected Wenceslaus of Bohemia king. Charles withdrew to the southern regions of the kingdom. Pope Boniface VIII acknowledged Charles as the lawful king in 1303, but Charles was unable to strengthen his position against his opponent. Wenceslaus abdicated in favor of Otto of Bavaria in 1305. Because it had no central government, the Kingdom of Hungary had disintegrated into a dozen provinces, each headed by a powerful nobleman, or oligarch. One of those oligarchs, Ladislaus III Kán, captured and imprisoned Otto of Bavaria in 1307. Charles was elected king in Pest on 27 November 1308, but his rule remained nominal in most parts of his kingdom even after he was crowned with the Holy Crown on 27 August 1310. Charles won his first decisive victory in the Battle of Rozgony (at present-day Rozhanovce in Slovakia) on 15 June 1312. After that, his troops seized most fortresses of the powerful Aba family.