# Aghlabid architecture

Aghlabid architecture dates to the rule of the Aghlabid dynasty in Ifriqiya (modern-day Tunisia) during the 9th century and the beginning of the 10th century. The dynasty ruled nominally on behalf of the Abbasid Caliphs, with which they shared many political and cultural connections. Their architecture was heavily influenced by older antique (Roman and Byzantine) architecture in the region as well as by contemporary Abbasid architecture in the east. The Aghlabid period is also distinguished by a relatively large number of monuments that have survived to the present day, a situation unusual for early Islamic architecture. One of the most important monuments of this period, the Great Mosque of Kairouan, was a model for mosque architecture in the region. It features one of the oldest minarets and contains one of the oldest surviving mihrabs in Islamic architecture.

## Historical background

The Muslim conquest of North Africa took place progressively during the 7th century. During this period, the city of Kairouan was founded in 670 and served as the regional capital of the Maghreb. The Great Mosque of Kairouan, the city's congregational mosque, was also initially founded in 670. The Abbasid revolution in 750 put the Abbasid Caliphs in overall control of the Islamic empire, overthrowing the previous Umayyad Caliphs. In Ifriqiya, several rebellions and attacks on Kairouan, mainly from the Kharijites, had to be suppressed.$^{:22}$
In 800 the Abbasid caliph Harun al-Rashid appointed Ibrahim ibn al-Aghlab as governor of the entire Maghreb (in theory, the lands west of Egypt).$^{:23}$ He founded the Aghlabid dynasty, who ruled Ifriqiya nominally on behalf of the Abbasid Caliphs in Baghdad but were de facto autonomous. In practice, their political power was mainly concentrated in the region of Ifriqiya.$^{:23}$ Under their rule, Kairouan grew into the major cultural and spiritual center of Sunni Muslims in the Maghreb. Although this city was in principle the political and economic capital, the Aghlabid rulers themselves usually resided in other nearby sites purpose-built for housing the government.$^{:88–89}$ Sources claim that after coming to power in 800, Ibrahim ibn al-Aghlab's first action was to found a new royal residence, al-Abbasiyya (named in honour of the Abbasids), just southeast of Kairouan.$^{:95}$ It was built between 801 and 810, and included its own congregational mosque and palaces.
Under the rule of Ziyadat Allah I (r. 817–838), one of the most competent rulers of the dynasty, the Aghlabids embarked on a campaign of conquests in the central Mediterranean, including the conquest of Sicily (starting in 827), the conquest of Malta (870), and expeditions to the Italian mainland (mostly in the 830s and 840s).$^{:208}$ In 876 Ibrahim II ibn Ahmad moved the royal residence from al-Abbasiya to a new palace-city he founded, named Raqqada, again near Kairouan. The city contained a mosque, baths, market, and several palaces. He resided in a palace called Qaṣr al-Fatḥ (Arabic: قصر الفتح, lit. 'Palace of Victory'), which remained the residence of his successors (except for some periods where they moved to Tunis).
Kairouan, as the center of Aghlabid power, received significant attention and patronage. The Aghlabid rulers concerned themselves with furnishing cities with water – seen as a pious duty – and with building or rebuilding mosques as physical expressions of the dynasty's presence and legitimacy.$^{:96–98}$ The founding of new royal cities or residences, such as al-Abbasiya and Raqqada, also had symbolic value as part of the dynasty's portrayal of its own power, while probably also serving to distance it from social and political tensions within Kairouan.$^{:95}$ Former Christians, converted to Islam, also played a central role in the field of architecture in Ifriqiya during this era. Some of them were freed slaves, known as mawali, who continued to serve their former masters, often serving as supervisors in the construction projects sponsored by their masters.
Aghlabid rule began to weaken by the end of the 9th century and in 909 they were finally overthrown by a Kutama army led by Abu Abdallah al-Shi'i, establishing the new Fatimid Caliphate with Ifriqiya as its heartland.

## General characteristics

