The extraordinary palace-city of Medina Azahara near Córdoba was built in the 10th century for the Ummayad Caliphs of Córdoba, intended as the capital of Islamic Andaluz, and is still being excavated. A considerable amount of the highly sophisticated decoration of the main buildings has survived, showing the enormous wealth of this very centralized state. The palace at Aljafería is later, from after Islamic Spain split into a number of kingdoms. Famous examples of Islamic architecture and its decoration are the Cathedral–Mosque of Córdoba, whose Islamic elements were added in stages between 784 and 987, and the Alhambra and Generalife palaces in Granada from the final periods of Muslim Spain.