History of Spain/Spain Divided

Islamic rule
In 711, Muslim Moors, mainly North African Berber soldiers with some Arabs, crossed the Strait of Gibraltar and began their conquest of the Christian Visigothic Kingdom of Hispania. After their conquest of the Visigothic kingdom's Iberian territories, the Muslims crossed the Pyrenees and took control of Septimania in 719, the last province of the Visigothic kingdom to be occupied. From their stronghold of Narbonne, they launched raids into the Duchy of Aquitaine. At no point did the invading Islamic armies exceed 60,000 men. However, those armies established an Islamic rule that would last hundreds of years in much of the Iberian Peninsula and 781 years in Granada.

After the establishment of a local Emirate, Caliph Al-Walid I, ruler of the Umayyad caliphate, removed many of the successful Muslim commanders. Tariq ibn Ziyad, the first governor of the newly conquered province of Al-Andalus, was recalled to Damascus and replaced with Musa bin Nusair, who had been his former superior. Musa's son, Abd al-Aziz ibn Musa, apparently married Egilona, Roderic's widow, and established his regional government in Seville. He was suspected of being under the influence of his wife, accused of wanting to convert to Christianity, and of planning a secessionist rebellion. Apparently a concerned Al-Walid I ordered Abd al-Aziz's assassination. Caliph Al-Walid I died in 715 and was succeeded by his brother Sulayman ibn Abd al-Malik. Sulayman seems to have punished the surviving Musa bin Nusair, who very soon died during a pilgrimage in 716. In the end Abd al-Aziz ibn Musa's cousin, Ayyub ibn Habib al-Lakhmi became the emir of Al-Andalus. The conquering generals were necessarily acting very independently, due to methods of communication available. Successful generals in the field and in a very distant province would also gain the personal loyalty of their officers and warriors and their ambitions were probably always watched by certain circles of the distant government with a certain degree of concern and suspicion. Old rivalries and perhaps even full-fledged conspiracies between rival generals may have had influence over this development. In the end, the old successful generals were replaced by a younger generation considered more loyal by the government in Damascus. A serious weakness amongst the Muslim conquerors was the ethnic tension between Berbers and Arabs. The Berbers were indigenous inhabitants of North Africa who only recently had been converted to Islam; they had provided most of the soldiery of the invading Islamic armies but sensed Arab discrimination against them. This latent internal conflict jeopardized Muslim unity. After the Islamic Moorish conquest of nearly all of the Iberian Peninsula in 711-718 and the establishment of the emirate of Al-Andalus, an Umayyad expedition suffered a major defeat at the Battle of Toulouse and were halted for a while on their way north. Odo of Aquitaine had married his daughter to Uthman ibn Naissa, a rebel Berber and lord of Cerdanya (maybe of all current Catalonia too), in an attempt to secure his southern borders in order to fend off Charles Martel´s attacks on the north. However, a major punitive expedition led by Abdul Rahman Al Ghafiqi, the latest emir of Al-Andalus, defeated and killed Uthman, and the Muslim governor mustered an expedition north across the western Pyrenees, looted areas up to Bordeaux and defeated Odo in the Battle of the River Garonne in 732. A desperate Odo turned to his archrival Charles Martel for help, who led the Frankish and leftover Aquitanian armies against the Muslims and beat them at the Battle of Tours in 732, killing Abdul Rahman Al Ghafiqi; this proved to be the high-water mark of the Islamic conquests in western Europe and of the expansion of Al-Andalus. Moorish rule began to recede, but it would remain in parts of the Iberian peninsula for another 760 years.

The beginning of the Reconquista
The year 722 saw the first Asturian victory against the Muslims. In late summer, a Muslim army overran much of Pelayo's territory, forcing him to retreat deep into the mountains. Pelayo and a few hundred men retired into a narrow valley at Covadonga. There, they could defend against a broad frontal attack. From here, Pelayo's forces routed the Muslim army, inspiring local villagers to take up arms. Despite further attempts, the Muslims were unable to conquer Pelayo's mountain stronghold. Pelayo's victory at Covadonga is hailed as the beginning of the Reconquista.

A drastic increase of taxes by the new emir Anbasa ibn Suhaym Al-Kalbi had provoked several rebellions in Al-Andalus, which a series of succeeding weak emirs were unable to suppress. Around 722 a military expedition was sent into the north to suppress Pelayo's rebellion, but his forces prevailed in the Battle of Covadonga. This battle was considered by the Muslims as little more than a skirmish, while the Battle of Toulouse (721), with at death toll of maybe tens of thousands, was mourned for centuries as a large scale tragedy by the Iberian Muslims. However for Pelayo, the Christian victory secured his independent rule. The precise date and circumstances of this battle are unclear. Among the possibilities is that Pelayo's rebellion was successful because the greater part of the Muslim forces were gathering for an invasion of the Frankish empire.

