Al-Azhar Mosque

Al-Azhar Mosque (الجامع الأزهر, جامع الأزهر), known in Egypt simply as al-Azhar, is a mosque in Cairo, Egypt in the historic Islamic core of the city. Commissioned as the new capital of the Fatimid Caliphate in 970, it was the first mosque established in a city that eventually earned the nickname "the City of a Thousand Minarets". Its name is usually thought to derive from az-Zahrāʾ (lit. 'the shining one'), a title given to Fatimah, the daughter of Muhammad.

After its dedication in 972, and with the hiring by mosque authorities of 35 scholars in 989, the mosque slowly developed into what it is today.

The affiliated Al-Azhar University is the second oldest continuously run one in the world after Al-Qarawiyyin in Idrisid Fes. It has long been regarded as the foremost institution in the Islamic world for the study of Sunni theology and sharia, or Islamic law. In 1961, the university, integrated within the mosque as part of a mosque school since its inception, was nationalized and officially designated an independent university, Al-Azhar Al Sharif, following the Egyptian Revolution of 1952.

Over the course of its over a millennium-long history, the mosque has been alternately neglected and highly regarded. Because it was founded as a Shiite Ismaili institution, Saladin and the Sunni Ayyubid dynasty that he founded shunned al-Azhar, removing its status as a congregational mosque and denying stipends to students and teachers at its school. These moves were reversed under the Mamluk Sultanate, under whose rule numerous expansions and renovations took place. Later rulers of Egypt showed differing degrees of deference to the mosque and provided widely varying levels of financial assistance, both to the school and to the upkeep of the mosque. Today, al-Azhar remains a deeply influential institution in Egyptian society that is highly revered in the Sunni Muslim world and a symbol of Islamic Egypt.

Name
The city of Cairo was established by the Fatimid general Jawhar al-Siqilli, on behalf of the Fatimid caliph al-Mu'izz, following the Fatimid conquest of Egypt in 969. It was originally named al-Manṣūriyya (المنصورية) after the prior seat of the Fatimid caliphate, al-Mansuriyya in modern Tunisia. The mosque, first used in 972, may have initially been named Jāmiʿ al-Manṣūriyya (جامع المنصورية, "the mosque of Mansuriyya"), as was common practice at the time. It was al-Mu'izz who renamed the city al-Qāhira (القاهرة, "the Victorious"). The name of the mosque thus became Jāmiʿ al-Qāhira (جامع القاهرة, "the mosque of Cairo"), the first transcribed in Arabic sources.

The mosque acquired its current name, al-ʾAzhar, sometime between the caliphate of al-Mu'izz and the end of the reign of the second Fatimid caliph in Egypt, al-Aziz Billah ((r. 975 – 996)). ʾAzhar is the masculine form for zahrāʾ, meaning "splendid" or "most resplendent". Zahrāʾ is an epithet applied to Muhammad's daughter Fatimah, wife of caliph Ali. She was claimed as the ancestress of al-Mu'izz and the imams of the Fatimid dynasty; one theory is that her epithet is the source for the name al-ʾAzhar. The theory, however, is not confirmed in any Arabic source and its plausibility has been both supported and denied by later Western sources.

An alternative theory is that the mosque's name is derived from the names given by the Fatimid caliphs to their palaces. Those near the mosque were collectively named al-Quṣūr al-Zāhira (القصور الزاهرة, "the Brilliant Palaces") by al-Aziz Billah, and the royal gardens were named after another derivative of the word zahra. The palaces had been completed and named prior to the mosque changing its name from Jāmiʿ al-Qāhira to al-ʾAzhar.

The word Jāmiʿ is derived from the Arabic root word jamaʿa (g-m-ʿ), meaning "to gather". The word is used for large congregational mosques. While in classical Arabic the name for al-Azhar remains Jāmiʿ al-ʾAzhar, the pronunciation of the word Jāmiʿ changes to Gāmaʿ in Egyptian Arabic.

Fatimid Caliphate
After the conquest of Egypt, Jawhar al-Siqilli oversaw the construction of the royal enclosure for the caliph's court and the Fatimid army, and had al-Azhar built as a base to spread Isma'ili Shi'a Islam. Located near the densely populated Sunni city of Fustat, Cairo became the center of the Isma'ili sect of Shi'a Islam, and seat of the Fatimid empire.

Jawhar ordered the construction of a congregational mosque for the new city and work commenced on April 4, 970. The mosque was completed in 972 and the first Friday prayers were held there on June 22, 972 during Ramadan.

Al-Azhar soon became a center of learning in the Islamic world, and official pronouncements and court sessions were issued from and convened there. Under Fatimid rule, the previously secretive teachings of the Isma'ili madh'hab (school of law) were made available to the general public. Al-Nu'man ibn Muhammad was appointed qadi (judge) under al-Mu'izz and placed in charge of the teaching of the Isma'ili doctrine. Classes were taught at the palace of the caliph, as well as at al-Azhar, with separate sessions available to women. During Eid al-Fitr in 973, the mosque was rededicated by the caliph as the official congregational mosque in Cairo. Al-Mu'izz, and his son—when he in turn became caliph—would preach at least one Friday khutbah (sermon) during Ramadan at al-Azhar.

Yaqub ibn Killis, a polymath, jurist and the first official vizier of the Fatimids, made al-Azhar a key center for instruction in Islamic law in 988. The following year, 45 scholars were hired to give lessons, laying the foundation for what would become the leading university in the Muslim world.

