# Mosque of Ibn Tulun

The Mosque of Ibn Tulun (Arabic: مسجد إبن طولون, romanized: Masjid Ibn Ṭūlūn) is a historic mosque in Cairo, Egypt. Built between 876 and 879 by its namesake, Ahmad ibn Tulun, it is the oldest well-preserved mosque in Egypt. Its design was inspired by the 9th-century mosques of Samarra in Iraq, the Abbasid capital at the time, making it an important representative of classical Abbasid architecture. Today, it is one of the most significant monuments of Islamic architecture in Egypt.
The mosque consists of a large open courtyard surrounded by roofed sections that are divided into aisles by rows of pointed arches. The arches are decorated with carved stucco, though not all of the original decoration has been preserved. The mosque is surrounded by an outer enclosure, the ziyada. The minaret, which has an unusual form with an external spiral staircase, stands in this enclosure. Various additions and restorations were made after the 9th century, including an important renovation by the Mamluk sultan Lajin in 1296. The present-day fountain and domed kiosk in the center of the courtyard date from this restoration. In addition to the main mihrab (niche symbolizing the direction of prayer), the prayer hall contains several flat stucco mihrabs added in different periods. After a period of severe neglect in the 19th century, during which the building was converted to other uses, the mosque was restored in the 20th century.

## History
### Construction and early history

The mosque was commissioned by Ahmad ibn Tulun, the Abbasid governor of Egypt from 868 to 884. He was able to establish himself as a de facto autonomous ruler over Egypt and parts of the Levant. In 870, he began construction on a new administrative capital, al-Qata'i. It was located a short distance to the northwest of Fustat (the first Muslim capital of Egypt and its main city) and al-'Askar (the second capital built nearby by the Abbasids).
The Ibn Tulun Mosque was built to serve as al-Qata'i's congregational mosque. It was the third congregational mosque to be built in what is now Cairo, after the Mosque of 'Amr and the main mosque of al-'Askar. The medieval historian al-Maqrizi states that its construction started in 876 CE, while an original inscription slab found in the mosque identifies the date of completion as Ramadan 265 AH, corresponding to April–May 879 CE. 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.
The mosque was constructed on a small hill called Gebel Yashkur, "The Hill of Thanksgiving." One local legend says that it is here that Noah's Ark came to rest after the Deluge, rather than at Mount Ararat. Ibn Tulun's administrative palace, the Dar al-Imara, adjoined the mosque directly on its southeastern side, behind the qibla wall. 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).
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. Only the mosque and the adjoining Dar al-Imara were left standing. The mosque was spared because of its religious function while the palace was re-used by the subsequent Ikhshidid governors as an administrative center. Today, the mosque is the only surviving monument of this city.

### Later history

