Afonso VI (; 21 August 164312 September 1683), known as "the Victorious" (), was the second king of Portugal of the House of Braganza from 1656 until his death. He was initially under the regency of his mother, Luisa de Guzmán, until 1662, when he removed her to a convent and took power with the help of his favourite, the Luís de Vasconcelos e Sousa, 3rd Count of Castelo Melhor. Afonso's reign saw the end of the Restoration War (1640–68) and Spain's recognition of Portugal's independence. He also negotiated a French alliance through his marriage. However, the king was physically and mentally weak. In 1668, his brother Pedro II conspired to have him declared incapable of ruling, and took supreme de facto power as regent, although nominally Afonso was still sovereign. Queen Maria Francisca, Afonso's wife, received an annulment and subsequently married Pedro. Afonso spent the rest of his life and reign practically a prisoner. Early life At the age of three, Afonso experienced an illness that left him paralysed on the left side of his body, also leaving him mentally unstable. His father created him 10th Duke of Braganza. After the death of his eldest brother Teodósio, Prince of Brazil in 1653, Afonso became the heir apparent to the throne of the kingdom. He also received the crown-princely title 2nd Prince of Brazil. Succession He succeeded his father, John IV, in 1656 at the age of thirteen. His mother, Luisa de Guzmán, was named regent in his father's will. His mental instability and paralysis, plus his lack of interest in government, left his mother as regent for six years, until 1662. Afonso oversaw decisive military victories over the Spanish at Elvas (14 January 1659), Ameixial (8 June 1663) and Montes Claros (17 June 1665), culminating in the final Spanish recognition of sovereignty of Portugal's new ruling dynasty, the House of Braganza, on 13 February 1668 in the Treaty of Lisbon. Colonial affairs Colonial affairs saw the Dutch conquest of Jaffna, Portugal's last colony in Portuguese Ceylon (1658) and the cession of Bombay and Tangier to England (23 June 1661) as dowry for Afonso's sister, Catherine of Braganza, who had married King Charles II of England. English mediation in 1661 saw the Netherlands acknowledge Portuguese rule of Brazil in return for uncontested control of Sri Lanka. Marriage Afonso married Maria Francisca of Savoy, a relative of the duke of savoy