The century of Aghlabid rule saw a degree of political stability and continuity that allowed architectural patronage to flourish. The relatively large number of surviving monuments from this period in one region is unusual for this era of Islamic architecture, allowing for a more detailed study of their architectural development.
Aghlabid architecture remained heavily influenced by the traditions of Antiquity, evidenced by the continuing extensive use of stone and some associated decorative techniques. The ruins of Roman Africa were also frequently reused as a source of building materials, particularly for marble and cut stone. The Aghlabids' connection to the Abbasids in Baghdad also meant that they imported or adopted the latest techniques from the metropolitan Abbasid style in Iraq, as seen in the luster-painted tiles of the mihrab in the Great Mosque of Kairouan, the carved stucco decoration in Raqqada, and the stone-carving of the Mosque of Ibn Khayrun.
The use of the horseshoe arch in Ifriqya is evident in this period, though the form is not as pronounced as it was in other periods and regions of Moorish architecture. Some of the smaller arches, especially for mihrabs and in decorative compositions, have one continuous curve (i.e. one that could be drawn with a single pass of a compass), but most of the time the arches were slightly pointed or deformed near their upper summits.$^{:45}$
During the Aghlabid period, the beginnings of geometrically-arranged arabesques can begin to be discerned, but this decorative technique was to be significantly enriched in later periods.$^{:46}$ The geometric motifs typical of later Islamic art did not yet occupy a prominent role.$^{:55}$ Arabic inscriptions carved in Kufic script were sparsely but widely used in decoration as well. Various vegetal compositions of leaves and stems are attested in this period, with the designs differing depending on whether they were filling elongated friezes or larger panels.$^{:46}$ One decorative motif specific to the Aghlabid period is the use of floral rosettes set inside squares, circles, or lozenges. These motifs were carved in stone and found in the mosques of Kairouan and Sousse. The square tiles on the mihrab of the Great Mosque of Kairouan are also arranged in a pattern that recalls this motif.$^{:54}$
While many columns and capitals were reused from ancient buildings, some of the capitals of columns and colonettes found in Aghlabid mosques appear to be contemporary creations of the Aghlabid period. They have a simple and broadly-carved decoration of leaves on each side of the capital, ultimately inspired by ancient Corinthian models. They also resemble examples from Egypt, which Georges Marçais suggested may indicate a general style used in Islamic North Africa during this era.$^{:46}$

## Fortifications
### Forts and ribats

The threat of Byzantine attacks by sea encouraged the construction of forts and fortifications along the coast of Ifriqiya. Ribats were one type of structure which proliferated under Aghlabid rule.$^{:29}$ They served as residential fortresses and religious retreats, simultaneously a defensive structure and a kind of Muslim monastery where pious warriors gathered for jihad. They were typically square or rectangular fortified enclosures with interior courtyards surrounded by chambers and communal rooms.$^{:25}$ They were built at regular intervals along the coast. Medieval geographers claimed that the ribats were built at precise distances from each other to allow signals to be passed from one to the other using mirrors and fires, thus allowing messages to travel rapidly along the North African coastline.$^{:25}$ The remains of many ribats and other small fortifications are still found along the Tunisian coastal areas. Many of them were built over former Roman or Byzantine fortifications$^{:139}$ or were former Byzantine forts restored by the Muslim garrisons.$^{:29}$ The influence of Byzantine architecture continued to be evident in the fortifications built by the Aghlabids.$^{:29–36}$
Of the many ribats built during this era, the Ribat of Sousse and the Ribat of Monastir are the most impressive surviving examples. They are dated to the late 8th century (slightly prior to the Aghlabid period), making them the oldest surviving Islamic-era monuments in Tunisia – although they were both subjected to later modifications.$^{:25}$ The Ribat of Monastir was founded in 796 by the Abbasid governor Harthama ibn A'yan, but it has gone through multiple modifications, restorations, and expansions, making the chronology of its construction difficult to outline. It gained prestige over time as a teaching place, as a religious retreat, and as a burial place.$^{:26}$
The Ribat of Sousse, founded during the tenure of the Abbasid governor Yazid ibn Hatim al-Muhallabi (d. 787), is built of stone and consists of a square walled enclosure measuring around 38 meters long and 11 meters high.$^{:25}$ Round towers reinforce its corners and the middle of its four sides, except for the southeastern corner, where a square tower serves as the base for a tall cylindrical tower on top of it. In the middle of the south side a projecting rectangular salient serves as the entrance gate. The gate is framed by reused ancient columns. Inside the gate are narrow openings for a former portcullis and for defenders to drop projectiles or boiling oil on attackers. Guardrooms were connected to the vestibule.$^{:25}$ The gate leads to the courtyard, which is flanked by arcades on each side, behind which are lines of small rooms and an upper floor. On the south side of this upper floor is a vaulted room with a mihrab (niche symbolizing the direction of prayer) which is the oldest preserved mosque or prayer hall in North Africa. Another small room in the fortress, located above the gate, contains another mihrab and is covered by a dome supported on squinches. This is the oldest example of a dome with squinches in Islamic North Africa.$^{:25}$ The cylindrical tower above the southeast corner was most likely intended as a lighthouse. It can be ascended via a spiral staircase inside. It has a marble plaque over its entrance inscribed with the name of Ziyadat Allah I and the date 821, which is the oldest Islamic-era monumental inscription to survive in Tunisia.$^{:25–26}$ This date has been interpreted by some scholars as the foundation date of the whole ribat rather than the construction date of the tower only,$^{:26}$ or as the date of a reconstruction.$^{:139}$

