Portugal, country, situated on on the Iberian Peninsula, has long anf troubled history. The land within the borders of the current Portugal has been continually fought over and settled since prehistoric times. A significant part of the land was part of the Caliphate for approximately five and a half centuries. Beginning in 711, the land that is now Portugal became part of the vast Umayyad Caliphate's empire of Damascus. In 750 Emirate of Córdoba was created, and after almost two centuries, the Emirate turned into the Caliphate of Córdoba in 929.
In the High Middle Ages, the fight against the Moors in the Iberian Peninsula became linked to the fight of the whole of Christendom. The Reconquista was originally a mere war of conquest. It only later underwent a significant shift in meaning toward a religiously justified war of liberation. The papacy not only justified the acts of war but actively encouraged Christian knights to seek armed confrontation with Moorish "infidels" instead of with each other.
During Reconquista king Alfonso III of Asturias repopulated the strategically important city León and established it as his capital. Also he reorganized his territories into the major duchies of Galicia and Portugal. On 26 July 1139 Afonso Henriques, son of Henry, Count of Portugal, and Theresa of León, the natural daughter of King Alfonso VI of León, was acclaimed King of the Portuguese internally. And on 5 October of 1143, Alfonso VII of León and Castile recognized Afonso Henriques as king through the Treaty of Zamora.
That was the way the history of modern Portugal started.