After the Umayyad conquest of Hispania in 711–718, the Iberian Peninsula was established as a province under the Umayyad Caliphate. The rulers of this province established their capital in Córdoba and received from the Umayyad Caliphate the title of wali or emir.
In 756, Abd al-Rahman I, a prince of the deposed Umayyad royal family, refused to recognize the authority of the Abbasid Caliphate and became an independent emir of Córdoba. He had been on the run for six years after the Umayyads had lost the position of caliph in Damascus in 750 to the Abbasids. Intent on regaining a position of power, he defeated the existing Muslim rulers of the area who had defied Umayyad rule and united various local fiefdoms into an emirate. However, this first unification of al-Andalus under Abd al-Rahman still took more than twenty-five years to complete (Toledo, Zaragoza, Pamplona, Barcelona).
For the next century and a half, his descendants continued as emirs of Córdoba, with nominal control over the rest of al-Andalus and sometimes even parts of western North Africa, but with real control always in question, particularly over the marches along the Christian border, their power vacillating depending on the competence of the individual emir. Indeed, the power of emir Abdullah ibn Muhammad al-Umawi (circa 900), for example, did not extend beyond Córdoba itself.
Upon the ascent to the throne of his grandson Abd al-Rahman III, who succeeded him in 912, the political decline of the emirate was obvious. Abd al-Rahman III rapidly restored Umayyad power throughout al-Andalus and extended it into western North Africa as well. In 929, to impose his authority and end the riots and conflicts that ravaged the Iberian Peninsula, he proclaimed himself caliph of Córdoba, elevating the emirate to a position of prestige not only in comparison to the Abbasid caliph in Baghdad but also the Shi'i Fatimid caliph in Tunis, with whom he was competing for control of North Africa. The Emirate of Cordoba gradually lost power and in 1492 Granada was retaken by the Christians and Muslim influence dissolved.