In 1086 Yusuf ibn Tashfin was invited by the Muslim taifa princes of Al-Andalus in the Iberian Peninsula to defend their territories from the encroachment of Alfonso VI, King of León and Castile.
In that year, Ibn Tashfin crossed the Strait of Gibraltar to Algeciras, and defeated Castile at the Battle of az-Zallaqah (Battle of Sagrajas).
He was prevented from following up his victory by trouble in Africa, which he chose to settle in person.

He returned to Iberia in 1090, avowedly for the purpose of annexing the taifa principalities of Iberia.
He was supported by most of the Iberian people, who were discontented with the heavy taxation imposed upon them by their spendthrift rulers.
Their religious teachers, as well as others in the east, (most notably, al-Ghazali in Persia and al-Tartushi in Egypt, who was himself an Iberian by birth from Tortosa), detested the taifa rulers for their religious indifference.
The clerics issued a fatwa (a non-binding legal opinion) that Yusuf was of sound morals and had the religious right to dethrone the rulers, whom he saw as heterodox in their faith.
By 1094, Yusuf had annexed most of the major taifas, with the exception of the one at Saragossa.
The Almoravids were victorious at the Battle of Consuegra, during which the son of El Cid, Diego Rodríguez, perished.
Alfonso, with some Leónese, retreated into the castle of Consuegra, which was besieged for eight days until the Almoravids withdrew to the south.

After friendly correspondence with the caliph at Baghdad, whom he acknowledged as Amir al-Mu'minin ("Commander of the Faithful"), Yusuf ibn Tashfin in 1097 assumed the title of Amir al Muslimin ("Commander of the Muslims").
He died in 1106, when he was reputed to have reached the age of 100.
The Almoravid power was at its height at Yusuf's death: the Moorish empire then included all of Northwest Africa as far eastward as Algiers, and all of Iberia south of the Tagus and as far eastward as the mouth of the Ebro, and including the Balearic Islands.

In 1108 Tamim Al Yusuf defeated the Kingdom of Castile at the Battle of Uclés.
Yusuf did not reconquer much territory from the Christian kingdoms, except that of Valencia; but he did hinder the progress of the Christian Reconquista by uniting al-Andalus.
In 1134 at the Battle of Fraga the Almoravids dynasty was victorious and even succeeded in slaying Alfonso I of Aragon in the battle.
In 1086 Yusuf ibn Tashfin was invited by the Muslim taifa princes of Al-Andalus in the Iberian Peninsula to defend their territories from the encroachment of Alfonso VI, King of León and Castile. In that year, Ibn Tashfin crossed the Strait of Gibraltar to Algeciras, and defeated Castile at the Battle of az-Zallaqah (Battle of Sagrajas). He was prevented from following up his victory by trouble in Africa, which he chose to settle in person.
He returned to Iberia in 1090, avowedly for the purpose of annexing the taifa principalities of Iberia. He was supported by most of the Iberian people, who were discontented with the heavy taxation imposed upon them by their spendthrift rulers. Their religious teachers, as well as others in the east, (most notably, al-Ghazali in Persia and al-Tartushi in Egypt, who was himself an Iberian by birth from Tortosa), detested the taifa rulers for their religious indifference. The clerics issued a fatwa (a non-binding legal opinion) that Yusuf was of sound morals and had the religious right to dethrone the rulers, whom he saw as heterodox in their faith. By 1094, Yusuf had annexed most of the major taifas, with the exception of the one at Saragossa. The Almoravids were victorious at the Battle of Consuegra, during which the son of El Cid, Diego Rodríguez, perished. Alfonso, with some Leónese, retreated into the castle of Consuegra, which was besieged for eight days until the Almoravids withdrew to the south.
After friendly correspondence with the caliph at Baghdad, whom he acknowledged as Amir al-Mu'minin ("Commander of the Faithful"), Yusuf ibn Tashfin in 1097 assumed the title of Amir al Muslimin ("Commander of the Muslims"). He died in 1106, when he was reputed to have reached the age of 100. The Almoravid power was at its height at Yusuf's death: the Moorish empire then included all of Northwest Africa as far eastward as Algiers, and all of Iberia south of the Tagus and as far eastward as the mouth of the Ebro, and including the Balearic Islands.
In 1108 Tamim Al Yusuf defeated the Kingdom of Castile at the Battle of Uclés. Yusuf did not reconquer much territory from the Christian kingdoms, except that of Valencia; but he did hinder the progress of the Christian Reconquista by uniting al-Andalus. In 1134 at the Battle of Fraga the Almoravids dynasty was victorious and even succeeded in slaying Alfonso I of Aragon in the battle.
Almoravid dynasty