### City walls

The city walls of Sfax are recorded to have been built in 859 by the local qadi, ‘Ali Ibn Aslam al-Bakri, under the reign of Abu Ibrahim Ahmad (r. 856–863).$^{:36}$ The walls have been significantly restored and modified over time.$^{:36}$ They have a roughly quadrilateral or rectangular outline and are fortified today with some 69 towers of varying shapes – generally rectangular but some polygonal.$^{:36}$ The city's Kasbah (citadel) and three other more heavily fortified towers or bastions occupy the four corners of this rectangle. The Aghlabid fortifications consisted of curtain walls built of rubble stone and cut stone, with a wall walk running along the top. Their outer façade is usually inclined and sometimes widened at the base. Some towers are embellished on the outside by a cornice with dentils.$^{:36}$
The old city of Sousse has also preserved some of its defensive walls, which a surviving inscription dates to 859.$^{:27}$ The walls are built of stone, which is common for buildings in this city, but city walls elsewhere in the Maghreb were usually built in rammed earth or brick.$^{:27–28}$ The walls are topped by rounded crenellations following the Byzantine tradition. At the southwestern corner of the walls is the Kasbah, which was first built in 850 under the reign of Abu al-Abbas Muhammad (r. 841–856) but rebuilt many times since then. At the Kasbah's southwest corner is a much taller tower known as the tower of Khalaf al-Fata, named after a freed slave and state official who served Ziyadat Allah I and who supervised the construction.$^{:27}$ It was constructed around the time of the Kasbah's foundation. This tower also probably served as a lighthouse or signal tower. It is 13 meters tall, but as it is built on an elevated site its summit stands 77 meters above sea level, making it visible from afar and giving it commanding views over the area.$^{:27}$ The tower consists of two cuboid sections stacked on top of each other, whose interiors are occupied by four rooms. The room on the second floor has a small mihrab, indicating that it served as a prayer room for the soldiers garrisoning it.$^{:27}$

## Mosques
### Great Mosque of Kairouan