The mosque and the palace continued to see some use during the Fatimid period (after 969) and the Fatimid caliph al-Hafiz is recorded as having ordered some construction in the mosque in 1132, though it is unclear what work was done. 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. The mosque and the area around it declined further in the following century. Part of the mosque was burned during riots in 1067. Badr al-Jamali (d. 1094), the powerful Fatimid vizier, restored the mosque, as indicated by the inscription he placed above what is still the main entrance to the mosque today. 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.
By the 12th century, the mosque was being used as a caravanserai for North African pilgrims on their way to the Hijaz. 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. 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. When he later became sultan (r. 1296–1299), he fulfilled this pledge and initiated a major restoration of the mosque in 1296. Lajin's works, many of which remain today, included renovating the main mihrab's decoration, building the dome in front of it, adding a new wooden minbar (pulpit), renovating the minaret, and building the present-day fountain in the center of the courtyard and the domed structure over it.
In 1524, a zawiya (Sufi convent) and tomb were built next to the minaret and are mentioned by historical sources as associated with a founder named either Sheikh Sharaf al-Din al-Madini or Sheikh al-Bushi. Its ruined remains were demolished in 1943.
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. A blacksmith workshop was also installed in it. In 1846, Clot Bey received permission from Muhammad Ali to convert it into a mental asylum and sometime after this it became a poorhouse. 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.
As a result of these different uses, the building deteriorated severely in the 19th century Some of the arches of the prayer hall along the courtyard façade collapsed in 1877. The mosque continued to be neglected in this manner until 1880, when architect Julius Franz Pasha [de], the head of the government's Comité de Conservation des Monuments de l'Art Arabe ('Committee for the Conservation of the Monuments of Arab Art'), closed the building and evicted its inhabitants. After this, it was examined by the Comité and assessed for repairs. Damage to the ceiling, arches, and minbar were all reported, among other problems. 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.
After another examination in 1890, the Comité began restoration work. Various works were undertaken over the following years, though not enough to resolve all problems. The ceiling over the prayer hall continued to progressively fall apart, along with its arches facing the courtyard. 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. He subsequently took an interest in the mosque's maintenance and ordered the expropriation and removal of structures encroaching on it. In the following decade, efforts continued to remove encroaching structures and clear rubble. The Comité finally reconstructed the mosque's ceiling in 1927 and in the following two years it reconstructed the damaged arches of the prayer hall. Repair works continued intermittently after this, including the reconstruction of the westernmost walls of the ziyada (outer enclosure) from 1947 to 1948.
The Comité was dissolved in 1961 and the mosque, like other Islamic-era monuments in Cairo, was neglected for a time after this. Restoration efforts were resumed in 1978 by the government's Egyptian Antiquities Organization. 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.
The mosque underwent a full restoration from 2002 to 2004, which cost 2.5 million US dollars. One of the significant changes to the mosque's appearance was the paving of the entire courtyard with stone, as it had previously been largely unpaved. This had the negative side effect of causing humidity to accumulate along the walls, which were then injected with a consolidant. This action and other aspects of the restoration project were questioned and criticized by some scholars of Islamic architecture, including Caroline Williams.

## Architecture

The Ibn Tulun Mosque is the oldest mosque in Egypt to largely retain its original form. 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. 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). It is built primarily out of brick, except for the minaret, which is built of stone.

### Exterior

An outer enclosure, the ziyada, surrounds the mosque on three sides and provided a buffer between the prayer space and the surrounding urban environment. The mosque's minaret stands in this enclosure on the northwest side. Originally, the mosque's ziyada contained ablutions facilities, latrines, and a medical clinic. The outer walls of the ziyada were likely adjoined by shops and neighbourhood markets. In the early 20th century, any market structures that were still adjoining the outer walls were removed.
The mosque had a total of twenty-two entrances: nineteen entrances through the ziyada (with doorways in the outer wall corresponding to doorways into the mosque proper) and another three doorways in the qibla (southeastern) wall. Only one entrance is used by visitors today. Unlike in later Egyptian mosques, none of the entrances are given architectural prominence, as this was not a feature of mosque architecture in Egypt until the later Fatimid period. The outer wall of the ziyada and the outer wall of the mosque are both topped by decorative crenellations consisting of brick openwork whose form, vaguely reminiscent of linked human figures, is likely derived from the decorative motifs inside the mosque.

