In 1139 Afonso Henriques was proclaimed king of an independent Portugal, which had until that time been a county within the Kingdom of León. Over the next century Afonso and his successors expanded the borders of the kingdom southward at the expense of the Moors in southern Iberia. By 1249 Portugal had attained its present extent. Portugal reached the zenith of its power in the 16th century.
In 1580 the Portuguese crown went to King Filipe of Spain (known as Felipe II to the Spanish). Portugal was ruled by Spanish Habsburgs until 1640, when a rebellion removed this line of kings from power and installed the House of Braganza.
The Braganza dynasty held power until 1910, when the monarchy was abolished and a republic established.