Being the last male member of the House of Árpád, Andrew was elected king after the death of King Ladislaus IV in 1290. He was the first Hungarian monarch to issue a coronation diploma confirming the privileges of the noblemen and the clergy. At least three pretenders—Albert of Austria, Mary of Hungary, and an adventurer—challenged his claim to the throne. Andrew expelled the adventurer from Hungary and forced Albert of Austria to conclude a peace within a year, but Mary of Hungary and her descendants did not renounce their claim. 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.
Hungary was in a state of constant anarchy during Andrew's reign. The Kőszegis, the Csáks, and other powerful families autonomously governed their domains, rising up nearly every year in open rebellion against Andrew. With Andrew's death, the House of Árpád became extinct. A civil war ensued which lasted for more than two decades and ended with the victory of Mary of Hungary's grandson, Charles Robert.
The exact date of Andrew's birth is unknown. According to historians Tibor Almási, Gyula Kristó, and Attila Zsoldos, he was born in about 1265. Stephen the Posthumous nominated his wife's two kinsmen, including her brother
Albertino Morosini, as Andrew's guardians before his death in 1272.