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.
United Kingdom of Portugal, Brazil and the Algarves
Accordingly, steps were taken to put an end to the personal union: Pedro I & IV agreed to abdicate the Portuguese Throne in favour of his eldest daughter, but he also wanted to ensure that her rights would be respected, and he further wanted to restore constitutional monarchy to Portugal. In order to put an end to the Portuguese absolute monarchy, the Emperor-King commissioned the drafting of a new Constitution for Portugal, that was widely based on the Brazilian Constitution. This document was finalized in less than a week.