The mosque was expanded during the rule of the caliph al-Aziz Billah. 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 bi-Amr Allah ((r. 996 – 1021)), 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 Caliph al-Mustansir Billah ((r. 1036 – 1094)). Additions and renovations were carried during the reign of the remaining Fatimid caliphs. Caliph al-Hafiz undertook a major refurbishment in 1138, which established the keel-shaped arches and carved stucco decoration seen in the courtyard today, as well as the dome at the central entrance of the prayer hall.

Initially lacking a library, al-Azhar was endowed by the Fatimid caliph in 1005 with thousands of manuscripts that formed the basis of its collection. Fatimid efforts to establish Isma'ili practice among the population were, however largely unsuccessful. Much of its manuscript collection was dispersed in the chaos that ensued with the fall of the Fatimid Caliphate, and Al-Azhar became a Sunni institution shortly thereafter.

Ayyubid dynasty
Saladin, who overthrew the Fatimids in 1171, was hostile to the Shi’ite principles of learning propounded at al-Azhar during the Fatimid Caliphate, and under his Ayyubid dynasty the mosque suffered from neglect. Congregational prayers were banned by Sadr al-Din ibn Dirbass, appointed qadi by Saladin. The reason for this edict may have been Shāfi‘ī teachings that proscribe congregational prayers in a community to only one mosque, or mistrust of the former Shi'a institution by the new Sunni ruler. By this time, the much larger al-Hakim Mosque was completed; congregational prayers in Cairo were held there.

In addition to stripping al-Azhar of its status as congregational mosque, Saladin also ordered the removal from the mihrab of the mosque a silver band on which the names of the Fatimid caliphs had been inscribed. This and similar silver bands removed from other mosques totaled 5,000 dirhems. Saladin did not completely disregard the upkeep of the mosque and according to al-Mufaddal one of the mosque's minarets was raised during Saladin's rule.

The teaching center at the mosque also suffered. The once well stocked library at al-Azhar was neglected, and manuscripts of Fatimid teachings that were held at al-Azhar were destroyed. The Ayyubid dynasty promoted the teaching of Sunni theology in subsidized madrasas (schools) built throughout Cairo. Student funding was withdrawn, organized classes were no longer held at the mosque, and the professors that had prospered under the Fatimids were forced to find other means to earn their living.

Al-Azhar nevertheless remained the seat of Arabic philology and a place of learning throughout this period. While official classes were discontinued, private lessons were still offered in the mosque. There are reports that a scholar, possibly al-Baghdadi, taught a number of subjects, such as law and medicine, at al-Azhar. Saladin reportedly paid him a salary of 30 dinars, which was increased to 100 dinars by Saladin's heirs. While the mosque was neglected by Saladin and his heirs, the policies of the Sunni Ayyubid dynasty would have a lasting impact on al-Azhar. Educational institutions were established by Sunni rulers as a way of combating what they regarded as the heretical teachings of Shi'a Islam. These colleges, ranging in size, focused on teaching Sunni doctrine, had an established and uniform curriculum that included courses outside of purely religious topics, such as rhetorics, math, and science. No such colleges had been established in Egypt by the time of Saladin's conquest. Saladin and the later rulers of the Ayyubid dynasty would build twenty-six colleges in Egypt, among them the Salihiyya Madrasa.

Al-Azhar eventually adopted Saladin's educational reforms modeled on the college system he instituted, and its fortunes improved under the Mamluks, who restored student stipends and salaries for the shuyūkh (teaching staff).

Mamluk Sultanate
Congregational prayers were reestablished at al-Azhar during the Mamluk Sultanate by Sultan Baibars in 1266. While Shāfi‘ī teachings, which Saladin and the Ayyubids followed, stipulated that only one mosque should be used as a congregational mosque in a community, the Hanafi madh'hab, to which the Mamluks adhered, placed no such restriction. Al-Azhar had by now lost its association with the Fatimids and Ismāʿīli doctrines, and with Cairo's rapid expansion, the need for mosque space allowed Baibars to disregard al-Azhar's history and restore the mosque to its former prominence. Under Baibars and the Mamluk Sultanate, al-Azhar saw the return of stipends for students and teachers, as well as the onset of work to repair the mosque, which had been neglected for nearly 100 years. According to al-Mufaddal, the emir 'Izz al-Din Aydamur al-Hilli built his house next to the mosque and while doing so repaired the mosque. Al-Maqrizi reports that the emir repaired the walls and roof as well as repaving and providing new floor mats. The first khutbah since the reign of the Fatimid caliph al-Hakim took place on 16 January 1266 with the sermon delivered on a new pulpit completed five days earlier.

An earthquake in 1302 caused damage to al-Azhar and a number of other mosques throughout Mamluk territory. The responsibility for reconstruction was split among the amirs (princes) of the Sultanate and the head of the army, Sayf al-Din Salar, who was tasked with repairing the damage. These repairs were the first done since the reign of Baibars. Seven years later, a dedicated school, the Madrasa al-Aqbughawiyya, was built along the northwest wall of the mosque. Portions of the wall of the mosque were removed to accommodate the new building. Construction of another school, the Madrasa al-Taybarsiyya began in 1332–1333. This building, which was completed in 1339-1340, would also impact the structure of the mosque as it was built over the site of the mida'a, the fountain for ablution. Both of the madrasas were built as complementary buildings to al-Azhar, with separate entrances and prayer halls.

