It was the 4th congregational mosque. Its name derived from the name of Fatima al-Zahraa, the daughter of Prophet Muhammad or named after the Fatimid royal palaces of Cairo “al-qusor al-Zahira” or the flourishing palaces.
It doesn’t bear the name of the founder, the Fatimid Caliph al-Moezz. He assigned his general and vizier Gawhar al-Saqlabi the task of building al-Azhar. It was built as a congregational mosque for the Shi’I, and then later on it was used as a college with the appointment of 35 scholars to teach the Shi’i sect.
The mosque originally had only three arcades around the courtyard; north, south and east. This plan was common in North African architecture. The arcades are all carried on pre-Islamic columns with Corinthian Capitals; the qibla riwaq has five aisles. There were three domes; but none has survived.
The Fatimid additions:
Caliph al-Hakim restored the minaret and donated a new wooden door.
Caliph al-Hafiz who added an arcade around the courtyard and a dome in front of the transept.
Al-Azhar during the Ayyubid and Mamluk periods:
The mosque wasn’t used as a congregational mosque during the Ayyubid period due to the decision of Salah al-Din al-Ayyubi.
The whole mosque was restored during the reign of Sultan al-Zahir Baybars. He also replaced the minaret and added a minbar in the eastern riwaq and crenellations to the mosque.
After the earthquake, the whole mosque was restored during the reign of al-Nasir Muhammad.
Sultan al-Ashraf Qaitbay pulled down the western entrance and replaced with the present one. He added a minaret to the right side of the new entrance.
Sultan Qansuh al-Gawri built a huge double-headed minaret.
Three madrasas were dedicated to the mosque under the Mamluks; the madrasa of Amir Taybers on the Right side of the main entrance, the madrasa of Amir Aqbugha to the Left side of the entrance and the madrasa of Amir Jawhar al-Qunquba’I at the qibla riwaq.
Al-Azhar during the Ottoman period:
Two sundials were dedicated to the mosque.
Amir Abd al-Rahman Katkhuda who had a mausoleum at the mosque. He enlarged the qibla riwaq and added a new façade. He also added three minarets.
Today the mosque has 8 gates and 5 minarets; one belongs to amir Aqbugha, one erected by Qaitbay, one erected by Qansuh al-Ghawri and two by Katkhuda.