One of the most important Aghlabid monuments is the Great Mosque of Kairouan, which was completely rebuilt in 836 by the emir Ziyadat Allah I, although various additions and repairs were effected later which complicate the chronology of its construction.$^{:28–32}$ Aside from Ziyadat Allah I's construction, it seems another campaign of repairs and renovations took place under Abu Ibrahim Ahmad.$^{:28,32}$ The mosque's design was a major reference point in the architectural history of mosques in the Maghreb.$^{:273}$ The mosque features an enormous rectangular courtyard, a large hypostyle prayer hall, and a thick three-story minaret. The prayer hall is divided into 17 aisles or naves by rows of arches, with a transverse aisle on the south side running along the qibla wall, perpendicular to the others. The columns are fashioned from different kinds of marble, granite, and porphyry, while their capitals have varying designs, indicating that they were spoliated from many different older structures.$^{:29}$ The prayer hall's layout also reflects an early use of the so-called "T-plan", as the central nave (the one leading to the mihrab) and the transverse aisle along the qibla wall are wider than the other aisles and they both intersect in front of the mihrab. The entrance to the central nave from the courtyard is fronted by a high dome called the Qubbat al-Bahw (or Qubbat al-Bahu; meaning "Dome of the Vestibule" or "Dome of the Covered Gallery").$^{:29}$
The mihrab is among the oldest examples of its kind, richly decorated with marble panels carved in high-relief vegetal motifs and with ceramic tiles with overglaze and luster.$^{:30}$ Next to the mihrab is the oldest surviving minbar (pulpit) in the world, made of richly-carved teakwood panels. Both the carved panels of the minbar and the ceramic tiles of the mihrab are believed to be imports from Abbasid Iraq.$^{:30–32}$ An elegant dome in front of the mihrab with an elaborately-decorated drum is one of architectural highlights of this period. Its light construction contrasts with the bulky structure of the surrounding mosque and the dome's drum is elaborately decorated with a frieze of blind arches, squinches carved in the shape of shells, and various motifs carved in low-relief.$^{:30–32}$ The dome, along with the galleries around the courtyard, the minbar, and the tiles of the mihrab are dated to Abu Ibrahim Ahmad's intervention in the mosque.$^{:32}$
It was under Abbasid rule in that the first known tower minarets appeared. According to art historian Jonathan Bloom, the early Abbasid minarets were not built to host the call to prayer but were instead intended as prominent landmarks symbolizing the presence of Islam, suitable for major congregational mosques. Their function as a platform for the muezzin and the call to prayer only developed later.$^{:64,107–108}$ As the first minaret towers were an innovation introduced by the Abbasids, they were symbolically associated with Abbasid power. The minaret of the Great Mosque of Kairouan, which came from the Aghlabid reconstruction, is the oldest surviving one in North Africa and the western Islamic world, and one of the oldest in the world. It consists of a massive square-based tower, 10.5 meters wide at the base and tapering towards the top of its 18.5 meters-tall shaft. This main section is surmounted by a second square tier, which in turn is topped by a third domed section (the latter being reconstructed at a later period).$^{:32}$ The tower's form was likely modeled on older Roman lighthouses in North Africa, quite possibly the lighthouse at Salakta (Sullecthum) in particular.$^{:32}$$^{:138}$
* Great Mosque of Kairouan
* Courtyard of the mosque, looking north to the minaret
* Courtyard façade of the prayer hall, with the Qubbat al-Bahw dome in the middle
* Prayer hall, central nave leading to the mihrab
* Prayer hall, transversal view of the rows of arches and columns
* View of the mihrab area
* Detail of the mihrab, showing the square luster tiles around the upper section
* Detail of the carved marble panels inside the mihrab
* The dome in front of the mihrab
* The minaret

### Other congregational mosques

