The az-Zaytuna Mosque, or the Great Mosque, is the second oldest and largest mosque in Tunisia, and is one of the most important in the country due to the robustness of its construction, the richness of its ornamentation, the coherence of its architectural elements and its perfect integration, both in terms of architecture and functions, into the urban fabric of the medina of Tunis (major traffic routes and souks). This mosque was founded around the year 79 AH / 699 AD by the Ghassanid general Hassan ibn Nu'man, who led the conquest of Tunis. It was then rebuilt by Ubayd Allah ibn al-Habhab, the governor appointed by the Umayyad caliph Hisham bin Abd al-Malik in Ifriqiya, in the year 110 AH / 728-729 AD. Hassan carried out expansion work with the help of Coptic experts and masons sent to Tunis by the governor of Egypt to build the arsenal. Accounts vary as to the origins of its name. Some believe that the mosque was built on a site where a zaytouna (Arabic for olive tree) grew and that it took its name. According to another narrative, the mosque was built on the remains of an ancient Christian Basilica, which housed the relics of Saint Olivet, martyred under Hadrian.
This mosque was surrounded by the considerate care of all the dynasties that governed the country; however, it was the Aghlabids who left the most striking mark on it. The works they carried out there was intended to embellish the building, refine its architecture and ornamentation and increase its surface area. However, works were so extensive that they almost overshadowed the original features of the santuary. The credit for this goes to the Aghlabid prince Abi Ibrahim Ahmed (242 - 249 A.H. / 856 -864 A.D.), who was known for his penchant for building and urbanizing the country and erecting monuments of all kinds. This prince ordered the construction of a colonnaded prayer hall in the shape of an irregular square, covering an area of 1344 m2. It consists of six aisles and fifteen naves perpendicular to the qibli wall, each measuring 3 metres in width, with the exception of the middle nave and the transverse nave of the transept, which is 4.8 meters wide. The arches supporting the framework are made of stone.
Construction works continued in the az-Zaytuna Mosque during the Fatimid period (296-362 A.H. / 909-973 A.D.), by their vassals the Sanhajid princes, who renewed the mosque, enlarged its components and improved its ornamentation. Of particular note is the magnificent dome over the bahu and the portico before the prayer hall built by Al-Mansur bin Abi Al-Futuh Yusef bin Ziri (AH 373-86 / AD 983-92). The mosque was also surrounded by the attentive care of the Hafsid sultans. In 648 AH / 1250 AD, Sultan Al-Mustansir Billah connected it to the Zaghouan water supply aqueduct and provided it with large cisterns. He also restored and consolidated its walls. In 716 A.H. / 1316 A.D., Sultan Abu Yahya Zakariya al-Lihyani replaced the beams and decorated the wooden doors of the prayer hall and the outbuildings. Sultan Abu Abdullah Muhammad al-Hafsi was responsible for the construction of the outbuilding in the funeral courtyard and the sabil (fountain) below. The Hafsid sultans installed a library complex in the mosque which consists of three rooms. The first room was built in 822 A.H. / 1419 A.D. in the Mujannaba (outbuilding) known as al-Hilal located in the northwest corner of the courtyard, under the minaret, as reported to by historiographer az-Zarkashi in his book entitled Tarikh ad-Daulatayn' (The History of the Two States). The second room was dedicated to the library bequeathed by Sultan Abi 'Amr Othman (r. 1435-1488). It was built on the site of the south-eastern maqsura (private lodge) known as Maqsurat Sidi Mahrez, in 854 AH / 1450 AD, as the inscription above its door attests it. The door is remarkable for its decorative elements, such as the wood carvings and the archway with two-colored keystones in white and black marble. The façade of this room overlooks the Suq al-Fakkah. The third library is the so-called al-Abdaliya library, named after Sultan Abu Abdullah Muhammad (899-932 AH / 1493-1525 AD).
During the Spanish occupation, the mosque suffered from neglect and attacks, but its fate improved during the Ottoman period. The Muradites added a minaret and later increased its height. A sundial was also erected at the centre of the courtyard to indicate prayer times. The eastern mujannaba (outbuilding) known as Sahn al-Janaiz (Funeral Court) was also added and the roof was re-laid. During this period, the prayer hall was decorated and the mihrab wall was covered with beautifully carved stucco. The roofs of the mosque were also renewed. During the Husaynite period, the mosque underwent further works. The old minaret was replaced by a beautifully decorated Hispano-Moorish minaret, in addition to numerous restorations and repairs to its various parts of the mosque.
The mosque covers an area of 5,000 square meters. It has nine doors and is trapezium shape echoes that of the Uqba ibn Nafi' mosque in Kairouan. Its courtyard is surrounded by porticoes on all four sides. The gallery serving as the narthex rests on columns surmounted by antique capitals, while the other three galleries are supported by white marble columns imported from Italy in the 19th century. A sundial occupies the centre of the courtyard. The 43-metre-high square-shaped minaret stands in the northwest corner of the courtyard and is decorated in the same way as the Almohad minaret of the Kasbah Mosque, with interlacing limestone patterns on an ochre sandstone background.
The ceilings of the mosque are not all of the same type; that of the prayer room, for example, is supported by visible wooden joists. The ceilings are supported by marble columns, most of which were brought from Roman and Byzantine archaeological sites in Tunisia. The mihrâb is topped by a square based dome made of carefully arranged ashlar, which is surmounted by a frieze and enhanced by small ornaments in curvilinear forms. A cylindrical shape emerges from the base adorned with 10 columns with acanthus leaf capitals. It includes ten arched windows, surmounted by a fluted hemispherical form. An inscription on the base of the mihrab dome indicates the name of the builder and the date of construction. The mihrab is decorated with a carved marble panel and various elaborate inscriptions engraved on stucco.
For its dual religious and educational function, the az-Zaytuna mosque enjoys great veneration among the Tunisian population. Not only did it constitute the pillar of religious life, but it was also a high place of knowledge and teaching. Imams and sheikhs regularly gave courses in Fiqh (jurisprudence), Tafsir (interpretation of the Koran) and language. Later, education was formalized with the establishment of the University of az-Zaytuna, which attracted students of religious sciences from all over the world. The educational system in az-Zaytuna underwent several reforms, including one undertaken in 1842 by Ahmad Pasha Bey. Muhammad al-Sadiq Bey, on the advice of his reformist minister Khair al-Din, did the same in 1876. For this purpose, a committee of Zaytuna scholars and statesmen was elected to decide on the content of the teachings and to draft it. Today, the az-Zaytuna Mosque is considered one of the most prestigious shrines and historical monuments in the city of Tunis.