Yusuf ibn Tashfin (yōsŏfˈ ĭˈbən täshfēnˈ) [key], d. 1106, ruler in the dynasty of the Almoravids (c.1059–1106). A Muslim, he led the Berbers in N Africa, continued the conquest of Morocco, took Algeria, and founded (1062) Marrakech, which became his capital. When the petty Moorish kings of Spain appealed for help against the Christians, he entered S Spain and with the help of the local kings decisively defeated (1086) Alfonso VI of León and Castile. In 1090 he again invaded Spain. Turning conqueror, he annexed all the Moorish territories of Spain except Zarogoza. His empire was inherited by his son Ali.