Portugal as a country was founded during the early Christian Reconquista.

An excerpt from the article 37 facts about Portugal

Founded in 868, the country of Portugal gained importance after the Battle of São Mamede (1128). The Kingdom of Portugal was proclaimed after the Battle of Ourique in 1139, and independence from the Kingdom of León was recognized by the Treaty of Zamora in 1143.