The Ben Youssef Madrasa was an Islamic college in Marrakesh, Morocco, named after the Almoravid sultan Ali ibn Yusuf (reigned 1106–1142), who expanded the city and its influence considerably. It is the largest madrasa in all of Morocco. The college was founded during the period of the Marinid (14th century) by the Marinid sultan Abu al-Hassan and allied to the neighboring Ben Youssef Mosque.
The building of the madrasa was re-constructed by the Saadian Sultan Abdallah al-Ghalib (1557–1574). In 1565 the works ordered by Abdallah al-Ghalib were finished, as confirmed by the inscription in the prayer room. Its 130 student dormitory cells cluster around a courtyard richly carved in cedar, marble and stucco. The carvings contain no representation of humans or animals as required by Islam, and consist entirely of inscriptions and geometric patterns such as star and petal designs in zellige tilework. This madrasa was one of the largest theological colleges in North Africa and may have housed as many as 900 students. One of its best-known teachers was Mohammed al-Ifrani (1670-1745). Closed down in 1960, the building was refurbished and reopened to the public as a historical site in 1982.