The Kingdom of Portugal was a monarchy in the western Iberian Peninsula and the predecessor of the modern Portuguese Republic. Existing to various extents between the mid-12th century and the early 20th century, it was also known as the Kingdom of Portugal and the Algarves after 1471, and was the main constituent of the United Kingdom of Portugal, Brazil and the Algarves, which existed between 1815 and 1822. It coexisted with the Portuguese Empire, the realm's overseas colonies.
The nucleus of the Portuguese state was the County of Portugal, established in the 9th century as part of the Reconquista by Vímara Peres, a vassal of the King of Asturias.