The congregational mosque of the Aghlabid administrative capital, al-Abbasiya, is described by al-Baladhuri (d. 892) as measuring 200 by 200 cubits and constructed of brick and marble columns, with a cedarwood roof. The description resembles that of the congregational mosque in Baghdad at the time, which may mean that either the Aghlabid mosque was inspired by it or that the description itself is merely a formulaic one.$^{:23–25}$ The Great Mosque of al-Zaytuna in Tunis, which was founded earlier around 698, owes its overall current form to a reconstruction during the reign of the Aghlabid emir Abu Ibrahim Ahmad (r. 856–863). Its layout is very similar to the Great Mosque of Kairouan, with a courtyard and hypostyle prayer hall, but it lacked a minaret. Most of the mosque's details and decoration were modified in later periods, and its present minaret is likewise a later addition.$^{:38–41}$ The sections that are best preserved from the 9th century are the interior of the prayer hall (though some of this was later rebuilt too) and the projecting round corner bastions at the northern and eastern corners of the mosque.$^{:38–40}$ Two other congregational mosques in Tunisia, the Great Mosque of Sfax (circa 849) and the Great Mosque of Sousse (851), were also built by the Aghlabids but have quite different forms.$^{:36–37}$
The Great Mosque of Sousse was commissioned in 851 by Abu'l-Abbas Muhammad I and its construction was supervised by Mudam al-Khadim, a freed slave and mawla of Abu'l-Abbas.$^{:23}$ It has a rectangular floor plan measuring about 57 metres wide and 50 metres long$^{:36}$ (or 59 by 51 metres according to another source), divided between a courtyard and a prayer hall. The prayer hall has 13 naves separated by rows of arches. The hall was originally three bays (three arches) deep, but it was subsequently extended later the same century by demolishing the qibla wall and extending it for the length of another three bays.$^{:36}$ Its current mihrab dates from the later Zirid period. While the floor plan is not very different from that of the Great Mosque of Kairouan, the structure of the building is very different.$^{:24}$ Rather than being covered by flat wooden ceilings, the prayer hall is covered with rubble stone vaults. The hall's original bays are covered with barrel vaults while the bays of the later extension are covered by groin vaults.$^{:36}$$^{:72}$ The dome in front of the original mihrab is still present, now in the middle of the prayer hall, and resembles the domes of the Great Mosque of Kairouan: it has an octagonal drum, scalloped squinches, a Kufic inscription, and carved floral decoration. The two tympanums of the arches on either side, below the dome, are covered in a carved checkerboard-like motif of lozenges filled with floral and rosette motifs.$^{:54}$$^{:37}$ In the mosque courtyard, a long Kufic inscription runs in a cornice along the top edge of the walls around the courtyard, containing most Qur'anic excerpts. On the south side of the courtyard the inscription is now hidden behind an extra arcaded portico that was added in the 11th century (and restored in 1675) in front of the prayer hall's original arcaded façade.$^{:36–37}$ At the mosque's northeast corner is a cylindrical bastion topped by a domed octagonal pavilion, which was likely a sawma'a, a space at roof level where the muezzin could issue the call to prayer.$^{:37}$
The Great Mosque of Sfax is not precisely date but assumed to be built around the same time, circa 849, but it was extensively modified after the Aghlabid period.$^{:37}$ The sponsor of its construction was reputedly the qadi 'Ali ibn Aslam al-Jabanyani.$^{:37}$ The mosque has a small rectangular courtyard and a large hypostyle prayer hall, but it seems that in the 10th century, perhaps in 988, the mosque was reduced in size by suppressing its western half, giving it a narrower floor plan.$^{:72}$$^{:135}$$^{:37}$ The original mihrab was replaced with a new one of Zirid style at the middle of the shortened qibla wall. The minaret, which might have originally been located at the middle of the courtyard's north side (like at the Great Mosque of Kairouan), would have thus found itself at the corner of a reduced courtyard.$^{:73}$$^{:37}$ The original Aghlabid minaret, probably a fairly slender two-story tower, is now hidden inside a larger Zirid minaret built around it in the early 11th century.$^{:37}$ The mosque was then enlarged again in the 18th century by re-extending the prayer hall to the west, giving it its present layout. The original Aghlabid form of the mosque may have thus been very similar to the Great Mosque of Kairouan. Like at the latter, the prayer hall was covered by a flat wooden ceiling supported by arches resting on reused ancient columns.$^{:25}$ The eastern exterior façade of the mosque is embellished with a series of decorative horseshoe arch-shaped niches. These may be from the original mosque but their unusual appearance may date them to a later period,$^{:38}$ most likely the Zirid period.$^{:108}$

### Small mosques