Though the mosque had regained its standing in Cairo, repairs and additional work were carried out by those in positions lower than sultan. This changed under the rule of al-Zahir Barquq, the first sultan of the Burji dynasty. Both Sultan Barquq and then Sultan al-Mu'ayyad tried, in 1397 and 1424 respectively, to replace the minaret of al-Azhar with a new one in stone, but on both occasions the construction was found to be defective and had to be pulled down. The resumption of direct patronage by those in the highest positions of government continued through to the end of Mamluk rule. Improvements and additions were made by the sultans Qaytbay and Qansuh al-Ghuri, each of whom oversaw numerous repairs and erected minarets that still stand today. It was common practice among the Mamluk sultans to build minarets, perceived as symbols of power and the most effective way of cementing one's position in the Cairo cityscape. The sultans wished to have a noticeable association with the prestigious al-Azhar. Al-Ghuri may also have rebuilt the dome in front of the original mihrab.

Although the mosque-school was the leading university in the Islamic world and had regained royal patronage, it did not overtake the madrasas as the favored place of education among Cairo's elite. Al-Azhar maintained its reputation as an independent place of learning, whereas the madrasas that had first been constructed during Saladin's rule were fully integrated into the state educational system. Al-Azhar did continue to attract students from other areas in Egypt and the Middle East, far surpassing the numbers attending the madrasas. Al-Azhar's student body was organized in riwaqs (fraternities) along national lines, and the branches of Islamic law were studied. The average degree required six years of study.

By the 14th century, al-Azhar had achieved a preeminent place as the center for studies in law, theology, and Arabic, becoming a cynosure for students all around the Islamic world. However, only one third of the ulema (Islamic scholars) of Egypt were reported to have either attended or taught at al-Azhar. One account, by Muhammad ibn Iyas, reports that the Salihiyya Madrasa, and not al-Azhar, was viewed as the "citadel of the ulema" at the end of the Mamluk Sultanate.

Province of the Ottoman Empire


With the Ottoman annexation of 1517, despite the mayhem their fight to control the city engendered, the Turks showed great deference to the mosque and its college, though direct royal patronage ceased. Sultan Selim I, the first Ottoman ruler of Egypt, attended al-Azhar for the congregational Friday prayer during his last week in Egypt, but did not donate anything to the upkeep of the mosque. Later Ottoman amirs likewise regularly attended Friday prayers at al-Azhar, but rarely provided subsidies for the maintenance of the mosque, though they did on occasion provide stipends for students and teachers. In contrast to the expansions and additions undertaken during the Mamluk Sultanate, only two Ottoman walīs (governors) restored al-Azhar in the early Ottoman period.

Despite their defeat by Selim I and the Ottomans in 1517, the Mamluks remained influential in Egyptian society, becoming beys ("chieftains"), nominally under the control of the Ottoman governors, instead of amirs at the head of an empire. The first governor of Egypt under Selim I was Khai'r Bey, a Mamluk amir who had defected to the Ottomans during the Battle of Marj Dabiq. Though the Mamluks launched multiple revolts to reinstate their Sultanate, including two in 1523, the Ottomans refrained from completely destroying the Mamluk hold over the power structure of Egypt. The Mamluks did suffer losses—both economic and military—in the immediate aftermath of the Ottoman victory, and this was reflected in the lack of financial assistance provided to al-Azhar in the first hundred years of Ottoman rule. By the 18th century the Mamluk elite had regained much of its influence and began to sponsor numerous renovations throughout Cairo and at al-Azhar specifically.

Al-Qazdughli, a powerful Mamluk bey, sponsored several additions and renovations in the early 18th century. Under his direction, a riwaq for blind students was added in 1735. He also sponsored the rebuilding of the Turkish and Syrian riwaqs, both of which had originally been built by Qaytbay.

This marked the beginning of the largest set of renovations to be undertaken since the expansions conducted under the Mamluk Sultanate. Abd al-Rahman Katkhuda was appointed katkhuda (head of the Janissaries) in 1749 and embarked on several projects throughout Cairo and at al-Azhar. Under his direction, three new gates were built: the Bab al-Muzayinīn (the Gate of the Barbers), so named because students would have their heads shaved outside of the gate, which eventually became the main entrance to the mosque; the Bab al-Sa'ayida (the Gate of the Sa'idis), named for the Sa'idi people of Upper Egypt; and, several years later, the Bab al-Shurba (the Soup Gate), from which food, often rice soup, would be served to the students. A prayer hall was added to the south of the original one, doubling the size of the available prayer space. Katkhuda also refurbished or rebuilt several of the riwaqs that surrounded the mosque. Katkhuda was buried in a mausoleum he himself had built in Al-Azhar; in 1776, he became the first person (and the last) to be interred within the mosque since Nafissa al-Bakriyya, a female mystic who had died around 1588.

During the Ottoman period, al-Azhar regained its status as a favored institution of learning in Egypt, overtaking the madrasas that had been originally instituted by Saladin and greatly expanded by the Mamluks. By the end of the 18th century, al-Azhar had become inextricably linked to the ulema of Egypt. The ulema also were able to influence the government in an official capacity, with several sheikhs appointed to advisory councils that reported to the pasha (honorary governor), who in turn was appointed for only one year. This period also saw the introduction of more secular courses taught at al-Azhar, with science and logic joining philosophy in the curriculum. During this period, al-Azhar saw its first non-Maliki rector; Abdullah al-Shubrawi, a follower of the Shafii madhab, was appointed rector. No follower of the Maliki madhab would serve as rector until 1899 when Salim al-Bishri was appointed to the post.

Al-Azhar also served as a focal point for protests against the Ottoman occupation of Egypt, both from within the ulema and from among the general public. Student protests at al-Azhar were common, and shops in the vicinity of the mosque would often close out of solidarity with the students. The ulema was also on occasion able to defy the government. In one instance, in 1730–31, Ottoman aghas harassed the residents living near al-Azhar while pursuing three fugitives. The gates at al-Azhar were closed in protest and the Ottoman governor, fearing a larger uprising, ordered the aghas to refrain from going near al-Azhar. Another disturbance occurred in 1791 in which the wāli harassed the people near the al-Hussein Mosque, who then went to al-Azhar to demonstrate. The wāli was subsequently dismissed from his post.

