He had proclaimed himself caliph in 929, and the new city was meant to display that rank against his rivals, the Fatimid caliphs in North Africa and the Abbasids in Baghdad. Its name means "the radiant city". In 2018 UNESCO inscribed the site as a World Heritage Site under the name "Caliphate City of Medina Azahara".

Work began in the years 936–940 and went on under his son Al-Hakam II, who ruled until 976. The city held reception halls, a congregational mosque, government offices, aristocratic houses, gardens, a mint, workshops, barracks and baths, with water brought in by aqueduct. After al-Hakam II, the powerful chamberlain al-Mansur, known as Almanzor, moved government to a palace-city of his own, and between 1010 and 1013, during a civil war, Madinat al-Zahra was sacked. For years afterwards people carried away its stone, its remains were buried, and excavation only began in 1911.

The city was a rectangle of 112 hectares laid on the hillside in three terraces, so that the palaces at the top looked down over the official quarter and, below, the town, the mosque and the valley of the Guadalquivir. Only about 10 hectares have been excavated and partly restored, but they include the main palaces, and these upper areas are what visitors walk through. The way in is through the North Gate, once the Bab al-Jibal or Gate of the Mountains, which opens between the administrative district on the east and, on the west, the Dar al-Mulk, where the caliph lived.

From there paths lead past the portico of the Court of the Pillars, where Roman sculptures were found, among them the reassembled Sarcophagus of Meleager, and the House of Ja'far, whose courtyard portico has been rebuilt. The richest building is the Salón Rico, where Abd ar-Rahman III received his guests; it was built between 953 and 957 and reconstructed after its excavation in 1946. Inside, rows of horseshoe arches on slender columns divide it into three naves, and the walls are covered with carved limestone panels of arabesques and trees of life. The caliph sat against the back wall, with the hall proportioned so that he could see its full width without turning his head.

In front of the hall the Upper Garden spreads over an artificial terrace, divided into four sunken beds by walkways, with a large pool of 19 by 19 metres placed so that the Salón Rico and a central pavilion were reflected in water. Further east lie the Lower Garden and the great ramp that rose in several turns from the ceremonial gate, gentle enough for visitors on horseback. On the edge of the site, the archaeological museum opened in 2009, built low and largely underground so as not to break the view from the ruins; its design by Nieto Sobejano Arquitectos won an Aga Khan architecture award in 2010.