Along the lines of other caliphates, Abd al-Rahman III ordered the construction of a palatial city. It was aimed to become the seat of the caliphate. The power was then shared between the Medina in Córdoba and Medina Azahara.
The construction work run by Maslama ben Abdallah began in 936. Nine years later, the move was made from the caliphal alcázar. Many buildings such as the mosque and the mint were finished around 948.
Al-Hakam II continued extending the city. He ordered some constructions such as the Yafar House.
The life of this new capital was actually pretty short. When al Hakam II died, Almanzor, the hajib of the Caliphate Hisham II, got all the power. He built Medina Alzahira, his own palatial city, on the opposite site. In addition, the caliph without any power was confined in Medina Azahara.
The city was abandoned with the breakup of the Caliphate. The war situation meant the end of the city. Moreover, during next decades it suffered from numerous attacks and sacking.
The Muslim city was totally forgotten until the 20th century. First excavations that still go on today began in 1911.