 The mosque was expanded during the rule of the caliph al @-@ Aziz ( 975 – 996 ) . According to al @-@ Mufaddal , he ordered the restoration of portions of the mosque and had the ceiling raised by one cubit . The next Fatimid caliph , al @-@ Hakim , would continue to renovate the mosque , providing a new wooden door in 1010 . However , al @-@ Hakim 's reign saw the completion of the al @-@ Hakim Mosque , and al @-@ Azhar lost its status as Cairo 's primary congregational mosque . In May 1009 the al @-@ Hakim Mosque became the sole location for the caliph 's sermons ; prior to this , al @-@ Hakim would rotate where the Friday sermon was held . Following al @-@ Hakim 's reign , al @-@ Azhar was restored by al @-@ <unk> . Additions and renovations were carried during the reign of the remaining Fatimid caliphs . 