French occupation
Napoleon invaded Egypt in July 1798, arriving in Alexandria on July 2 and moving on to Cairo on July 22. In a bid to placate both the Egyptian population and the Ottoman Empire, Napoleon gave a speech in Alexandria in which he proclaimed his respect for Islam and the Sultan:

"People of Egypt, you will be told that I have come to destroy your religion: do not believe it! Answer that I have come to restore your rights and punish the usurpers, and that, more than the Mamluks, I respect God, his Prophet and the Koran ... Is it not we who have been through the centuries the friends of the Sultan?"

On July 25 Napoleon set up a diwan made up of nine al-Azhar sheikhs tasked with governing Cairo, the first body of Egyptians to hold official powers since the beginning of the Ottoman occupation. This practice of forming councils among the ulema of a city, first instituted in Alexandria, was put in place throughout French-occupied Egypt. Napoleon also unsuccessfully sought a fatwa from the al-Azhar imams that would deem it permissible under Islamic law to declare allegiance to Napoleon.

Napoleon's efforts to win over both the Egyptians and the Ottomans proved unsuccessful; the Ottoman Empire declared war on 9 September 1798, and a revolt against French troops was launched from al-Azhar on 21 October 1798. Egyptians armed with stones, spears, and knives rioted and looted. The following morning the diwan met with Napoleon in an attempt to bring about a peaceful conclusion to the hostilities. Napoleon, initially incensed, agreed to attempt a peaceful resolution and asked the sheikhs of the diwan to organize talks with the rebels. The rebels, believing the move indicated weakness among the French, refused. Napoleon then ordered that the city be fired upon from the Cairo Citadel, aiming directly at al-Azhar. During the revolt two to three hundred French soldiers were killed, with 3,000 Egyptian casualties. Six of the ulema of al-Azhar were killed following summary judgments laid against them, with several more condemned. Any Egyptian caught by French troops was imprisoned or, if caught bearing weapons, beheaded. The French troops intentionally desecrated the mosque, walking in with their shoes on and guns displayed. The troops tied their horses to the mihrab and ransacked the student quarters and libraries, throwing copies of the Quran on the floor. The leaders of the revolt then attempted to negotiate a settlement with Napoleon, but were rebuffed.

Napoleon, who had been well respected in Egypt and had earned himself the nickname Sultan el-Kebir (the Great Sultan) among the people of Cairo, lost their admiration and was no longer so addressed. In March 1800, French General Jean Baptiste Kléber was assassinated by Suleiman al-Halabi, a student at al-Azhar. Following the assassination, Napoleon ordered the closing of the mosque; the doors remained bolted until Ottoman and British assistance arrived in August 1801.

The conservative tradition of the mosque, with its lack of attention to science, was shaken by Napoleon's invasion. A seminal innovation occurred with the introduction of printing presses to Egypt, finally enabling the curriculum to shift from oral lectures and memorization to instruction by text, though the mosque itself only acquired its own printing press in 1930. Upon the withdrawal of the French, Muhammad Ali Pasha encouraged the establishment of secular learning, and history, math, and modern science were adopted into the curriculum. By 1872, under the direction of Jamāl al-Dīn al-Afghānī, European philosophy was also added to the study program.

Muhammad Ali Dynasty and British occupation
Following the French withdrawal, Ali, the wāli (governor) and self-declared khedive (viceroy) of Egypt, sought to consolidate his newfound control of the country. To achieve this goal he took a number of steps to limit, and eventually eliminate, the ability of the al-Azhar ulema to influence the government. He imposed taxes on rizqa lands (tax-free property owned by mosques) and madrasas, from which al-Azhar drew a major portion of its income. In June 1809, he ordered that the deeds to all rizqa lands be forfeited to the state in a move that provoked outrage among the ulema. As a result, Umar Makram, the naqib al-ashraf, a prestigious Islamic post, led a revolt in July 1809. The revolt failed and Makram, an influential ally of the ulema, was exiled to Damietta.

Ali also sought to limit the influence of the al-Azhar sheikhs by allocating positions within the government to those educated outside of al-Azhar. He sent select students to France to be educated under a Western system and created an educational system based on that model that was parallel to, and thus bypassed, the system of al-Azhar.

Under the rule of Isma'il Pasha, the grandson of Muhammad Ali, major public works projects were initiated with the aim of transforming Cairo into a European styled city. These projects, at first funded by a boom in the cotton industry, eventually racked up a massive debt which was held by the British, providing an excuse for the British to occupy Egypt in 1882 after having pushed out Isma'il Pasha in 1879.

