Question: When was the last time Brazil was invaded?
About the article "Brazil", section "Military".

Candidate passages:
This was the last time the Ottomans invaded Mani.
In 1821, the rest of Greece declared its independence.
During the war, Egyptians under Ibrahim Pasha invaded Mani, but were repelled by the Maniots under Petros Mavromichalis at the Battle of Vergas.  
Their territory was invaded at the end of the 19th century, during the rubber boom.
In the 1990s, Brazil formally recognized their land rights. 
In 1808, faced with impending Napoleonic invasion, the Braganzas and almost all the transferred their royal court to the State of Brazil, Portugal's largest colony.
Some time after they had crossed the Atlantic, a royal decree changed the status of Brazil from a Portuguese colony into kingdom alongside Portugal, and the United Kingdom of Portugal, Brazil and the Algarves was formed.
In 1821, D. João VI, who succeeded in 1816, returned to Portugal.D.
Pedro, Royal of Portugal, Brazil, and the Algarves, the eldest son of D. João VI and also regent in Brazil, sided with the Brazilian rebels in January 1822.
He proclaimed himself Emperor D. Pedro I of an independent Brazil in 1822, founding the Empire of Brazil.
D. Pedro I ruled Brazil until 1831, when he abdicated in favor of his young son D. Pedro II, and returned to Portugal to aid his daughter D. Maria II (see below).D.
Pedro II, being only 6 years old at the time of his coronation, had a regency established.
The regency would rule until 1846, when the Emperor turned 20 years old.
His reign would last until 1889, when the Brazilian monarchy was abolished.
His reign would see the abolition of slavery in Brazil, economic growth, and very long periods of tranquility in his empire. 
In 1798, Egypt's population was estimated at 3 million when Napoleon invaded the country. 
The alliance was reconfirmed after the breakup of the Iberian Union, primarily due to both countries' respective rivalries with Spain, the Netherlands, and France, both in Europe and overseas.
During this time, important episodes in the alliance were: The War of Spanish Succession, when Portugal together with the Duchy of Savoy initially sided with France, but after the Battle of Blenheim reunited with its ally.
The Seven Years' War, when Spain invaded Portugal in 1762, Britain intervened as Portugal's ally.
Although faced with vastly superior numbers, the Portuguese and British forces achieved a strategic victory over the Spanish and French forces.
The Napoleonic Wars, when Portugal, isolated in a Europe wholly dominated by Napoleon, continued to trade with the United Kingdom despite French restrictions and was finally invaded, but with British help finally regained total sovereignty and independence.
The Portuguese royal family at the time (including the later King John VI) took refuge in its then vice-royalty of Brazil, under escort of the British fleet.
The Portuguese civil war, when the United Kingdom gave important support to the Liberal faction.
The 1890 British Ultimatum was considered by Portuguese historians and politicians at that time to be the most outrageous and infamous action of the British against her oldest ally.