While the Aghlabid rulers sponsored the construction of large congregational mosques to publicly express their piety and enhance their reputation, local patrons with less wealth at their disposal still commissioned the construction of small neighbourhood mosques.$^{:33}$ The small Mosque of Ibn Khayrun in Kairouan, also known as the "Mosque of the Three Doors", is one such example. The inscription on its façade attributes its foundation to a little known patron, Muhammad Ibn Khayrun, in 866. According to scholar Mourad Rammah, the mosque's façade is the oldest decorated external façade in Islamic architecture. Made of limestone, it is carved with Kufic inscriptions as well as with vegetal motifs such as tendrils and rosettes.$^{:33–34}$$^{:136}$
Another small local mosque from this period is the Mosque of Bu Fatata in Sousse, dated to the reign of Abu Iqal al-Aghlab ibn Ibrahim (r. 838–841). Also built in limestone, it has a hypostyle prayer hall fronted by an external portico of three arches. A large Kufic inscription is carved across the top of the front façade.$^{:33–34}$ Both the Ibn Khayrun and Bu Fatata mosques are early examples of the "nine-bay" mosque, meaning that the interior has a square plan subdivided into nine smaller square spaces, usually vaulted, arranged in three rows of three. This type of layout is subsequently found in many parts of the Islamic world, in al-Andalus and as far as Central Asia, suggesting that the design may have been disseminated widely by Muslim pilgrims returning from Mecca.$^{:33–34}$ Both mosques were given minarets during the Hafsid period.$^{:33}$

## Palaces
### Al-Abbasiyya

Little remains or is known about the Aghlabid royal residence at al-Abbasiyya.$^{:3}$ Ibrahim I ibn al-Aghlab's palace was known as ar-Rusafa, a toponym which may have been associated with a particular kind of garden estate. This same name was given to country estates in earlier in Umayyad Syria and in later in Umayyad al-Andalus.$^{:3}$ Al-Abbasiya also had a congregational mosque, a market, and another palace named Qaṣr al-Abyad ("White Palace"), making it essentially its own city.$^{:3}$

### Raqqada

Of the later royal city and residence of Raqqada, some remains have been partially excavated.$^{:25}$ It was located 4 kilometers south of Kairouan and remains have been found across a site of approximately 9 square kilometers, suggesting that the city grew fairly large.$^{:3}$ Fragments of carved stucco decoration similar to that of Abbasid Samarra have been found at the site.
Only one palace building has been investigated by archeologists. It was built of mudbrick and went through multiple phases of construction and expansion. It was first constructed as a roughly square walled enclosure, measuring 55 by 55 meters, whose exterior was reinforced with round towers or buttresses. Buttressed walls like this were a feature of Roman castrum architecture and were also found in early Islamic architecture. The building had a central rectangular courtyard surrounded by rooms, including a large reception room in the middle of the north side. Judging by its layout, this building may correspond to what historical sources refer to as the Qaṣr aṣ-Ṣaḥn ("Courtyard Palace"). The building was entered from the south via a bent entrance (a passage turning 90 degrees twice), a feature which became common in the Abbasid period as both a defensive measure and as a means to preserve the privacy of the inhabitants inside. The entrance led directly into the courtyard. A cistern existed under the center of the courtyard where rainwater was collected and stored for future use. The reception room to the north, roughly square in shape, was divided into three north-to-south naves by two rows of four columns. A small apse or semi-circular niche at the back of the hall probably marked the location of the emir's seat or throne. This type of basilical columned hall became a recurring feature of palatial architecture in the western Islamic world. In a later building phase, this palace enclosure was expanded to the north and west until it measured 105 by 105 meters. The additional space was filled with living quarters. The interior underwent further reorganization later during the Fatimid and Zirid occupations of the site.$^{:48–49}$
This courtyard palace was surrounded by a residential district and many other structures. To its northeast was a large irregular quadrilateral water basin measuring between 90 and 130 meters wide. It likely functioned as a reservoir for the royal city's water supply, but it may have also been integrated into the architectural landscape of the palaces.$^{:9}$ Of the other palaces mentioned in historical sources, one was the Qaṣr aṣ-Baḥr ("Water Palace" or "Palace of the Sea"), which would indicate a palace associated with a large water basin.$^{:9–11}$ This palace has not yet been found at Raqqada, but there is evidence of structures existing next to the aforementioned quadrilateral water basin, which could be identified as a part of this palace.$^{:137}$$^{:10}$ Large bodies of water would have played an aesthetic role by reflecting the images of adjoining buildings and giving them a lighter appearance.$^{:11}$ The water basin at Raqqada may have also been used for boat parties and water jousting events.$^{:137}$ The Qaṣr aṣ-Baḥr at Raqqada is the earliest example of such a "water palace" in the Mediterranean region, with later examples found at the Fatimid capital al-Mansuriyya and the Hammadid capital Qal'at Bani Hammad. It may have been inspired by the palaces of Abbasid Samarra, where a large pool existed in front of the Bab al-'Amma gate, and it probably had its origins in older Sassanian palace architecture, such as Qaṣr e-Shirin in Iran.$^{:9–11,129}$ A third named palace, the Qaṣr al-Fatḥ ("Palace of Victory"), was the residence of emir Ibrahim II, but its location is unknown.$^{:9}$

