Kingdom of Portugal
After the Portuguese Restoration War of 1640–1668, the kingdom passed to the House of Braganza and thereafter to the House of Braganza-Saxe-Coburg and Gotha. From this time, the influence of Portugal declined, but it remained a major power due to its most valuable colony, Brazil. After the independence of Brazil, Portugal sought to establish itself in Africa, but was ultimately forced to yield to the British interests, leading to the collapse of the monarchy in the 5 October 1910 revolution and the establishment of the First Portuguese Republic.
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.