Built of local limestone in what is now the historic Islamic heart of the city, it soon became a place of learning as well as worship, and the school that grew around it became Al-Azhar University, long regarded across the Muslim world as the leading centre for Sunni theology and Islamic law. Its name, "the most resplendent", is often linked to Fatima, the Prophet's daughter, known as az-Zahrāʾ, "the shining one".
Every ruling dynasty of Egypt left its mark on the building, so the mosque gathers more than a thousand years of Cairo's building styles in one place. Founded as a Shiite Ismaili institution, it was shunned by Saladin and the Ayyubids, who stopped congregational prayers here, until the Mamluk sultan Baibars restored them in 1266. The Mamluks then repaired and enlarged it, and in the 18th century the Ottoman-era official Abd al-Rahman Katkhuda nearly doubled its size, adding a second prayer hall south of the original and three new gates, among them the Gate of the Barbers, where students had their heads shaved, and the Soup Gate, where food was handed out to them.
At the centre lies the white marble courtyard, laid out in 1009–1010 and surrounded by arcades of keel-shaped arches from the Fatimid refurbishment of al-Hafiz in 1138. Their carved stucco alternates sunken roundels with shallow fluted niches, bands of Kufic script quoting the Quran run beneath them, and the walls are crowned with stepped crenellations. Facing the Gate of the Barbers across the courtyard, the Gate of Qaytbay of 1495, a fine example of late Mamluk carving, leads into the court of the prayer hall.
The prayer hall still stands on marble columns taken from older buildings, Pharaonic, Roman and Coptic, their differing heights evened out with bases of varying thickness. The original mihrab, uncovered in 1933, keeps verses of the Quran carved in its conch, the only decoration certainly traced back to the Fatimid founders. Above the roofline rise the minarets of later patrons: the minaret of Qaytbay, whose three balconies rest on muqarnas, and the double-headed minaret built by Qansuh al-Ghuri in 1509, with blue faience on its middle shaft and two finials on onion-shaped bulbs.
Two Mamluk madrasas, built as separate schools beside the mosque and later absorbed into it, open off the courtyard. The Madrasa al-Taybarsiyya, which holds the tomb of Amir Taybars, keeps its original qibla wall and a mihrab framed by porphyry columns and glass mosaics of pomegranate trees, which the architectural historian K. A. C. Creswell placed among the best in Cairo; it now holds manuscripts from the library. The Madrasa al-Aqbughawiyya, with the tomb of Amir Aqbugha, keeps its original entrance and mosaic mihrabs under a dome and minaret. A third school, the Madrasa Gawhariyya of 1440, has cupboards inlaid with ebony, ivory and nacre and a small dome carved outside with arabesques.