## Civic works

The Aghlabids also extensively built up infrastructure and other buildings with civic purposes. Historical texts indicate that numerous built hammams (public baths), caravanserais, and maristans (hospitals or asylums), though these have not survived. They built many bridges over rivers, two of which survive near Kairouan and Hergla.

### Water infrastructure

Hydraulic engineering already had a long tradition in the region and many aqueducts and other waterworks from the Roman and Byzantine period survived or were restored in the early Islamic period.$^{:137}$ The Sofra, a cistern in the center of old Sousse, may have been a pre-Islamic cistern which was restored or rebuilt by Ibrahim II (r. 875–902). It consists of a large barrel-vaulted chamber divided by rows of arches supported by square pillars, with rectangular openings in the roof that allowed water to be added from the outside. A small round settling tank also stands on its south side.$^{:137–138}$
The Aghlabids also constructed extensive new waterworks to provide water to Kairouan and their nearby palatial complexes, which are located in a dry and arid region. Water was collected in a series of large reservoirs, two of which survive today outside the walls of Kairouan, known as the Aghlabid Basins. During the Aghlabid period, water was brought to the city and the reservoirs from the surrounding lowlands by drawing it from Oued Merguellil and its tributaries. The waters were diverted by a system of small dams, weirs, and canals to the reservoirs. An aqueduct was also built to bring water from springs in the Shreshira (or Chrechira) Mountains, 36 kilometres west of Kairouan. The aqueduct was probably built during the Aghlabid period, but made use of some existing Roman-era infrastructure and was subsequently renovated during the Fatimid period. The two surviving Aghlabid reservoirs of Kairouan, built between 860 and 862, are each composed of two large circular basins that acted as settling tanks, which in turn led filled a covered cistern. In the middle of the largest water basin is a polylobed masonry pillar today which may have been part of the foundations of a leisure pavilion that stood above the water. Nearby Raqqada was also supplied by large above-ground square reservoirs whose walls were reinforced with round towers.

### Maristans (hospitals)

The first known maristan built in present-day Tunisia was built by Ziyadat Allah I between 825 and 835 in the Dimma neighbourhood of Kairouan. This maristan became the model for other maristans built later in Tunis, Sfax, and Sousse. The first maristan of Tunis was founded circa 903, located outside the city walls. The usual layout for these buildings had a central courtyard surrounded by an arcaded gallery leading to many rooms. The entrance was through a covered passage (a skifa) on the central axis of the courtyard. Along this passage were benches for visitors coming to see patients, as well as rooms for the guards. Across the courtyard from the entrance was usually a prayer room. From the courtyard one could also access an isolated section reserved for patients with leprosy. Maristans were often equipped with their own cistern and well to provide water.