The vicious civil war amongst the ruling Umayyad taifas in al-Andalus had debilitated them and culminated in the destruction of Córdoba and the Shining City. However, King Alfonso VI of Castile and León was still as big a threat as ever, and would certainly take advantage of this weakness. Sure enough, the taifa of Seville soon came under threat from Alfonso’s forces. After the fall of Toledo to Alfonso in 1085, its caliph, al-Mu'tamid, had launched a series of aggressive attacks on neighbouring kingdoms to amass more territory for himself, but in the end he was still vastly inferior to the Christian forces.
He consulted with his advisors about asking the Almoravid caliph in Marrakesh, Yusuf ibn Tashfin, for his help. If he were to be conquered by the Christians, he would be forced to pay a humiliating jizya (tribute) that would cripple his caliphate. His son, Rashid, was more outspoken and he railed against inviting the Almorovids into al-Andalus. His father answered with the famous speech.
“I have no desire to be branded by my descendants as the man who delivered al-Andalus as prey to the infidels. I am loath to have my name cursed in every Muslim pulpit. And, for my part, I would rather be a camel-driver in Africa than a swineherd in Castile.” In their haste and fear, they made a huge error and sent envoys to Marrakesh asking for help.
We have been watching events in Iberia, but North Africa had undergone its own revolution. Western North Africa had been made up of a number of separate tribes, but a Gazzula Berber leader named Abdallah ibn Yasin rose to prominence and united them. His name is a clue to his origins, "son of Ya Sin" suggests that he had obliterated his family past and was "re-born" of the Holy Book, meaning that he was probably a convert to Islam rather than born to the faith. He was a puritan zealot, characterized by a rigid formalism and strict adherence to the dictates of the Qur'an, and Orthodox tradition. Other Berber tribes often referred to them as the al-mulathimun (the veiled ones) because of the tagelmust, a veil which covered their lower face below the eyes. Present day Tuareg people still wear them, and though highly practical in the dust of the desert, the Almoravids insisted on wearing them everywhere as a way of emphasising their puritan brand of faith. Under their law, those not of their creed were forbidden to wear the veil, and so in al-Andalus, it served to distinguish them as the ruling class. The Umayyads considered them to be fanatical barbarians, but they knew that without Almoravid help, the Christians would have stormed through al-Andalus.
The Almoravids, led by Yusuf ibn Tashfin crossed the straits to Algeciras, and from there to Seville, where they set up a base camp. Tashfin was joined by the caliphs of Málaga, Seville and Granada, and their troops marched as one army to Badajoz, where they were joined by the troops of that taifa. The Muslim army now numbered between 60,000 to 80,000 men.
Outnumbered 20 to 1, Alfonso opened peace negotiations. Tashfin offered to allow the Christians to convert to Islam, pay a crippling tribute, or fight. Alfonso chose to fight. At dawn on the morning of October 23, 1086 the Christians charged and sacked the camp of one of the taifas, killing several of their leaders. By the afternoon however Alfonso was encircled by the superior forces, and the battle was clearly lost. By the evening, half the Christian army lay dead on the battlefield. The losses were heavy on the Muslim side, too, and this prevented the Moors from capitalising on their gain. Castile had not lost the psychologically important city of Toledo, and many of the taifas had lost so many leaders and troops that it would take months to rebuild their armies. At this crucial time, Tashfin had to return to Morocco because his oldest son and heir had died. Now known as The Battle of Sagrajas, it took its name from the Arabic description of the battlefield, az-Zallaqah, or "slippery ground" because the warriors had difficulty fighting on the bloody soil.
Yusuf ibn Tashfin returned to al-Andalus in 1090 and was dismayed by what he saw. The lax behaviour of the taifa kings, both spiritually and militarily, struck him as a breach of Islamic law and principles. Even before the invasion, he had been writing to the Abbasid caliph of Baghdad about extending the Orthodox Qur'an to al-Andalus with the clear intention of, "The spreading of righteousness, the correction of injustice and the abolition of unlawful taxes." The caliphs in such cities as Seville, Badajoz, Almeria and Granada had grown accustomed to the extravagant ways of the west. On top of doling out tribute to the Christians and giving Andalusian Jews unprecedented freedoms and authority, they had levied burdensome taxes on the populace to maintain their lifestyle.
That year, Tashfin exiled the caliphs Abdallah and his brother Tamim from Granada and Málaga. A year later, al-Mutamid of Seville suffered the same fate. Yusef united all of the Muslim dominions of the Iberian Peninsula, with the exception of Zaragoza, to the Kingdom of Morocco, and situated his royal court at Marrakech. He took the title of Amir al-muslimin (Prince of the Muslims), seeing himself as humbly serving the caliph of Baghdad, but to all intents and purposes he was the caliph of the western Islamic empire. The military might of the Almoravids was at its peak.
The Almoravids had gained little ground from the Christians, but one city above all others offended Tashfin’s sensibilities. Valencia was the home to Muslims, Jews and Christians, and under the weak rule of a petty caliph who was paying a jizya to the Christians, chief of whom was the famous El Cid. However, Valencia proved to be a stubborn obstacle for the Almoravid military. Tashfin led his fourth campaign against the Christians in 1097 when he tried to fight his way to the practically abandoned, yet historically important, Toledo. On August 15, 1097, the Almoravids delivered a blow to Alfonso’s forces, with a battle in which El Cid's son was killed. The war had become personal.
Tashfin appointed his son, Muhammad ibn’ A’isha, as governor of Murcia, and he laid siege to El Cid's forces at Alcira. The city didn’t fall, but Tashfin was satisfied that the Christians had been brought to heel, and he left for Marrakesh. He returned two years later and renewed his campaign in 1099. El Cid had died in the same year, and his wife, Jimena, had been ruling Valencia with the aid of King Alfonso. Tashfin ordered his lieutenant, Mazdali ibn Tilankan to lay siege to the city, and after a seven-month standoff, Jimena burned down the city’s great mosque and abandoned Valencia to the Moors.
Even though Yusuf ibn Tashfin was Caliph of al-Andalus and all Morocco and had conquered the home city of El Cid, the Christian hero, it is El Cid who is remembered in Spain’s oldest epic story, Poema del Cid, or El Cantar del Mio Cid.
Worse was to come for The Prince of the Muslims. His dynasty would only last another 47 years. In his homeland of Western Africa, in the Atlas Mountains, another Muslim faction was growing and gnawing at the Almoravid’s power base. The Almohads led by Ibn Tumart had begun their climb to ascendancy.