During the first decades, Asturian control over the different areas of the kingdom was still weak, and for this reason it had to be continually strengthened through matrimonial alliances with other powerful families from the north of the Iberian Peninsula. Thus, "Ermesinda, Pelayo's daughter, was married to Alfonso, Peter of Cantabria's son. Alphonse's children, Froila and Adosinda, married Munia, a Basque from Alava, and Silo, a local chief from the area of Pravia, respectively." After Pelayo's death in 737, his son Fafila was elected king. Fafila, according to the chronicles, was killed by a bear during a trial of courage. Pelayo's dynasty in Asturias survived and gradually expanded the kingdom's boundaries until all of northwest Iberia was included by roughly 775. However, credit is due not to him but to his successors. Alfonso I (king from 739-757) rallied Galician support when driving the Moorish army out of Galicia and an area of that was to become Leon. The reign of Alfonso II from (791-842) saw further expansion of the northwest kingdom towards the south and, for a short time, it almost reached Lisbon. It was not until Alfonso II that the kingdom was firmly established with Alfonso's recognition as king of Asturias by Charlemagne and the Pope. During his reign, the holy bones of St. James the Great were declared to have been found in Galicia, at Santiago de Compostela. Pilgrims from all over Europe opened a channel of communication between the isolated Asturias and the Carolingian lands and beyond. The emirate's greatest failing was its inability to eradicate Christian resistance in the Basque country and the Cantabrian mountains. The two resistances, Basque Navarre and Cantabrian Asturias, despite their small size,demonstrated an ability to maintain their independence. The resistance in the Cantabrian mountains soon spread to Galicia in the north-west, where the occupying Moorish army was expelled and the territory was incorporated into Asturias. Because the Umayyad rulers based in Córdoba were unable to extend their power into Frankish territory, they decided to consolidate their power within the Iberian peninsula. Muslim forces made periodic incursions deep into Asturias but failed to make any lasting gains against the strengthened Christian kingdom.

Fall of the Caliphate
The 9th century saw the Berbers return to Africa in the aftermath of their revolts. During this period, many governors of large cities distant from the capital (Córdoba) planned to establish their independence. Then, in 929 the Emir of Córdoba (Abd-ar-Rahman III), the leader of the Umayyad dynasty, declared himself Caliph, independent from the Abbasids in Baghdad. He took all the military, religious and political power and reorganised the army and the bureaucracy. After regaining control over the dissident governors, Abd-ar-Rahman III tried to conquer the remaining Christian kingdoms of the Iberian peninsula, attacking them several times and forcing them back beyond the Cantabric range. His Christian subjects were largely left in peace, however. Christian political forces then accused Abd-ar-Rahman III of pederasty with a Christian boy who was later canonized Saint Pelagius of Cordova for his refusal of Abd-ar-Rahman's advances. As part of a pattern of portraying Islamic morality as inferior, the story provided political strength and popular support to the Reconquista for centuries.

Later Abd-ar-Rahman's grandson became a puppet in the hands of the great Vizier Almanzor (al-Mansur, "the victorious"). Almanzor waged several campaigns attacking and sacking Burgos, Leon, Pamplona, Barcelona and Santiago de Compostela before his death in 1002. Between Almanzor's death and 1031, Al-Andalus suffered many civil wars which ended in the appearance of the Taifa Kingdoms. The taifas were small kingdoms, established by the city governors establishing their long wished-for independence. The result was many (up to 34) small kingdoms each centered upon their capital, and the governors, not subscribing to any larger-scale vision of the Moorish presence, had no qualms about attacking their neighbouring kingdoms whenever they could gain advantage by doing so. This split into the taifa states caused Islamic presence to be greatly weakened in the face of the strengthening Christian kingdoms to the north. When Alfonso VI brought Toledo under his authority in 1085. Mortified by the concept of being surrounded by the enemy taifa rulers sent a desperate appeal to the Berber chieftain Yusuf b. Tashufin leader of the Almoravids.

Almoravids
The Almoravids were a Muslim militia, their ranks mainly composed of Berber and African Moors, and unlike the previous Muslim rulers, they were not so tolerant towards Christians and Jews. Their armies entered the Iberian peninsula on several occasions (1086, 1088, 1093) and defeated King Alfonso at the Battle of Sagrajas in 1086, but initially their purpose was to unite all the Taifas into a single Almoravid Caliphate. Their actions halted the southward expansion of the Christian kingdoms. Their only defeat came at Valencia in 1094, due to the actions of El Cid. Meanwhile, Navarre lost all importance under King Sancho IV, for he lost Rioja to Sancho II of Castile, and nearly became the vassal of Aragon. At his death, the Navarrese chose as their king Sancho Ramirez, King of Aragon, who thus became Sancho V of Navarre and I of Aragon. Sancho Ramírez gained international recognition for Aragon, uniting it with Navarre, expanding the borders south, conquering Wasqat Huesca deep in the valleys in 1096 and building a fort, El Castellar, 25 km away from Saraqustat Zaragoza. Catalonia came under intense pressure from the taifas of Zaragoza and Lérida, and also from internal disputes, as Barcelona suffered a dynastic crisis which led to open war among the smaller counties; but by the 1080s, the situation calmed, and the dominion of Barcelona over the smaller counties was restored.

The Almohads
After a brief period of disintegration (second Taifa period), the rising power in North Africa, the Almohads, took over most of Al-Andalus. But they would be decisively defeated at the Battle of Las Navas de Tolosa (1212) by a Christian coalition, losing almost all the remaining lands of Al-Andalus in the following decades. By 1252 only the Kingdom of Granada remained as sovereign Muslim state in the Iberian peninsula.

Emirate of Granada
Ferdinand and Isabella completed the Reconquista with a war against the Emirate of Granada that started in 1482 and ended with Granada's complete annexation in early 1492. The Moors in Castile previously numbered "half a million within the realm." By 1492 some 100,000 had died or been enslaved, 200,000 had emigrated, and 200,000 remained in Castile. Many of the Muslim elite, including Granada's former Emir Muhammad XII, who had been given the area of the Alpujarras mountains as a principality, found life under Christian rule intolerable and emigrated to Tlemcen in North Africa.