Regency
Meanwhile, the queen showed increasing signs of mental instability. On 10 February 1792, seventeen doctors signed a document declaring her unable to manage the kingdom, with no prospect for her condition to improve. John was reluctant to take the reins of power, rejecting the idea of a formal regency. This opened the way for elements of the nobility to form a de facto government via a Council. Rumors circulated that John exhibited symptoms of the same insanity, and that he might be prevented from ruling. According to longstanding laws that guided the institution of regency, were the regent to die or become incapable for any reason, and having children of less that fourteen years—John's situation at the time—government would be exercised by the guardians of those children or, if guardians had not be formally named, by the wife of the regent: in John's case, a Spanish infanta. Fear, suspicion and intrigue engulfed the entire institutional framework of the nation.
At the same time, the French Revolution perplexed and horrified the reigning houses of Europe. The execution of the French king Louis XVI on 21 January 1793 by the revolutionaries precipitated an international response. On 15 July 1793 Portugal signed a treaty with Spain, and on 26 September allied itself with Great Britain, both treaties pledging mutual aid against revolutionary France and bringing six thousand Portuguese soldiers into the War of the Pyrenees (1793–1795), a campaign that began with an advance to Roussillon in France and ended in defeat with French conquest of northeastern Spain. This created a delicate diplomatic problem, as Portugal could not make peace with France without damaging an alliance with England that involved several overseas interests, and thus sought a neutrality that proved fragile and tense.
After the defeat, Spain abandoned its alliance with Portugal and allied with France under the Peace of Basel. With Britain too powerful for France to attack directly, France set its sights on Portugal. In 1799, John officially assumed the reins of government as Prince Regent in the name of his widowed mother; that same year Napoleon Bonaparte staged his coup in France and coerced Spain to issue an ultimatum that the Portuguese break with Great Britain and submit the country to the interests of Napoleon. With John's refusal, neutrality became unviable. Spain and France invaded in 1801, setting off the War of the Oranges; a defeated Portugal signed the Treaty of Badajoz and the subsequent Treaty of Madrid, under which it ceded territory to Spain, in particular Olivenza, and made concessions to French over certain colonial territories. With conflicting interests among all the countries involved, the war was marked by ambiguous movements and secret agreements. Portugal, as the weakest player, could not avoid continued struggle. At the same time, John had to face an enemy at home. His wife, Carlota Joaquina, loyal to Spanish interests, initiated an intrigue with the objective of deposing her husband and taking power herself, an attempt that failed in 1805, resulting in the queen's exile from court, after which she resided at Queluz National Palace, while the regent took up residency at Mafra National Palace.
Read more about this topic: John VI Of Portugal