Abd ar-Rahman I became Emir of Córdoba in 756 after six years in exile after the Umayyads lost the position of Caliph in Damascus to the Abbasids in 750. Intent on regaining power, he defeated the area's existing Islamic rulers and united various local fiefdoms into an emirate. Raids then increased the emirate's size; the first to go as far as Corsica occurred in 806.
The emirate's rulers used the title "emir" or "sultan" until the 10th century. In the early 10th century, Abd ar-Rahman III faced a threatened invasion from North Africa by the Fatimid Caliphate, a rival Shiite Islamic empire based in Ifriqiya. Since the Fatimids also claimed the caliphate, in response Abd ar-Rahman III claimed the title of caliph himself. Prior to Abd ar-Rahman's proclamation as the caliph, the Umayyads generally recognized the Abbasid Caliph of Baghdad as being the rightful rulers of the Muslim community. Even after repulsing the Fatimids, he kept the more prestigious title. Although his position as caliph was not accepted outside of al-Andalus and its North African affiliates, internally the Spanish Umayyads considered themselves as closer to Muhammad, and thus more legitimate, than the Abbasids.
The caliphate enjoyed increased prosperity during the 10th century. Abd ar-Rahman III united al-Andalus and brought the Christian kingdoms of the north under control by force and through diplomacy. Abd ar-Rahman III stopped the Fatimid advance into Morocco and al-Andalus in order to prevent a future invasion. The plan for a Fatimid invasion was thwarted when Abd ar-Rahman III secured Melilla in 927, Ceuta in 931, and Tangier in 951. This period of prosperity was marked by increasing diplomatic relations with Berber tribes in North Africa, Christian kings from the north, and with France, Germany and Constantinople. The caliphate became very profitable during the reign of Abd ar-Rahman III, by increasing the public revenue to 6,245,000 dinars from Abd ar-Rahman II. The profits made during this time were divided into three parts: the payment of the salaries and maintenance of the army, the preservation of public buildings, and the needs of the caliph. The death of Abd ar-Rahman III led to the rise of his 46-year-old son, Al-Hakam II, in 961. Al-Hakam II continued his father's policy, dealing humanely with disruptive Christian kings and North African rebels. Al-Hakam's reliance on his advisers was greater than his father's because the previous prosperity under Abd ar-Rahman III allowed al-Hakam II to let the caliphate run by itself. This style of rulership suited al-Hakam II since he was more interested in his scholarly and intellectual pursuits than ruling the caliphate. The caliphate was at its intellectual and scholarly peak under al-Hakam II.
The death of al-Hakam II in 976 marked the beginning of the end of the caliphate. Before his death, al-Hakam named his only son Hisham II successor. Although the 10-year-old child was ill-equipped to be caliph, Al-Mansur Ibn Abi Aamir (top adviser to al-Hakam, also known as Almanzor), who had sworn an oath of obedience to Hisham II, pronounced him caliph. Almanzor had great influence over Subh, the mother and regent of Hisham II. Almanzor, along with Subh, isolated Hisham in Córdoba while systematically eradicating opposition to his own rule, allowing Berbers from Africa to migrate to al-Andalus to increase his base of support. While Hisham II was caliph, he was merely a figurehead. He, his son Abd al-Malik (al-Muzaffar, after his 1008 death) and his brother (Abd al-Rahman) retained the power nominally held by Caliph Hisham. However, during a raid on the Christian north a revolt tore through Córdoba and Abd al-Rahman never returned.
The title of caliph became symbolic, without power or influence. The death of Abd al-Rahman Sanchuelo in 1009 marked the beginning of the Fitna of al-Andalus, with rivals claiming to be the new caliph, violence sweeping the caliphate, and intermittent invasions by the Hammudid dynasty. Beset by factionalism, the caliphate crumbled in 1031 into a number of independent taifas, including the Taifa of Córdoba, Taifa of Seville and Taifa of Zaragoza. The last Córdoban Caliph was Hisham III (1027–1031).