### Interior

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. On the qibla side, this roofed area forms the main prayer hall and is five aisles deep, while the other three wings around the courtyard are two aisles deep. The arches and piers are built of brick and uphold a wooden roof built with palm. The corners of the piers are rounded by engaged columns. The upper parts of the piers, between the arches, are pierced with pointed windows that have their own colonettes.
A dikka (raised platform for muezzins and Qur'an reciters) is located between two piers in the center of the prayer hall. It most likely dates to the Mamluk period. Next to the main mihrab (the concave niche in the qibla wall) is a wooden minbar, a pulpit for the imam, consisting of a wooden staircase leading to small kiosk-like structure topped by a curving finial. The inscription on the minbar attributes it to Sultan Lajin and dates it to 1296. It is an excellent example of early Mamluk-period woodwork.

#### Decoration and inscriptions

The outlines of the arches, their intrados (undersides), and the capitals of the engaged columns are covered with carved stucco decoration, although only the arches of the southwestern side still preserve most of their intrados decoration. This decoration features geometric and floral patterns. They are derived from the Abbasid style associated with Samarra in this period, particularly those known to scholars as the "Samarra B" and "Samarra C" styles. Originally, this stucco decoration would have been painted in vivid colours, but the paint has since faded away. On the courtyard façades, the windows between the arches are also flanked by decorative rosettes.
The 128 windows of the mosque are also outlined with similar stucco decoration and are covered by stucco grilles. The window grilles seen today have a variety of geometric designs and date from different periods and restorations. Three or four of them are still original, from Ibn Tulun's time, and feature the simplest designs. The rest, with more complex designs, are from later restorations, including at least six from the Mamluk restoration of 1296.
A long inscription on a wooden frieze runs just below the ceiling around the walls of the entire mosque, although much of it has disappeared over time and the frieze is now fragmented throughout the mosque. The inscription is carved in Kufic letters and is nearly 2 kilometres (1.2 mi) long in total. It replicates verses from the Qur'an, totaling to around one fifteenth of the entire book. The inscription is unusual for its time and it makes the Ibn Tulun Mosque the oldest surviving Islamic monument to contain religious inscriptions of such length.

#### Mihrabs (prayer niches)

The mosque contains six mihrabs (niches symbolizing the qibla or direction of prayer) at the mosque, five of which are flat as opposed to the main niche, which is concave. The main niche is situated in the centre of the qibla wall and is the tallest of the six. It dates from the Tulunid period but was redecorated under Sultan Lajin. The carved stucco decoration around the niche still dates from the Tulunid period, as do the pairs of marble columns with Coptic-style capitals on either side of the niche. Above the niche is a wooden frieze carved with a Kufic inscription of the Shahada (Muslim declaration of faith) followed by a blessing. Above this is a panel of wood with traces of faded painted decoration. The decoration inside the niche dates from Sultan Lajin's restoration. The upper zone is made of painted wood whose decoration has deteriorated, while the lower zone is covered in marble paneling that is characteristic of Mamluk decoration. In between these two zones is a wide band of glass mosaic containing an inscription of the Shahada in Naskhi script.
The other mihrabs in the prayer hall, all flat instead of concave, are the following:
* The same qibla wall also features a smaller stucco mihrab to the left of the main niche. Its muqarnas sculpting and Naskhi calligraphy indicate an early Mamluk origin.
* The two mihrabs on the piers flanking the dikka are decorated in the Samarran style, with one containing a unique medallion with a star hanging from a chain. The Kufic Shahada inscriptions on both do not mention Ali and were thus made before the Shi'a Fatimids came to power.
* The westernmost mihrab, installed by al-Afdal Shahanshah, is a replica of an original kept at Cairo's Museum of Islamic Art. It is ornately decorated in a style with influences from Persia. The Kufic inscription mentions the Fatimid caliph al-Mustansir, on whose orders the niche was made, as well as the Shi'a Shahada including Ali as God's wali after declaring the oneness of God and the prophethood of Muhammad.
* On the pier to the left are the remains of a copy of al-Afdal's mihrab. It differs, however, by referring to Sultan Lajin instead of al-Mustansir, and a lack of Ali's name.
* Mihrabs
* Main mihrab
* Detail of the decoration inside the mihrab
* Detail of the decoration above the mihrab
* The smaller Mamluk-era mihrab on the qibla wall
* Dikka flanked by two pre-Fatimid prayer niches
* Pre-Fatimid mihrab with the medallion with a star hanging from a chain
* Al-Afdal's mihrab in honour of al-Mustansir
* The partially damaged "copy" on the left pier

#### Fountain

In the center of the courtyard is a fountain (fisqiya) used for ablutions. It is sheltered by a square kiosk that is open through arches on all four sides, built in stone, and covered by a dome, built in brick. 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.
The original Tulunid fountain of the mosque, referred to as a fawwāra, was covered by a dome resting on ten columns and surrounded by another sixteen columns. The columns were made of gilded marble. This structure burned down, most likely in the late 10th century, before it was replaced by another.
The present-day fountain consists of an octagonal stone basin on the floor. It was formerly surrounded by a marble floor which has since been replaced by modern pavement. The squinches inside the dome are executed in muqarnas ("stalactite"-style sculpting). Above the muqarnas is an inscription band carved in stucco containing part of Surah 4:43 from the Qur'an. At the apex of the dome is a circular medallion of carved stucco containing another inscription, of Surah 5:6. The outer walls of the kiosk were crowned by stepped crenellations that have disappeared.
Inside the northeastern wall, which is thicker than the others, is a small staircase that once led to a small room built on top of the wall, at the same level as the drum of the dome. This room, of unclear purpose and origin, could still be seen in 19th-century photos but was removed in the early 20th century. 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. This feature suggests that the room was intended for use by the timekeeper of the mosque.

### Minaret

The minaret is unusual in form. It consists of a rectangular (cuboid) shaft at the base, followed by a cylindrical section. An external staircase wraps around both sections in a spiral fashion. The shaft is crowned by a lantern-like summit, sometimes described as a mabkhara, with a ribbed dome. The tower is connected to the wall of the mosque by a bridge with horseshoe arches.
There is scholarly controversy over the construction date of the minaret. Historical records attest that the original minaret built under Ibn Tulun had an external staircase, which recalls the design of the helicoidal or spiral minarets in Abbasid Samarra (such as the Malwiya). The minarets of Samarra were thus probably the inspiration for its design. At least one historical source, Ibn Duqmaq, claimed that the staircase was wide enough to accommodate two camels. 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. When someone asked him what he was doing, he responded, embarrassed, that he was designing his minaret. Architectural historian Tarek Swelim argues that the original minaret was probably aligned with the central axis of the building, like other Abbasid minarets from the 9th century, instead of the current tower's location.
Many of the architectural features in the current structure, however, point to a later construction. The design of the minaret's top level, in the characteristic mabkhara-style, is of early Mamluk style, while the horseshoe arches and corbels look to be of 13th-century Andalusi inspiration. The fact that it is built of stone instead of brick is inconsistent with the rest of the mosque. Moreover, the minaret does not connect well with the main mosque structure, something that would have been averted had the minaret and mosque been built at the same time.
Architectural historians have drawn varying conclusions. K. A. C. Creswell argued that the entire structure of the present minaret is a reconstruction by Mamluk sultan Lajin from the 1296 restoration and that it was inspired by the original Tulunid spiral minaret. Jonathan Bloom suggests that the original minaret may have disappeared by the second half of the 12th century and that it was rebuilt in the late 12th or early 13th century. 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. She notes that the main shaft does not resemble any Mamluk-era minarets and that this would be unlikely if Lajin had rebuilt it completely. She also points out that one 10th-century source, al-Muqaddasi, states that the Tulunid minaret was indeed built of stone and notes that no sources mention its demolition or disappearance. Tarek Swelim suggests that the original minaret was damaged and at some point was replaced by a minaret with the present-day rectangular base, built next to the original. He suggests that the circular portion of the shaft was perhaps added during the Ayyubid period (late 12th to early 13th centuries) and then the top level was added by Lajin.
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. This finial was possibly replaced by a similar one at some point before the 1840s but it must have disappeared sometime between 1800, when it was last noted, and 1892, when it was replaced by a crescent-shaped finial.

## Adjacent structures

At the southwestern corner of the mosque, standing within the ziyada, is a sabil-maktab or sabil-kuttab (structure combining a sabil and maktab). This structure has been attributed to either Sultan Lajin in 1296 or to Sultan Qaytbay between 1462 and 1482. Tarek Swelim suggests that it was most likely built first by Lajin and then restored by Qaytbay.
At the southeastern corner of the mosque, located outside the ziyada and on the site of the former Dar al-Imara, is a pair of historic mansions, connected by a bridge, which became known as Bayt al-Kritliya. They were built in the 16th and 17th centuries. The complex now serves as the Gayer-Anderson Museum. Another structure outside the ziyada, adjoining its outer wall on the northwest side, is the Madrasa of Amir Sarghatmish, built around 1350.

## In popular culture

Parts of the James Bond film The Spy Who Loved Me were filmed at the mosque. The mosque is featured in the game Serious Sam 3: BFE, forming a significant part of the game's third level. It is also featured in a level of Tomb Raider: The Last Revelation.
The front of the Egyptian five-pound banknote has been adorned with an illustration of the Ibn Tulun Mosque in multiple editions. Meanwhile, the back of the current banknote features an image of a Pharaonic painting.