The Mosque of al-Azhar was founded by Jawhar al-Siqilly, the Fatimid conqueror of Egypt, in 970 as the congregational mosque for the new city of al-Qahira. The first khutba was delivered from its minbar in 972 and a university was established there in 988.
The original structure is a hypostyle mosque, with the aisles defined by round arches on pre-Islamic marble columns (spolia) with Corinthian capitals, and with the axis to the mihrab emphasized by a wide longitudinal aisle (transept), higher than the rest of the prayer hall. The other aisles are transverse, running parallel to the qibla wall. The termination of the transept at the mihrab is marked by a dome.
Among the original decorations are stucco panels and a window screen in the original qibla wall, stucco representations of a palm tree on the piers of the wall facing the original qibla wall. Also original are the stucco decorations on the inside of the northeast wall of the sanctuary, including bands of Kufic inscriptions framing windows with geometric stucco grilles, and the Kufic inscriptions and stucco carving in the hood of the mihrab. The stucco panels above it, however, belong to the restoration of Sultan Baybars I.
The courtyard was originally enclosed with three arcades. Part of the work of Caliph al-Hafiz (1138) is the addition of an arcade around all four sides of the courtyard, displaying keel-shaped arches, roundels, and keel-arched niches. The transept commences with a pishtaq, which is set in the courtyard's prayer-hall facade and was also built in the time of al-Hafiz. Behind this pishtaq in the first bay is a dome on squinches. This dome, the arches supporting it, the striking stucco decoration both on the spandrels of these arches and the interior of the dome, and the window grille above the qibla side arch that is the earliest extant example of stained-glass in Egypt, were also added by al-Hafiz.
The Shafi'i monopolized the law during the Ayyubid period, so the Friday khutba in Cairo could be delivered from one mosque only. Consequently, the Azhar lost its status as a Friday mosque, when the Mosque of al-Hakim, by virtue of being the largest mosque in the city, was chosen in its stead. In 1266 during the reign of Mamluk Sultan Baybars I, Amir 'Izz al-Din Aydamur al-Hilli restored the mosque and elevated it to khutba status, and Amir Badr al-Din Bilik al-Khazindar had a maqsura made for it.
Mamluk madrasas were established in the ziyada (outer enclosure): Taybarsiyya in 1309 and Aqbughawiyya in 1340. The Taybarsiyya has two iwans, one for the Shafi'ites and the other for the Malikites. Its mihrab is representative of an early Bahri Mamluk combination of glass mosaic and polychrome marble inlay. The mihrab's semi-dome is set in an outer arch surrounded by a molding which forms a loop at its apex, and continues horizontally and then vertically downwards to form a rectangular outer frame for the spandrels of this arch. This is the earliest occurrence of this feature in Egypt. The upper part of the mihrab is framed by a band of white marble with a decorative motif inlaid in black.
The Aqbughawiyya, with a minaret by the royal chief-architect Mu'allim al-Suyufi (also 1340), had housed al-Azhar's valuable collection of Qur'ans and manuscripts since 1898, but has since been relocated to another building. For another minaret by Mu'allim al-Suyufi, see al-Maridani. Originally a madrasa, it was later used for the Sufi exercise of hudur. In fact, in the early 14th c. mosques and madrasas were arenas for Sufi performances including dance and music. It is particularly noted for its portal, adorned with red and black marble inlay, and mihrabs featuring decorations in glass mosaic and mother of pearl.
The foundation (madrasa and mausoleum) of Jawhar al-Qunqubay, added in 1440, displays the earliest example of arabesque foliage carving on the exterior surface of a stone dome in Cairo. Additions by Sultan Qaytbay include the main gate to the courtyard at the end of the passage between the Aqbughawiyya and the Taybarsiyya (1469), and the minaret above it (ca. 1477). Later restorations by Qaytbay under the superintendence of Khwaja Mustafa ibn Mahmud ibn Rustem al-Rumi were finished in 1496. The double-finial minaret belongs to the works of Sultan al-Ghuri (1501-16).
Later works include those of Mamluk 'Abd al-Rahman Katkhuda (under the Ottomans), part of which is the main portal and the expansion behind the Fatimid mihrab, in 1753, and those of Khedive 'Abbas Hilmy in 1894. This mosque served as a model for the Mosque of the Qarafa, a congregational mosque built by al-Sayyida al-Mu'izziyya in 976.