The reign of Isma'il Pasha also saw the return of royal patronage to al-Azhar. As khedive, Isma'il restored the Bab al-Sa'ayida (first built by Katkhuda) and the Madrasa al-Aqbughawiyya. Tewfik Pasha, Isma'il's son, who became khedive when his father was deposed as a result of British pressure, continued to restore the mosque. Tewfik renovated the prayer hall that was added by Katkhuda, aligned the southeastern facade of the hall with the street behind it, and remodeled the facade of the Madrasa al-Aqbughawiya along with several other areas of the mosque. Abbas Hilmi II succeeded his father Tewfik as khedive of Egypt and Sudan in 1892, and continued the renovations started by his grandfather Isma'il. He restructured the main facade of the mosque and built a new three-story riwaq in neo-Mamluk style along the mosque's southwestern corner (known as the Riwaq al-'Abbasi) which was completed in 1901. Under his rule, the Committee for the Conservation of Monuments of Arab Art (also known as the "Comité"), also restored the original Fatimid sahn. These renovations were both needed and helped modernize al-Azhar and harmonize it with what was becoming a metropolis. The major set of reforms that began under the rule of Isma'il Pasha continued under the British occupation. Muhammad Mahdi al-'Abbasi, sheikh al-Azhar, had instituted a set of reforms in 1872 intended to provide structure to the hiring practices of the university as well as to standardize the examinations taken by students. Further efforts to modernize the educational system were made under Hilmi's rule during the British occupation. The mosque's manuscripts were gathered into a centralized library, sanitation for students improved, and a regular system of exams instituted. From 1885, other colleges in Egypt were placed directly under the administration of the al-Azhar Mosque.

During Sa'ad Zaghloul's term as minister of education, before he went on to lead the Egyptian Revolution of 1919, further efforts were made to modify the educational policy of al-Azhar. While a bastion of conservatism in many regards, the mosque was opposed to Islamic fundamentalism, especially as espoused by the Muslim Brotherhood, founded in 1928. The school attracted students from throughout the world, including students from Southeast Asia and particularly Indonesia, providing a counterbalance to the influence of the Wahhabis in Saudi Arabia.

Under the reign of King Fuad I, two laws were passed that reorganized the educational structure at al-Azhar. The first of these, in 1930, split the school into three departments: Arabic language, sharia, and theology, with each department located in buildings outside of the mosque throughout Cairo. Additionally, formal examinations were required to earn a degree in one of these three fields of study. Six years later, a second law was passed that moved the main office for the school to a newly constructed building across the street from the mosque. Additional structures were later added to supplement the three departmental buildings.

The ideas advocated by several influential reformers in the early 1900s, such as Muhammad Abduh and Muhammad al-Ahmadi al-Zawahiri, began to take hold at al-Azhar in 1928, with the appointment of Mustafa al-Maraghi as rector. A follower of Abduh, the majority of the ulema opposed his appointment. Al-Maraghi and his successors began a series of modernizing reforms of the mosque and its school, expanding programs outside of the traditional subjects. Fuad disliked al-Maraghi, and had him replaced after one year by al-Zawahiri, but al-Maraghi would return to the post of rector in 1935, serving until his death in 1945. Under his leadership, al-Azhar's curriculum was expanded to include non-Arabic languages and modern sciences. Al-Zawahiri, who had also been opposed by the ulema of the early 1900s, continued the efforts to modernize and reform al-Azhar. Following al-Maraghi's second term as rector, another student of Abduh was appointed rector.

Post 1952 revolution
Following the Egyptian Revolution of 1952, led by the Free Officers Movement of Mohamed Naguib and Gamal Abdel Nasser, in which the Egyptian monarchy was overthrown, the university began to be separated from the mosque. A number of properties that surrounded the mosque were acquired and demolished to provide space for a modern campus by 1955. The mosque itself would no longer serve as a school, and the college was officially designated a university in 1961. The 1961 law separated the dual roles of the educational institution and the religious institution which made judgments heeded throughout the Muslim world. The law also created secular departments within al-Azhar, such as colleges of medicine, engineering, and economics, furthering the efforts at modernization first seen following the French occupation. The reforms of the curriculum have led to a massive growth in the number of Egyptian students attending al-Azhar run schools, specifically youths attending primary and secondary schools within the al-Azhar system. The number of students reported to attend al-Azhar primary and secondary schools increased from under 90,000 in 1970 to 300,000 in the early 1980s, up to nearly one million in the early 1990s, and exceeding 1.3 million students in 2001.

During his tenure as Prime Minister, and later President, Nasser continued the efforts to limit the power of the ulema of al-Azhar and to use its influence to his advantage. In 1952, the waqfs were nationalized and placed under the authority of the newly created Ministry of Religious Endowments, cutting off the ability of the mosque to control its financial affairs. He abolished the sharia courts, merging religious courts with the state judicial system in 1955, severely limiting the independence of the ulema. The 1961 reform law, which invalidated an earlier law passed in 1936 that had guaranteed the independence of al-Azhar, gave the President of Egypt the authority to appoint the sheikh al-Azhar, a position first created during Ottoman rule and chosen from and by the ulema since its inception. Al-Azhar, which remained a symbol of the Islamic character of both the nation and the state, continued to influence the population while being unable to exert its will over the state. Al-Azhar became increasingly co-opted into the state bureaucracy after the revolution—independence of its curriculum and its function as a mosque ceased. The authority of the ulema were further weakened by the creation of government agencies responsible for providing interpretations of religious laws. While these reforms dramatically curtailed the independence of the ulema, they also had the effect of reestablishing their influence by integrating them further into the state apparatus. The 1961 reform law also provided the ulema with the resources of the state, though the purse strings were outside of their control. While Nasser sought to subjugate the ulema beneath the state, he did not allow more extreme proposals to limit the influence of al-Azhar. One such proposal was made by Taha Hussein in 1955. Hussein sought to dismantle the Azharite primary and secondary educational system and transform the university into a faculty of theology which would be included within the modern, secular, collegiate educational system. The ulema opposed this plan, though Nasser's choice of maintaining al-Azhar's status was due more to personal political considerations, such as the use of al-Azhar to grant legitimacy to the regime, than on the opposition of the ulema.

