 Congregational prayers were reestablished at al @-@ Azhar during the Mamluk Sultanate by Sultan Baibars in 1266 . While Shāfi ‘ ī teachings , which Saladin and the Ayyubids followed , stipulated that only one mosque should be used as a congregational mosque in a community , the Hanafi madh 'hab , to which the Mamluks adhered , placed no such restriction . Al @-@ Azhar had by now lost its association with the Fatimids and Ismāʿīli doctrines , and with Cairo 's rapid expansion , the need for mosque space allowed Baibars to disregard al @-@ Azhar 's history and restore the mosque to its former prominence . Under Baibars and the Mamluk Sultanate , al @-@ Azhar saw the return of stipends for students and teachers , as well as the onset of work to repair the mosque , which had been neglected for nearly 100 years . According to al @-@ Mufaddal , the emir ' Izz al @-@ Din <unk> al @-@ <unk> built his house next to the mosque and while doing so repaired the mosque . Al @-@ Maqrizi reports that the emir repaired the walls and roof as well as repaving and providing new floor mats . The first <unk> since the reign of the Fatimid caliph al @-@ Hakim took place on January 16 , 1266 with the sermon delivered on a new pulpit completed five days earlier . 
