[4][5] The mosque consists of a large open courtyard surrounded by roofed sections that are divided into aisles by rows of pointed arches.
[11][9] According to Balawi, a 10th-century author, the architect of the mosque was a man named al-Nasrani, a non-Muslim, possibly Christian, who had previously designed the Aqueduct of Basatin, another of Ibn Tulun's construction projects in the area.
[12] Ibn Tulun's administrative palace, the Dar al-Imara, adjoined the mosque directly on its southeastern side, behind the qibla wall.
[13] Ibn Tulun was able to enter his mosque directly from the Dar al-Imara via a doorway that can still be seen to the right of the mihrab (niche symbolizing the qibla).
[14] Al-Qata'i was eventually razed to the ground in 905 by the Abbasid general Muhammad ibn Sulayman al-Katib, who was sent to retake control of Egypt.
The mosque was spared because of its religious function while the palace was re-used by the subsequent Ikhshidid governors as an administrative center.
[16] The original fountain (fawara) in the center of the mosque's courtyard, which had previously burned down, was rebuilt on the orders of Caliph al-'Aziz in 995.
[19] Badr al-Jamali's son and successor, al-Afdal Shahinshah, added a flat stucco mihrab to one of the prayer hall's piers in 1094.
After the assassination of the Mamluk sultan Al-Ashraf Khalil (r. 1290–1293), one of the accomplices in the murder, Lajin, hid inside the mosque, by which time the building had fallen into ruin.
[22] Mamluk-era writers report that Lajin hid inside the ruins of the original minaret, spent a miserable year there, and vowed that if God saved him and allowed him to become sultan he would restore the mosque.
[25] At some point during the reign of Muhammad Ali in the early 19th century, the mosque was turned into a military hospital and then a salt warehouse.
During the conversion, Clot Bey ordered some of the arches around the mosque's courtyard to be walled up, an act which was criticized as vandalism by some 19th-century writers who visited the site afterwards.
Recommendations were made to remove the walls blocking the arches and demolish the ad hoc structures that had been constructed inside the mosque by its poor inhabitants.
[32] A major event was the visit of King Fuad I, who attended Friday prayers in the mosque on 3 May 1918, the first ruler of Egypt to do so since Sultan Lajin.
[34] Repair works continued intermittently after this, including the reconstruction of the westernmost walls of the ziyada (outer enclosure) from 1947 to 1948.
[36] While the mosque did not suffer greatly from the 1992 Cairo earthquake, the top of the minaret was damaged and its integrity compromised, which elicited the installation of scaffolding to support it.
[38] This action and other aspects of the restoration project were questioned and criticized by some scholars of Islamic architecture, including Caroline Williams.
[1][2] Its architectural style is closely modeled on that of the Abbasid capital of the time, Samarra, where Ibn Tulun had spent much of his early career before being sent to Egypt.
As a result, the mosque is one of the best surviving examples of the Abbasid architectural style of this period, which was dominated by the influence of Samarra.
[3][41][42][2] The mosque is one of the largest in Egypt by area: including its outer enclosure (ziyada), it occupies 26,318 square metres (283,280 sq ft).
[45] On the inside, the mosque consists of a spacious central courtyard (sahn) surrounded on four sides by roofed halls or galleries (riwaqs) divided into aisles by rows of pointed arches supported on piers.
[56] This dates to the restoration of Sultan Lajin in 1296, confirmed by a wooden inscription (now partially faded) in an upper corner on the outer wall of the kiosk.
A sundial that once existed in the kiosk, mentioned in Sultan Lajin's inscription and recorded in the Description de l'Égypte, may have been associated with this room.
[64] Legend has it that Ibn Tulun himself was accidentally responsible for the design of the structure: supposedly while sitting with his officials, he absentmindedly wound a piece of parchment around his finger.
The design of the minaret's top level, in the characteristic mabkhara-style, is of early Mamluk style,[60] while the horseshoe arches and corbels look to be of 13th-century Andalusi inspiration.
[68] Doris Behrens-Abouseif argues that the structure instead shows evidence of multiple construction phases and that the original Tulunid minaret mostly survived but was then restored by Sultan Lajin, who added some of the present-day elements.
[69] Historical sources and early 19th-century illustrations indicate that the minaret was previously topped by an unusual copper finial in the shape of a boat.
[70] At the southwestern corner of the mosque, standing within the ziyada, is a sabil-maktab or sabil-kuttab (structure combining a sabil and maktab).
[71] At the southeastern corner of the mosque, located outside the ziyada and on the site of the former Dar al-Imara,[72] is a pair of historic mansions, connected by a bridge, which became known as Bayt al-Kritliya.
[73] Another structure outside the ziyada, adjoining its outer wall on the northwest side, is the Madrasa of Amir Sarghatmish, built around 1350.