In 1821, King Joao VI of Portugal returned to Portugal at the request of the new parliament due to the outbreak of a bourgeois revolution in his country. He appointed his son Pedro as the regent of Brazil. At this time, the Brazilian people’s independence sentiment was on the rise, and King Joao VI had already foreseen a certain danger. When he returned home, he gave Pedro the opportunity to rush to declare independence and become an emperor if the situation deteriorates.
Around Pedro gathered a group of ministers who advocated independence. In order to take over the colonial government, the Portuguese parliament asked Pedro to return home. Pedro rejected this request and announced that "I will stay here." After that, he called himself "Brazil's permanent guard and protector." In July 1822, an independent constitution was drafted. On September 7, he received the news that the Portuguese Parliament once again requested him to return home. At this time, he and a group of officers were on the Ipiranga river in a small creek near Sao Paulo during the journey.
He drew his sword, took off the Portuguese emblem from his uniform, and officially announced that "The Portuguese Parliament wants to place Brazil in a enslaved position. We must immediately declare independence, not independence, and death! We are now separated from Portugal." The official date for Brazil to gain independence. On December 1, 1822, Pedro held a coronation ceremony in Rio de Janeiro, known as the Emperor Pedro I of Brazil, and raised a new national flag consisting of green, golden and blue.
Brazil got rid of Portuguese colonial rule and established an independent country. Pedro I abdicated to his son after 9 years of reign.