Emirate of Cordoba
The Iberian Peninsula except for the Kingdom of Asturias was conquered by the Muslims between 711 and 718. It became an integral part of the Umayyad Empire known as Al-Andalus and was ruled by the governors from Damascus appointed by the Caliphs. However, anti-Ummayad movements led by the Abbasids in the Umayyad Empire after 740 resulted in breakdown of the Caliphal control in the Iberian Peninsula by 750.
The Umayyad Dynasty was overthrown but the grandson of the tenth Umayyad Caliph, Abd ar-Rahman I escaped from Syria and established Emirate of Cordoba in 752. Abd ar-Rahman I managed to establish an independent kingdom with relatively strong central government during his 32-year long reign. He also began the construction of the Mezquita, the great mosque at Cordoba which was completed by his successor Hisham I (788-796). The latter enjoyed relatively peaceful reign but his successor al-Hakam I (796-822) had to deal with numerous rebellions.