The Empire of Brazil was a political entity that comprised present-day Brazil under the rule of Emperors Pedro I and his son Pedro II. Founded in 1822 it was replaced by a republic in 1889.
As a result of the Napoleonic occupation of Portugal the Portuguese royal family, the Braganzas (Portuguese: os Braganças), went into exile in Brazil, the most important of Portugal's colonies. What followed was a period when Brazil became the capital of the United Kingdom of Portugal, Brazil and the Algarves and enjoyed self-government under the Braganza dynasty with no reference to the authorities in Lisbon. This nurtured a distaste for the idea of returning to status quo ante upon the overthrow of Napoleon's influence over Portugal. Brazil came to be independent of Portugal albeit under the rule of a member of the Portuguese royal family.
After its independence from the Portuguese on 7 September 1822 Brazil became a monarchy, the Empire of Brazil, which lasted until the establishment of a republican government on 15 November 1889. Two emperors occupied the throne in that period: Pedro I from 1822 to 1831; and Pedro II from 1831 to 1889. King João VI of Portugal held the title of Emperor of Brazil as stipulated by the treaty recognizing Brazilian independence.