Al-Azhar, now fully integrated as an arm of the government, was then used to justify actions of the government. Although the ulema had in the past issued rulings that socialism is irreconcilable with Islam, following the Revolution's land reforms new rulings were supplied giving Nasser a religious justification for what he termed an "Islamic" socialism. The ulema would also serve as a counterweight to the Muslim Brotherhood, and to Saudi Arabia's Wahhabi influence. An assassination attempt on Nasser was blamed on the Brotherhood, and the organization was outlawed. Nasser, needing support from the ulema as he initiated mass arrests of Brotherhood members, relaxed some of the restrictions placed on al-Azhar. The ulema of al-Azhar in turn consistently supported him in his attempts to dismantle the Brotherhood, and continued to do so in subsequent regimes. Despite the efforts of Nasser and al-Azhar to discredit the Brotherhood, the organization continued to function. Al-Azhar also provided legitimacy for war with Israel in 1967, declaring the conflict against Israel a "holy struggle".

Following Nasser's death in 1970, Anwar Sadat became President of Egypt. Sadat wished to restore al-Azhar as a symbol of Egyptian leadership throughout the Arab world, saying that "the Arab world cannot function without Egypt and its Azhar". Recognizing the growing influence of the Muslim Brotherhood, Sadat relaxed several restrictions on the Brotherhood and the ulema as a whole. However, in an abrupt about-face, in September 1971 a crackdown was launched on journalists and organizations that Sadat felt were undermining or attacking his positions. As part of this effort to silence criticism of his policies, Sadat instituted sanctions against any of the ulema who criticized or contradicted official state policies. The ulema of al-Azhar continued to be used as a tool of the government, sparking criticism among several groups, including Islamist and other more moderate groups. Shukri Mustafa, an influential Islamist figure, accused the ulema of providing religious judgments for the sole purpose of government convenience. When Sadat needed support for making peace with Israel, which the vast majority of the Egyptian population regarded as an enemy, al-Azhar provided a decree stating that the time had come to make peace.

Hosni Mubarak succeeded Sadat as President of Egypt following Sadat's assassination in 1981. While al-Azhar would continue to oblige the government in granting a religious legitimacy to its dictates, the mosque and its clergy were given more autonomy under Mubarak's regime. Under Jad al-Haq, the sheikh of al-Azhar from 1982 until his death in 1994, al-Azhar asserted its independence from the state, at times criticizing policies of the state for instigating extremist Islamist sects. Al-Haq argued that if the government wished al-Azhar to effectively combat groups such as al-Gama'a al-Islamiyya then al-Azhar must be permitted greater independence from the state and for it to be allowed to make religious declarations without interference. Under Mubarak, a number of powers of the state were ceded to al-Azhar. During the 1990s, modifications to existing censorship laws gave al-Azhar the ability to censor both print and electronic media. Though the law stipulates that al-Azhar may only become involved following a complaint, in practice its role has been much more pervasive; for example, television scripts were routinely sent to al-Azhar for approval prior to airing.

Al-Azhar continues to hold a status above other Sunni religious authorities throughout the world, and as Sunnis form a large majority of the total Muslim population al-Azhar exerts considerable influence on the Islamic world as a whole. In addition to being the default authority within Egypt, al-Azhar has been looked to outside of Egypt for religious judgments. Prior to the Gulf War, Saudi Arabia's King Fahd asked for a fatwa authorizing the stationing of foreign troops within the kingdom, and despite Islam's two holiest sites being located within Saudi Arabia, he asked the head sheikh of al-Azhar instead of the Grand Mufti of Saudi Arabia. In 2003, Nicolas Sarkozy, at the time French Minister of the Interior, requested a judgment from al-Azhar allowing Muslim girls to not wear the hijab in French public schools, despite the existence of the French Council of Islam. The sheikh of al-Azhar provided the ruling, saying that while wearing the hijab is an "Islamic duty" the Muslim women of France are obligated to respect and follow French laws. The ruling drew much criticism within Egypt as compromising Islamic principles to convenience the French government, and in turn the Egyptian government.

Post 2011 revolution
Al-Azhar was not unaffected by the 2011 Egyptian revolution that saw the removal of Hosni Mubarak as president of Egypt. Student government elections in the months following the revolution resulted in an overwhelming victory for the once banned Muslim Brotherhood. Protests demanding that the military junta ruling Egypt restore the mosque's independence from the state broke out, and the mosque itself commissioned the writing of a draft law that would grant al-Azhar greater independence from the government. Within al-Azhar, debate on its future and rightful role within the state has replaced what had been a mollified single-voice in support of the policies of the Mubarak regime. The various views on al-Azhar's future role in Egypt come from several parties, including leading Islamist organizations such as the Muslim Brotherhood, liberal voices that wish to see al-Azhar stand as a bulwark against ultra-conservative Islamists (known as Salafists), and those that hope to see al-Azhar become wholly independent from the state and in complete control of its finances, leadership, and further that it be placed in charge of the religious ministries of the state. In 2018 a major restoration of the mosque was completed, financed by both King Abdullah and King Salman of Saudi Arabia. Among the goals of the restoration was the reinforcement of the building's foundations, the restoration of its architectural elements, and upgrades to its infrastructure. The Bab al-Muzayinīn (Gate of the Barbers), formerly one of the main public entrances to the mosque, has been made less accessible as a result of the restoration project.

In 2020, representatives from the mosque spoke out against sexual violence in Egypt, prompted by the social media campaign instigated by student Nadeen Ashraf.

Foundation and structural evolution under Fatimids
The original structure of the mosque was 280 ft in length and 227 ft wide, and was made up of three arcades situated around a courtyard. To the southeast of the courtyard was the original prayer hall, built as a hypostyle hall, five aisles deep, though with its qibla wall slightly off the correct angle. The marble columns supporting the four arcades that made up the prayer hall were reused from sites extant at different times in Egyptian history, from Pharaonic times through Roman rule to Coptic dominance. The different heights of the columns were made level by using bases of varying thickness. The stucco exterior shows influences from Abbasid, Coptic and Byzantine architecture.

