The Mosque of al‑Hakim bi‑Amr Allah is the fourth oldest mosque in Egypt, and the second largest after the Mosque of Ibn Tulun. The construction of the mosque was begun by al‑Hakim’s father, the Fatimid Caliph al‑‘Aziz bi‑Allah in 379 AH/989 AD, but he died before its completion, leaving his son to finish it in 403 AH/1013 AD. The mosque is located at the end of al‑Mu’izz Street in al‑Jamaliya district, between Bab al‑Futuh and Bab al‑Nasr.
The main entrance lies on the western side of the mosque, and is monumental in size and design. It is one of the oldest architectural examples of projecting stone porches, and was influenced by the great Mosque of Mahdiya in Tunis. The mosque once served as a Shiite center in Egypt, and is comparable to the role al‑Azhar Mosque would later play for Sunni Islam.
The mosque has a long and intriguing history, including its role as a barracks during the French campaign, when its minarets were utilized as watch-towers. Originally, the mosque was constructed as an enclosure by the Fatimid Vizier Gawhar al‑Siqilli (d. 382 AH/992 AD), and was later incorporated into the fortifications built by the general Badr al‑Jamali (d. 487 AH/1094 AD). The plan of the mosque consists of an irregular triangle with four arcades centering a courtyard. Two minarets flank either side of the façade, and they have undergone several restoration phases throughout their lifetime.