The independence of Brazil comprised a series of political and military events that led to the independence of the Kingdom of Brazil from the United Kingdom of Portugal, Brazil and the Algarves as the Empire of Brazil. It is celebrated on 7 September, the date when prince regent Pedro of Braganza declared the country's independence from the United Kingdom of Portugal, Brazil and the Algarves on the banks of the Ipiranga brook in 1822 on what became known as the Cry of Ipiranga. Formal recognition by Portugal came with the Treaty of Rio de Janeiro, signed in 1825.
In 1807, the French army invaded Portugal, which had refused to participate in the continental blockade against the United Kingdom.