The mosque was intended as a funerary complex and for use in Friday prayers, but its greatest purpose was that of a madrasa for Sufi students, according to al-Maqrizi's story of its origins. The madrasa was devoted to the study of the Hanafi, Shafi'i, Maliki, and Hanbali schools of Sharia law. According to the mosque's original documents, the madrasa was to house fifty Hanafis, forty Shafi'is, fifteen Malikis, and ten Hanbalis, and their respective teachers and imams. There were also two classes of twenty students each for students of tafsir and Hadith, and two others of ten each for students of the Quran recitation and legal studies, according to the Hanafi jurist al-Tahawi.Behrens-Abouseif, Doris. "Cairo of the Mamluks". Cairo:AUC Press, 2008. p 239-241
