The Empire of Brazil was a constitutional monarchy which ruled over Brazil from 7 September 1822 to 15 November 1889. Brazil had been the seat of the Portuguese monarchy during the Peninsular War, with King Joao VI of Portugal establishing himself and his government in the Brazilian capital of Rio de Janeiro. After the war's end, Joao returned to Portugal and left his son and heir, Dom Pedro, to rule over Brazil as regent. On 7 September 1822, Pedro declared the independence of Brazil as the rest of South America gained its independence, and, on 12 October, Pedro was acclaimed Emperor of Brazil. The huge but sparsely populated and ethnically diverse country won its independence from Portugal after a short war, and it had political stability, vibrant economic growth, constitutionally guaranteed freedom of speech, and respect for civil rights of its free male subjects, unlike many other recently-independent Latin American countries. However, the high levels of democracy seen in the provincial and local legislatures and the Parliament led to a dispute over the role of the monarch in the country.
In 1828, the unsuccessful Cisplatine War against Argentina led to the secession of Spanish-speaking Uruguay from Brazil. That same year, Pedro's daughter, Queen Maria II of Portugal, was usurped by Pedro's brother Miguel I of Portugal, and Pedro - unable to deal with both Brazilian and Portuguese affairs - abdicated the Brazilian throne and departed for Europe to restore his daughter to the throne. A weak regency was created for the minor Pedro II of Brazil, Pedro I's son, leading to regional civil wars between local factions. Pedro managed to bring peace and stability to the country upon coming of age, and Brazil was victorious in the Platine War, the Uruguayan War, and the Paraguayan War. With prosperity and economic development came an influx of European immigration, including Protestants and Jews, although Brazil remained mostly Catholic.
Slavery was restricted until its final abolition in 1888, and Brazil developed its own unique visual arts, literature, and theatre. However, as Pedro grew old, he made no effort to maintain the monarchy, and he did not consider a female monarch acceptable as his heir. On 15 November 1889, the heirless Pedro was overthrown in a sudden military coup which created the First Brazilian Republic.