History of Portugal (1834–1910)
Militant Republicans and their allies in the Carbonária were not willing to remain in the shadows of the constitutional monarchy. Between 4–5 October 1910, members of the Carbonária, republican youth, and elements of the army instigated a coup d'état against the already weak constitutional monarchy. The young king and his family, after a few miscues, escaped from the Palace in Mafra to exile in England. On the morning of 5 October 1910, the Republic was declared from the balcony of Lisbon City Hall, ending eight centuries of monarchy in Portugal.
Flag of Portugal
With the invasion of Portugal by Napoleon's imperial army in 1807, the Portuguese Royal Court fled to Brazil, establishing the capital of the Portuguese Monarchy and Empire in Rio de Janeiro. In 1815, the Portuguese state of Brazil was elevated to a kingdom, thus receiving the same status as the Kingdom of Portugal and the Algarves. The whole of the Portuguese Monarchy became then the United Kingdom of Portugal, Brazil and the Algarves. To reflect the change of the status of the Portuguese Monarchy, the Prince Regent John (future King John VI, at that time still reigning in name of his mother, Queen Mary I) established a new Royal coat of arms, where the Portuguese shield (representing Portugal and the Algarves) charged a blue-filled yellow armillary sphere (representing Brazil) surmounted by the same beret-bearing five-arched crown. The new coat of arms replaced the previous one in the Portuguese flags.