Madinat al-Zahra or Medina Azahara was a fortified palace-city on the western outskirts of Córdoba in present-day Spain. Its remains are a major archaeological site today. The city was built in the 10th century by Abd-ar-Rahman III, a member of the Umayyad dynasty and the first caliph of Al-Andalus. It served as the capital of the Caliphate of Córdoba and its center of government.
The main reason for its construction was politico-ideological: Abd ar-Rahman III had declared himself "caliph" in 929 and the dignity of this new title required the establishment of a new city, a symbol of his power, imitating other eastern Caliphates. It sought to demonstrate his superiority over his great rivals, the Fatimid Caliphs of Ifriqiya in North Africa and the Abbasid Caliphs in Baghdad. The city was built near Córdoba, the existing capital of al-Andalus under Umayyad rule. Construction began in 936–940 and continued in multiple phases throughout his reign and the reign of his son son, Al-Hakam II.