Medina Azahara (Arabic: مدينة الزهراء Madīnat az-Zahrā: literal meaning "the shining city") is the ruins of a vast, fortified Arab Muslim medieval palace-city built by Abd-ar-Rahman III al-Nasir, (912–961) Umayyad Caliph of Córdoba, and located on the western outskirts of Córdoba, Spain. It was an Arab Muslim medieval town and the de facto capital of al-Andalus, or Muslim Spain, as the heart of the administration and government was within its walls. Built beginning in 936-940, the city included ceremonial reception halls, mosques, administrative and government offices, gardens, a mint, workshops, barracks, residences, and baths. Water was supplied through aqueducts.
The main reason for its construction was politico-ideological: the dignity of the Caliph required the establishment of a new city, a symbol of his power, imitating other Eastern Caliphates. Above all, it demonstrated his superiority over his great rivals, the Fatimids of Ifriqiya in Northern Africa, as well as the Abbasid Caliphs in Baghdad. Legend also says it was built as a tribute to the favourite of the Caliph: Azahara.
The complex was extended during the reign of Abd ar-Rahman III's son Al-Hakam II (r. 961-976), but after his death soon ceased to be the main residence of the Caliphs. In 1010 it was sacked in a civil war, and thereafter abandoned, with many elements re-used elsewhere. Its ruins were excavated starting from the 1910s. Only about 10 percent of the 112 hectares have been excavated and restored, but this area includes the central area, with "two caliphal residences, with associated bath complexes, two aristocratic residences, and service quarters ... spaces associated with the palace guard; some large administrative buildings ... the extraordinary court complex presided over by the reception hall ... the great garden spaces, and just outside this area, the congregational mosque".
A new museum on the edge of the site has been built low, with much of the space underground, to minimize disruption to the views of the landscape from the ruins, which are also beginning to be affected by modern housing.