Ultimately a total of three domes were built, a common trait among early north African mosques, although none of them have survived Al-Azhar's many renovations. The historian al-Maqrizi recorded that in the original dome al-Siqilli inscribed the following:"In the name of Allah, the Merciful, the Compassionate; according to the command for its building from the servant of Allah, His governor abu Tamim Ma'ad, the Imam al-Mu‘izz li-Dīn Allāh, Amir al-Mu'minin, for whom and his illustrious forefathers and his sons may there be the blessings of Allah: By the hand of his servant Jawhar, the Secretary, the Ṣiqillī in the year 360." Gawhar included the honorific Amir al-Mu'minin, Commander of the Faithful, as the Caliphs title and also included his nickname "the Secretary" which he had earned serving as a secretary prior to becoming a general. K. A. C. Creswell wrote that the original structure certainly had one dome, and likely a second for symmetry.

The original mihrab, uncovered in 1933, has a semi-dome above it with a marble column on either side. Intricate stucco decorations were a prominent feature of the mosque, with the mihrab and the walls ornately decorated. The mihrab had two sets of verses from the Quran inscribed in the conch, which is still intact. The first set of verses are the three that open al-Mu’minoon:"Successful indeed are the believers – who are humble in their prayers – and who avoid vain talk"The next inscription is made up of verses 162 and 163 of al-An'am:"Say: Surely my prayer and my sacrifice and my life and my death are (all) for Allah, the Lord of the worlds – No associate has He; and this am I commanded, and I am the first of those who submit."These inscriptions are the only surviving piece of decoration that has been definitively traced to the Fatimids.

The marble paved central courtyard was added between 1009 and 1010. The arcades that surround the courtyard have keel shaped arches with stucco inscriptions. The arches were built during the reign of al-Hafiz li-Din Allah. The stucco ornaments also date to his rule and were redone in 1891. Two types of ornaments are used. The first appears above the center of the arch and consists of a sunken roundel and twenty-four lobes. A circular band of vegetal motifs was added in 1893. The second ornament used, which alternates with the first appearing in between each arch, consists of shallow niches below a fluted hood. The hood rests on engaged columns which are surrounded by band of Qu'ranic writing in Kufic script. The Qu'ranic script was added after the rule of al-Hafiz but during the Fatimid period. The walls are topped by a star shaped band with tiered triangular crenellations. The southeastern arcade of the courtyard contains the main entrance to the prayer hall. A Persian framing gate, in which the central arch of the arcade is further in with a higher rectangular pattern above it, opens into the prayer hall.

A new wooden door was installed during the reign of al-Hakim in 1009. In 1125, al-Amir installed a new wooden mihrab. An additional dome was constructed during the reign of al-Hafiz li-Din Allah. He additionally ordered the creation of a fourth arcade around the courtyard and had a porch built on the western end of the sahn.

Mamluk additions
The Fatimid dynasty was succeeded by the rule of Saladin and his Ayyubid dynasty. Initially appointed vizier by the last Fatimid Caliph Al-'Āḍid (who incorrectly thought he could be easily manipulated), Saladin consolidated power in Egypt, allying that country with the Sunni Abbasid Caliphate in Baghdad. Distrusting al-Azhar for its Shi'a history, the mosque lost prestige during his rule. However, the succeeding Mamluk dynasty made restorations and additions to the mosque, overseeing a rapid expansion of its educational programs. Among the restorations was a modification of the mihrab, with the installation of a polychrome marble facing.

Madrasa al-Taybarsiyya
The Madrasa al-Taybarsiyya, which contains the tomb of Amir Taybars, was built in 1309. Originally intended to function as a complementary mosque to al-Azhar it has since been integrated with the rest of the mosque. The Maliki and Shāfi‘ī madh'hab were studied in this madrasa, though it now is used to hold manuscripts from the library. The only surviving piece from the original is the qibla wall and its polychrome mihrab. Al-Maqrizi reported that the madrasa was used only for studying the Shāfi‘ī while the historian Ibn Duqmaq reported that one of the liwans in the madrasa was reserved for Shāfi‘ī teachings while the other was for Maliki teachings.

The madrasa was completely rebuilt by Abd al-Rahman Katkhuda, leaving only the southeastern wall and its mihrab untouched. The mihrab was described by K. A. C. Creswell as being "one of the finest in Cairo". The niche of the mihrab is 1.13 m wide and 76 cm deep. On each side of the niche stands a 2.78 m high porphyry column. Above the columns are impost blocks decorated with colored geometrical designs. The semi-dome at the top of the mihrab is set within an outer arch. Surrounding this arch is a molding that forms a rectangular outer frame. This is the first mihrab in Egypt to have this type of frame. Inside the frame are glass mosaics depicting pomegranate trees.

Madrasa and mausoleum of Aqbugha
A dome and minaret cover the Madrasa al-Aqbughawiyya, which contains the tomb of Amir Aqbugha, which was built in 1339. Intended by its founder, another Mamluk amir called Sayf al-Din Aqbugha 'Abd al-Wahid, to be a stand-alone mosque and school, the madrasa has since become integrated with the rest of the mosque. It includes both a small tomb chamber and a larger hall, both with mihrabs. The entrance, qibla wall, and the mihrabs with glass mosaics are all original, while the pointed dome was rebuilt in the Ottoman period. Parts of the facade were remodeled by Khedive Tewfik in 1888. The top of the minaret was remodelled by Abd al-Rahman Katkhuda so as to have a pointed top like the other Ottoman-style minarets he built around the entrances of the mosque, but at some point after 1932 the top was once again refashioned to end with a Mamluk-style finial which we see today.

