 With the Ottoman annexation of 1517 , despite the mayhem their fight to control the city engendered , the Turks showed great deference to the mosque and its college , though direct royal patronage ceased . Sultan Selim I , the first Ottoman ruler of Egypt , attended al @-@ Azhar for the congregational Friday prayer during his last week in Egypt , but did not donate anything to the upkeep of the mosque . Later Ottoman amirs likewise regularly attended Friday prayers at al @-@ Azhar , but rarely provided subsidies for the maintenance of the mosque , though they did on occasion provide stipends for students and teachers . In contrast to the expansions and additions undertaken during the Mamluk Sultanate , only two Ottoman walīs ( governors ) restored al @-@ Azhar in the early Ottoman period . 
