In 1086 the Almoravid ruler of Morocco, Yusuf ibn Tashfin, was invited by the Muslim princes in Iberia to defend them against Alfonso VI, King of Castile and León. In that year, Tashfin crossed the straits to Algeciras and inflicted a severe defeat on the Christians at the Battle of Sagrajas. By 1094, Yusuf ibn Tashfin had removed all Muslim princes in Iberia and had annexed their states, except for the one at Zaragoza. He also regained Valencia from the Christians. About this time a massive process of conversion to Islam took place, and Muslims comprised the majority of the population in Spain by the end of the 11th century.