Question: During which war was Brazil last 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.  
Domitian's Dacian War was a conflict between the Roman Empire and the Dacian Kingdom, which had invaded the province of Moesia.
The war occurred during the reign of the Roman emperor Domitian, in the years 86–88 AD. 
Their territory was invaded at the end of the 19th century, during the rubber boom.
In the 1990s, Brazil formally recognized their land rights. 
A civil war in Argentina over government and urban versus rural forces led to battles.
In the process Brazil invaded.
A fleet was sent up the Paraná River in 1854. 
Independence and early years.
The territory which would come to be known as Brazil was claimed by Portugal on 22 April 1500, when the navigator Pedro Álvares Cabral landed on its coast.
Permanent settlement followed in 1532, and for the next 300 years the Portuguese slowly expanded westwards until they had reached nearly all of the borders of modern Brazil.
In 1808, the army of French Emperor Napoleon I invaded Portugal, forcing the Portuguese royal family—the House of Braganza, a branch of the thousand-year-old Capetian dynasty—into exile.
They re-established themselves in the Brazilian city of Rio de Janeiro, which became the unofficial seat of the Portuguese Empire.
In 1815, the Portuguese crown prince Dom João (later Dom João VI), acting as regent, created the United Kingdom of Portugal, Brazil and the Algarves, which raised the status of Brazil from colony to kingdom.
He ascended the Portuguese throne the following year, after the death of his mother, Maria I of Portugal.
He returned to Portugal in April 1821, leaving behind his son and heir, Prince Dom Pedro, to rule Brazil as his regent.
The Portuguese government immediately moved to revoke the political autonomy that Brazil had been granted since 1808.
The threat of losing their limited control over local affairs ignited widespread opposition among Brazilians.
José Bonifácio de Andrada, along with other Brazilian leaders, convinced Pedro to declare Brazil's independence from Portugal on 7 September 1822.
On 12 October, the prince was acclaimed Pedro I, first Emperor of the newly created Empire of Brazil, a constitutional monarchy.
The declaration of independence was opposed throughout Brazil by armed military units loyal to Portugal.
The ensuing war of independence was fought across the country, with battles in the northern, northeastern, and southern regions.
The last Portuguese soldiers to surrender did so in March 1824, and independence was recognized by Portugal in August 1825.
Pedro I encountered a number of crises during his reign.
A secessionist rebellion in the province of Cisplatina in early 1825 and the subsequent attempt by the United Provinces of the Río de la Plata (later Argentina) to annex Cisplatina led the Empire into the Cisplatine War: "a long, inglorious, and ultimately futile war in the south".
In March 1826, João VI died and Pedro I inherited the Portuguese crown, briefly becoming King Pedro IV of Portugal before abdicating in favor of his eldest daughter, Maria II.
The situation worsened in 1828 when the war in the south ended with Brazil's loss of Cisplatina, which would become the independent republic of Uruguay.
During the same year in Lisbon, Maria II's throne was usurped by Prince Miguel, Pedro I's younger brother.
Other difficulties arose when the Empire's parliament, the General Assembly, opened in 1826.
Pedro I, along with a significant percentage of the legislature, argued for an independent judiciary, a popularly elected legislature and a government which would be led by the emperor who held broad executive powers and prerogatives.
Others in parliament argued for a similar structure, only with a less influential role for the monarch and the legislative branch being dominant in policy and governance.
The struggle over whether the government would be dominated by the emperor or by the parliament was carried over into debates from 1826 to 1831 on the establishment of the governmental and political structure.
Unable to deal with the problems in both Brazil and Portugal simultaneously, the Emperor abdicated on behalf of his son, Pedro II, on 7 April 1831 and immediately sailed for Europe to restore his daughter to her throne.