 Al @-@ Azhar nevertheless remained the seat of Arabic philology and a place of learning throughout this period . While official classes were discontinued , private lessons were still offered in the mosque . There are reports that a scholar , possibly al @-@ Baghdadi , taught a number of subjects , such as law and medicine , at al @-@ Azhar . Saladin reportedly paid him a salary of 30 dinars , which was increased to 100 dinars by Saladin 's heirs . While the mosque was neglected by Saladin and his heirs , the policies of the Sunni Ayyubid dynasty would have a lasting impact on al @-@ Azhar . Educational institutions were established by Sunni rulers as a way of combating what they regarded as the heretical teachings of Shi 'a Islam . These colleges , ranging in size , focused on teaching Sunni doctrine , had an established and uniform curriculum that included courses outside of purely religious topics , such as rhetorics , math , and science . No such colleges had been established in Egypt by the time of Saladin 's conquest . Saladin and the later rulers of the Ayyubid dynasty would build twenty @-@ six colleges in Egypt , among them the Salihiyya Madrasa . 
