As the seat of the caliphate, Cairo took the lead in Islamic teaching and intellectual endeavour. Its religious institutions, al-Azhar University and the
Sultan Hassan Complex foremost among them, received generous
waqfs from the sultans and senior officials, to support both Sunni religious studies and the sciences, particularly medicine. Thus, the exemplary
Bimaristan (hospital) of
Sultan Qalawun in Cairo, built in 683 / 1284, provided teaching facilities for a diversity of subjects such as surgery and ophthalmology, in addition to the provision of 100 beds for the sick, a comprehensive library and a pharmacy.