quality:corruption
Crises of the 19th century

In 1807 Portugal refused Napoleon 's demand to accede to the Continental System of embargo against the United Kingdom; a French invasion under General Junot followed, and Lisbon was captured in 1807. British intervention in the Peninsular War helped maintain Portuguese independence; the last French troops were expelled in 1812.

Rio de Janeiro in Brazil was the Portuguese capital between 1808 and 1821. In 1820, constitutionalist insurrections took place at Porto and Lisbon. Lisbon regained its status as the capital of Portugal when Brazil declared its independence in 1822. The death of King John VI in 1826 led to a crisis of royal succession. His eldest son, Pedro I of Brazil, briefly became Pedro IV of Portugal, but neither the Portuguese nor Brazilians wanted a unified monarchy; consequently, Pedro abdicated the Portuguese crown in favor of his 7-year-old daughter, Maria da Glória, on the condition that when she came of age she would marry his brother, Miguel. Dissatisfaction at Pedro's constitutional reforms led the "absolutist" faction of landowners and the church to proclaim Miguel king in February 1828. This led to the Liberal Wars, also known as the War of the Two Brothers or the Portuguese Civil War, in which Pedro forced Miguel to abdicate and go into exile in 1834 and place his daughter on the throne as Queen Maria II of Portugal.

After 1815 the Portuguese expanded their trading ports along the African coast, moving inland to take control of Angola and Mozambique. The slave trade was abolished in 1836. In Portuguese India, trade flourished in the colony of Goa, with its subsidiary colonies of Macau, near Hong Kong, and Timor, north of Australia. The Portuguese successfully introduced Catholicism and the Portuguese language into their colonies, while most settlers continued to head to Brazil.

The 1890 British Ultimatum was an attempt to force the retreat of Portuguese military forces in the land between the Portuguese colonies of Mozambique and Angola. The area had been claimed by Portugal, which included it in its " Pink Map ", but this clashed with British aspirations to create a railway between Cairo and Cape Town, thereby linking its colonies. This diplomatic clash led to waves of protest and prompted the downfall of the Portuguese government. The Ultimatum was considered by Portuguese historians and politicians at that time, to be the most outrageous action of the British against her oldest ally.