Originally a colony of the Kingdom of Portugal, Brazil became the seat of the Portuguese Colonial Empire from 1808 to 1814 during the Peninsula War against Napoleon Bonaparte. When then Portuguese Regent, and later King João VI fled to Brazil after Napoleon's invasion of Portugal, he set up court in Rio de Janeiro. On 1821, João returned to Portugal and left his son Pedro as regent. The Portuguese then began to revoke the autonomies that Brazil had when the court was in Rio, provoking a harsh reactionary action that led to Pedro declaring Brazil's independence with him as Emperor of a new Constitutional Monarchy. This led to the Brazilian Wars of Independence that would bring about two years of conflict between pro-Independence and Portuguese Royalist forces.
The conflict ended in 1824 when the last Portuguese soldiers surrendered, and Portugal would recognize the new Empire the following year.
Cisplatina War and the Abdication of Pedro I
Pedro would encounter problems during his reign. A secessionist rebellion is Cisplatina Province and the subsequent attempt by the United Provinces of South America (present day Argentina) would lead to the Cisplatine War (1825-1828). The conflict, fought over both nations claims to the region would be long and costly and would bring about an end in 1828 with the independence of Cisplatina, renamed Uruguay.
Debates from 1826 to 1831 also caused problems, The Emperor and many in the population argued that Brazil's constitution should provide for an independent judiciary and a popularly elected legislature, which would be presided over by a head of state (the Emperor) who held broad executive powers and prerogatives. Others in parliament wanted the monarch to be circumscribed in a more ceremonial role, with the legislature dominant in policy and governance
But more bad news was to follow, in 1826, João VI died, and the Portuguese crown passed to Pedro I as Pedro IV of Portugal, He ruled for two months before passing the throne to his eldest daughter, who became Queen Maria II. By 1828 however, the throne would usurped by Pedro's younger brother Miguel. Unable to deal with both problems in Portugal and Brazil, Pedro abdicated in favor of his five-year old son Pedro II. He would then leave for Portugal to settle the end of the Liberal Wars (1828-1834)
Anarchy and the Riograndense Wars
Following the hasty departure of Pedro I, Brazil was left with a five-year-old boy as head of state. With no precedent to follow, the Empire was faced with the prospect of a period of more than twelve years without a strong executive, as, under the constitution, Pedro II would not attain his majority and begin exercising authority as Emperor until December 2, 1843. A regency was called in to rule Brazil during the interim period, but because the regency had fewer powers than the Emperor would wield, their was a considerable power vaccum that would be left unfilled.
The politicians who had risen to power during the 1830s had by then become familiar with the difficulties and pitfalls of power. These politicians, who would found the Conservative Party in 1834, believed that a neutral figure was required - one who could stand above political factions and petty interests to address discontent and moderate disputes. However, their rivals in the Liberal Party wanted a weak Emperor who was easily coercible. They would pass an initiative to lower Pedro II's age of majority from eighteen to fourteen. The Emperor was declared fit to rule in July 1840.
During this period, a separatist movement emerged in the Rio Grande Do Sul, which led to the establishment of the Riograndense Republic. Two wars were fought over the region before it was finally put down in 1847.