Crowned king at the age of six, the regency was given to his mother, Leonor of Aragon. A coup, lead by his uncle, Pedro, Duke of Coimbra, forced the pregnant Queen Mother to flee to Castile, where she died without ever seeing her son again. While an effective ruler, the new regent gained the hostility of the court. In one last attempt to retain a degree of power over Afonso, he married his daughter Isabel to the king, who fell quickly in love with his beautiful bride.
The growing conflict between the Duke and Afonso, backed by mother’s old partisans, came to a head in the battle of Alfarrobeira, which resulted in Pedro’s death and the House of Coimbra’s fall from grace. Despite pressure on Afonso to divorce Isabel, he would remain devoted to her until her suspicious death at the age of 23, and no mistresses are known during the twenty years he remained a widower.
As King, he was criticized for being too indulgent with the nobility and for his focus on his North African campaigns. Very interested in learning, he invited several italian humanists to his court, being also responsible for creating the first Royal Library. Truly sincere about his code of honour, his actions and behaviour cannot be separated from the chivalric mindset that was disappearing in the 15th century. This has led some historians to regard him as the last portuguese knight-king.
During the War of Castilian Succession, he supported his niece, Juana of Castile, whom he married and claimed the title of King of Castile, against Isabel and Fernando, who would ultimately win the conflict. His marriage, unconsumated and without a papal bull, was annuled and Afonso withdrew from political life, leaving the ruling to his son, the future João II.
Tired and disappointed, he spent the last days of his life in a convent, where he died in 1481 at the age of 49.