Madrasa Gawhariyya
Built in 1440, the Madrasa Gawhariyya contains the tomb of Gawhar al-Qanaqba'i, a Sudanese eunuch who became treasurer to the sultan. The floor of the madrasa is marble, the walls lined with cupboards, decoratively inlaid with ebony, ivory, and nacre. The tomb chamber is covered by small stone dome whose exterior is carved with an arabesque pattern, making it one for the earliest domes in Cairo with this type of decoration (later refined in the dome of Qaytay's mausoleum in the Northern Cemetery). The structure was restored between 1980 and 1982.

Minaret of Qaytbay
Built in 1483 or in 1495, it has a square base, a transitional segment leading into an octagonal shaft, then a 10-sided polygon shaft, followed by a cylindrical shaft that consists of 8 brick pillars, each two adjoined by bricks in between. The Minaret of Qaytbay also has three balconies, supported by muqarnas, a form of stalactite vaulting which provide a smooth transition from a flat surface to a curved one (first recorded to have been used in Egypt in 1085), that adorn the minaret. The first shaft is octagonal is decorated with keel-arched panels on each side, with a cluster of three columns separating each panel. Above this shaft is the second octagonal shaft which is separated from the first by a balcony and decorated with plaiting. A second balcony separates this shaft with the final cylindrical shaft, decorated with four arches. Above this is the third balcony, crowned by the finial top of the minaret.

The minaret is believed to have been built in the area of an earlier, Fatimid-era brick minaret that had itself been rebuilt several times. Contemporary accounts suggest that the Fatimid minaret had defects in its construction and needed to be rebuilt several times, including once under the direction of Sadr al-Din al-Adhra'i al-Dimashqi al-Hanafi, the qadi al-qudat (Chief Justice of the Highest Court) during the rule of Sultan Baibars. Recorded to have been rebuilt again under Barquq in 1397, the minaret began to lean at a dangerous angle and was rebuilt in 1414 by Taj al-Din al-Shawbaki, the walī and muhtasib of Cairo, and again in 1432. The Qaytbay minaret was built in its place as part of a reconstruction of the entrance to the mosque.

Gate of Qaytbay
Directly across the courtyard from the entrance from the Bab al-Muzayinīn is the Gate of Qaytbay. It is a refined example of the late Mamuk architectural and decorative style. Built in 1495, this gate leads to the court of the prayer hall.

Minaret of al-Ghuri
The double finial minaret was built in 1509 by Qansuh al-Ghuri. Sitting on a square base, the first shaft is octagonal, and four sides have a decorative keel arch, separated from the adjacent sides with two columns. The second shaft, a 12-sided polygon separated from the first by fretted balconies supported by muqarnas, is decorated with blue faience. A balcony separates the third level from the second shaft. The third level is made up of two rectangular shafts with horseshoe arches on each side of both shafts. Atop each of these two shafts rests a finial atop two identical onion shaped bulbs, with a balcony separating the finials from the shafts.

Ottoman renovations and additions
Several additions and restorations were made during Ottoman reign in Egypt, many of which were completed under the direction of Abd al-Rahman Katkhuda who nearly doubled the size of the mosque. Three gates were added by Katkhuda, the Bab al-Muzayinīn (see below), which became the main entrance to the mosque, the Bab al-Shurba (the Soup Gate), and the Bab al-Sa'ayida (the Gate of the Sa'idis). To each gate he added a pointed Ottoman-style minaret, of which one was later demolished during the creation of al-Azhar Street. For the Bab al-Muzayinīn, which was adjacent to the Madrasa al-Aqbughiyya, he remodelled the top of Aqbugha's minaret to make it resemble the other Ottoman minarets (though the top was later rebuilt again in a Mamluk style during the 20th century). Several riwaqs were added, including one for the blind students of al-Azhar, as well as refurbished during the Ottoman period. Katkhuda also added an additional prayer hall south of the original Fatimid hall, with an additional mihrab, doubling the total prayer area. His overall work reintegrated the mosque's disparate elements in a relatively unified whole.

Bab al-Muzayinīn
The Bab al-Muzayinīn ("Gate of the Barbers", Arabic: باب المزينين) was built in 1753. Credited to Katkhuda the gate has two doors, each surrounded by recessed arches. Two molded semi-circular arches with tympanums decorated with trefoils stand above the doors. Above the arches is a frieze with panels of cypress trees, a common trait of Ottoman work.

A free-standing minaret, built by Katkhuda, originally stood outside the gate. The minaret was demolished prior to the opening of al-Azhar street by Tewfik Pasha during modernization efforts which took place throughout Cairo.

Current layout and structure
The present main entrance to the mosque is the Bab al-Muzayinīn, which opens into the white marble-paved courtyard at the opposite end of the main prayer hall. To the northeast of the Bab al-Muzayinīn, the courtyard is flanked by the façade of the Madrasa al-Aqbughawiyya; the southwestern end of the courtyard leads to the Madrasa al-Taybarsiyya. Directly across the courtyard from the entrance to the Bab al-Muzayinīn is the Bab al-Gindi (Gate of Qaytbay), built in 1495, above which stands the minaret of Qaytbay. Through this gate lies the courtyard of the prayer hall.

The mihrab has recently been changed to a plain marble facing with gold patterns, replacing some of the Mamluk marble facing, but the stucco carvings in the semi-dome are likely from the Fatimid era.