Ummayad conquest of Hispania
The Byzantine Empire, weakened by its wars with Persia and the alienation of its Coptic Christian and Jewish populations, lost Syria and Egypt between 636 and 640 to the nascent Ummayad Caliphate, which then invaded Libya. The Byzantines managed to hold Carthage until almost the end of the 7th century, but the establishment of the Muslim military headquarters at Kairouan in 670 marked the beginning of the Islamic conquest of the Maghreb.
From there Sidi Uqbah led an expedition to Morocco in 680-682. Uqbah was killed on the return journey, and it was not until 705 that the caliph al-Walid appointed a new governor, Mūsā ibn Nuṣayr. Mūsā annexed the entirety of North Africa as far as Tangier, leaving his general Ṭāriq ibn Ziyād to administer and Islamize the Berbers. Only Ceuta remained in Christian hands, being supplied from the Iberian Peninsula by the visig0th king Witiza.
On the death of Witiza, his dispossessed family appealed to the Muslims, ceded Ceuta, and enabled Ṭāriq to land in Spain with a Berber army. On hearing the news, Roderick, who had succeeded Witiza as king of the Visigoths, hastened southward, and Ṭāriq called on Mūsā for reinforcements. Roderick was killed in battle near Arcos de la Frontera (Cadiz) on July 23, 711. Ṭāriq at once marched on Ṭulayṭulah(Toledo) and occupied it, probably while the family of Witiza was still negotiating with Mūsā and the caliph. Mūsā himself brought another army, reduced Merida, the last stronghold of the followers of Roderick, entered Toledo and Saraqusṭah (Zaragoza), and perhaps crossed the northern Meseta, forcing the Visigoths to submit or flee.
When the caliph summoned Mūsā to return to the Umayyad capital at Damascus, Mūsā left his son Abd al-Aziz to govern Al-Andalus from Ishbīliyah (Sevilla). Both Mūsā and Ṭāriq were accused of misappropriation and died in obscurity in the East. Abd al-Aziz was murdered, and the caliphs appointed a succession of governors. The capital was moved to Cordoba, and the three sons of Witiza were restored to the “royal estates” but not to royal power. Pelayo, a follower of Roderick, established himself in a strong position in the Asturias (718–737). After an unsuccessful attempt to subdue him, in which Pelayo won a small but significant battle at Covadonga, he was left alone.
The Muslim governors carried their advance into gothic Gaul, settling Berbers in the Pyrenees, and penetrated deep into France. A Muslim army was defeated by Charles Martel at the Battle of Tours (732), but significant raids into Frankish territory would continue for the next decade. Muslim expansion north of the Pyrenees would come to a halt largely because of the great rebellion of the Berbers which erupted throughout North Africa in 739. This uprising spread to Spain, and the governor of Al-Andalus requested assistance from Damascus. The caliph dispatched an army from Syria under Balj ibn Bishr, which suppressed the Berbers in North Africa before embarking from Ceuta to Spain. Balj put down the rebellion in Spain, seized power in Córdoba (742), and executed the governor, only to be killed in combat shortly thereafter. These troubles enabled Alfonso I of the Asturias to briefly assert himself in Galicia and the Meseta, but he lacked the resources to occupy them permanently.
A new governor temporarily pacified Al-Andalus, but the Umayyad caliphate was on the verge of collapse. Caliph Hishām ibn Abd al-Malik had kept the factional tensions between northern (Qays) and southern (Kalb) Arab tribes in check, but those simmering feuds turned into open conflicts after his death in 743. Meanwhile, many non-Arab Muslims (mawali) had gravitated toward Hahimiyyah, an explicitly anti-Umayyad sect, and in 747 Abu Muslim launched a major uprising against the Umayyad caliph Marwān II.
Abu Muslim’s armies propelled the Abbasids to power in 749, and the defeat of Marwān II at the Battle of the Great Zāb River in 750 marked the end of the Umayyad caliphate. During this time, Spain was governed by Yusuf al-Fihrī, an experienced general who had established himself at Narbonne, and al-Sumail, Yusuf’s Syrian lieutenant, who held Zaragoza and the northeast frontier. While the Abbasids worked to exterminate the remnants of the Umayyad line, the grandson of Hishām ibn Abd al-Malik, Abd al-Rahman I, fled to North Africa.
After making his way to Spain in 755, Abd al-Rahman surveyed the political landscape, and he expertly played the rival factions of Al-Andalus against each other. Backed by a mercenary army, he eventually gathered enough strength to challenge Yusuf for supremacy. In May 756 ʿAbd al-Raḥmān defeated Yusuf’s forces outside Córdoba, and ʿAbd al-Raḥmān chose that city as the capital of the Spanish Umayyad emirate (caliphate from 929).