The first formal madrasa was the Saffarin Madrasa in Fes el Bali by Sultan Abu Yusuf in 1271.[56]:312 Sultan Abu al-Hassan was the most prolific patron of madrasa construction, completing the Al-Attarine, Mesbahiyya and Sahrij Madrasa in Fez alone, and several other madrasas as well in other cities such as Salé and Meknes.