Al-Azhar (The Luminous) was constructed as the central congregational mosque for Cairo by al-Qāʾid Jawhar al-Siqillī (d. 992 CE), a prominent Fatimid military leader, when he took Egypt for the Fatimid Imam-Caliph al-Muʿizz li Dīn Allāh in 969 CE and founded Cairo as its capital city. It was inaugurated on 7 Ramadan 361 AH / 22 June 972 CE. Possibly the mosque was so-named after the Prophet Muhammad’s daughter Fatima al-Zahrāʾ, through whom the Fatimids traced their genealogy back to the Prophet. 

Al-Azhar in Fatimid Cairo

Throughout the Fatimid period, al-Azhar played a vital role as one of the main mosques for the Imam-Caliph’s Friday prayers, where the Imam-Caliph himself often delivered the sermon; and also as an epicentre of religious learning. Various scholars, including the son of Imam-Caliph al-Muʿizz’s famous jurist al-Qadī al-Nuʿman (d. 974 CE), ʿAlī b. al-Nu‘ʿān, and Imam-Caliph al-ʿAzīz’s vizier, Yaʿqūb b. Killis (d. 991 CE), delivered lectures there on Fatimid law, theology and other subjects.  These majālis formed an important part in the dissemination of Fatimid knowledge. There were also mājalis convened at al-Azhar especially for women.  

Imam-Caliph al-ʿAzīz assigned several scholars to a house near al-Azhar and made provisions for their support. They held lectures and sessions in the mosque. Al-Azhar was also one of the main mosques in which the official appointment letter of the chief judge was read out in public; and where the qāḍīs (judges) presided over cases. On important occasions, gatherings were held there and the structure was brightly lit up.  Meals were also offered at these occasions. 

From Ayyubid neglect to Mamluk renewal

Following the Fatimid period, al-Azhar was sidelined by the Ayyubids but restored and expanded by the Mamluks as a grand mosque and a centre for religious instruction. Even though it was now one of many religious academies, it has retained its primary position because of its history and its location until todaythe political, economic and social centre of Cairo.   

Some of the more well-known scholars to have taught at al-Azhar were Ibn al-Haytham (d.430 AH/1039 CE) and later Ibn Khaldūn (d.808 AH/1406 CE). Already during the Fatimid era, there were renovations and additions made to the structure. During Ayyubid rule,  from the late 12th to the late 13th century CE, it lay in neglect.  The Mamluks and their successors then added extra structures to the mosque and its surroundings until the 18th century CE.