Al-Qarawiyyin Mosque: A Historic Mosque and Center of Learning in Fez
Site at a Glance
- Rating
- 4.6
- Popularity
- High
- Country
- Morocco
- Primary era
- Medieval
- Eras represented
- Medieval, Early Modern, Modern
- Civilizations
- Alaouite, Almohad, Almoravid, French, Marinid, Saadi
- Site type
- Religious
- Remains
- Mosque
On this page23 sections
History
Al-Qarawiyyin Mosque is a historic mosque and center of Islamic learning in the medina, the historic urban core, of Fez, Morocco. Its foundation is traditionally dated to 857 or 859, during the Idrisid period, when Fez was ruled by Morocco’s early Idrisid dynasty. The mosque became the city’s principal Friday mosque and developed over time into a prominent institution of religious learning.
Foundation and early standing
Moroccan tradition credits Fatima al-Fihri with establishing the mosque using her inheritance. Her family had moved from Kairouan to Fez early in the ninth century, and she is said to have bought the site, then open land with trees and gypsum workings, from a member of the Hawwara tribe. Tradition also holds that she fasted during construction and prayed in the building when it was complete. A related account credits her sister Mariam with founding the Mosque of the Andalusians.
The traditional foundation story has been questioned. A cedar panel found beneath plaster during twentieth-century renovations bears an inscription naming Dawud ibn Idris as the founder of “this mosque” in 877. Dawud, a son of Idris II, governed the region at the time. The inscription is more likely to belong to Al-Qarawiyyin’s original foundation than to another mosque, although it may have been moved from elsewhere.
Expansion and the Almoravid period
As Fez grew, the mosque gained religious and political standing. In the tenth century, the Fatimid caliphate and the Umayyad caliphate of Córdoba, rival powers in the region, contested influence over the city. The Friday sermon was moved to Al-Qarawiyyin from the mosque associated with Idris II, either in 919 or 933, perhaps at Fatimid prompting. This change established Al-Qarawiyyin as Fez’s principal Friday mosque. A local tradition held that other mosques in the city timed their calls to prayer by its own.
In 956, the Zenata emir Ahmed ibn Abi Said sought authorization and financial support from the Umayyad caliph Abd al-Rahman III to enlarge the mosque, and the caliph agreed. Zenata princes, with support from the Umayyads of al-Andalus, are also credited with extending the complex by 3,000 square metres. In 998, the Amirid ruler al-Muzaffar added a minbar, or pulpit for sermons, and a dome topped with animal-shaped talismans.
Between 1134 and 1143, the Almoravid ruler Ali ibn Yusuf sponsored a major enlargement that gave the mosque much of its present form. The work lengthened the prayer hall and required the purchase and demolition of neighboring buildings, including structures apparently within the nearby Jewish quarter. The additions increased the building’s elaboration while retaining its general plan. Clear evidence of teaching at the mosque dates to 1121, though when instruction began and became formalized remains uncertain. Learning circles were held there, and the institution’s scholarly standing reached a high point in the thirteenth and fourteenth centuries.
Almohad and Marinid changes
Almohad forces captured Fez after a siege in 1145–1146. One tradition says that residents covered the mosque’s ornate Almoravid decoration with whitewash to protect it from the new rulers; the covering may instead have been ordered by the Almohads. The decoration came to light during renovations in the early twentieth century. Under Almohad rule, the mosque’s facilities for ritual washing were improved, a separate washing room and an underground store were added, and a new bronze chandelier replaced an earlier one. Later dynasties continued to alter and maintain the complex.
Marinid rulers developed the mosque’s scholarly institutions and established its library. They also built religious schools, or madrasas, around it: Saffarin in 1271, al-Attarine in 1323, and Mesbahiya in 1346. These institutions complemented teaching at the mosque, including by housing students who came to study there. Cherratine Madrasa was built nearby in 1670. Sultan Abu Yusuf Yaqub gathered manuscripts from collections in al-Andalus, the parts of the Iberian Peninsula once under Muslim rule. Some were first held at Saffarin before transfer to Al-Qarawiyyin. In 1613, a library conservator estimated that its collection contained 32,000 volumes.
Reform and modern institutional change
In the late eighteenth century, Sultan Muhammad ibn Abdallah regulated the institution’s program and narrowed its curriculum, excluding logic, philosophy, and some Sufi writings. Sultan Abd al-Rahman introduced further reforms in 1845, while the scope of teaching continued to contract during the nineteenth century. The library’s holdings also dwindled through neglect and loss. By the early twentieth century, the collection had fallen to about 1,600 manuscripts and 400 printed books, though it still contained valuable historical works.
During the French protectorate, which began in 1912, French authorities introduced administrative and structural reforms at Al-Qarawiyyin between 1914 and 1947, while teaching remained largely traditional. The mosque also became a focus of Moroccan nationalist activity. In 1930 it helped circulate the communal prayer Ya Latif in opposition to the French-decreed Berber Dahir, a protectorate decree concerning customary law in Berber regions. In 1937 it served as a rallying point for demonstrations following a violent crackdown in Meknes.
Al-Qarawiyyin entered the state education system in 1947, and women were admitted during the 1940s. After Moroccan independence, a royal decree reorganized it as a state university under the education ministry in 1963. Teaching stopped in the old mosque as a new campus opened in a former French army barracks. The institution received the official name University of Al Quaraouiyine in 1965, and traditional Islamic teaching resumed in 1988. The description of Al-Qarawiyyin as one of the world’s oldest universities or continuously operating higher-learning institutions is disputed: many scholars distinguish the earlier mosque-based madrasa from the modern university created through the 1963 reorganization. The mosque is part of the Medina of Fez UNESCO World Heritage property, inscribed in 1981.
Remains
The mosque complex covers about half a hectare, with a footprint described as approximately 85 by 70 metres and a stated prayer capacity of roughly 20,000 to 22,000 people. Its principal elements are a large columned prayer hall, a rectangular courtyard, a minaret at the courtyard’s western end, and surrounding annexes. About 18 gates and entrances are distributed around the perimeter.
Plan and construction
Early mosque
Traces of the ninth-century mosque remain within the present plan. The original building occupied the area immediately south of the courtyard and measured about 36 by 32 metres. It had four crosswise aisles running roughly east to west, parallel to the southern wall marking the direction of prayer. It probably included a small courtyard, and a small first minaret reportedly stood near the present wooden prayer screen at the courtyard entrance. A well within the precinct initially supplied water.
Materials and rooflines
Brick masonry finished with white plaster forms the main structure. Pitched roofs channel rainwater through aqueduct-like gutters, and green glazed tiles cover the roofs. Horseshoe-shaped arches are widespread, while the central nave also uses other arch forms. The complex’s many connected spaces preserve the general arrangement shaped by successive building campaigns.
Courtyard and prayer hall
Courtyard and fountains
The rectangular courtyard is enclosed by the prayer hall on three sides and by a gallery to the north. Blue-and-white glazed tiles pave its floor, and a central, three-part fountain serves for ablutions, the ritual washing performed before prayer. Marble washing facilities occupy two side wings. Pavilions shelter fountains at the courtyard’s eastern and western ends. The eastern pavilion dates to 1587–1588 and the western to 1609; both have pyramidal roofs and draw on the design of the Alhambra’s Court of the Lions. Carved cedar, stucco, mosaic tiles, and marble columns form their decoration.
Prayer hall and mihrab
Rows of arches divide the prayer hall into longitudinal and crosswise aisles, with a plan counted as 21 aisles in one direction and 10 in the other. The southern wall marks the qibla, the direction of prayer. The central nave runs from the courtyard toward the mihrab, the niche indicating that direction. The hall’s western half has shorter arches than its eastern half, and some aisles differ in width.
The mihrab dates to the Almoravid enlargement. Its niche is covered by a small dome with muqarnas, tiered, honeycomb-like ornament, and framed by carved and painted stucco, coloured-glass windows, and reused marble columns with capitals from al-Andalus. Floral decoration and angular Kufic inscriptions, an early style of Arabic script, adorn the upper walls. The stucco ornament below the arch was probably renewed in the eighteenth or early nineteenth century.
Central nave and decoration
Elaborate vaults and cupolas mark the central nave. Their decoration includes muqarnas and raised arabesque patterns, alongside Kufic and cursive inscriptions highlighted in some places with blue and red. Two ribbed cupolas belong to different periods, one Almoravid and the other Alawi. The dome above the courtyard entrance to the prayer hall is associated with the 998 embellishment; a similar dome above the northern entrance may date to the same period.
Prayer furnishings
A wooden anaza, a screen marking a prayer niche, was installed at the courtyard entrance in 1289. It serves as an outdoor counterpart to the mihrab for prayer in the courtyard. An inscription dates the later stucco decoration of the entrance arch to 1864–1865. The mosque’s current minbar, installed in 1144, is made of carved and inlaid wood with geometric patterns and arabesques. Its design is comparable to that of the Koutoubia Mosque’s pulpit and influenced later Moroccan examples.
A large chandelier commissioned by the mosque preacher Abu Muhammad Abd Allah ibn Musa between 1202 and 1219 hangs in the central nave. It is formed as a twelve-sided cupola beneath a cone, with nine tiers capable of holding 520 oil candles. Floral arabesques and Kufic inscriptions decorate its carved, pierced surfaces. Other bronze chandeliers belong to the Almohad and Marinid periods; at least three were made from church bells brought back after victories in Spain. One installed in 1337 was a bell taken from Gibraltar after its recapture in 1333.
Minaret and timekeeping
Minaret
Built in 956 under the patronage of Abd al-Rahman III, the square minaret is made of local limestone and stands about 27 metres high, with some descriptions giving approximately 30 metres. Twin windows pierce its upper shaft. Above them, a slightly projecting platform is enclosed by crenellated walls and topped with a dome. The Marinids whitewashed the stone in 1286 to protect it as it deteriorated. The minaret is among Morocco’s earliest surviving examples and is described as the oldest square minaret in the Maghreb.
Timekeeper’s chamber
The Dar al-Muwaqqit, or timekeeper’s chamber, stands on the minaret’s southern side above the courtyard gallery. Its equipment included astrolabes and other instruments for calculating prayer times. A water clock made in 1317 or 1318 under the Marinid sultan Abu Sa’id was restored between 1346 and 1349. Another clock, completed in 1361, is partly preserved: its 71-centimetre astrolabe remains set into a wooden structure. The nearby tower called Borj Neffara is associated with a separate timekeeper’s chamber rather than serving as the mosque’s minaret.
Entrances and annexes
Courtyard entrances
The principal northern entrance, Bab al-Ward, opens onto the courtyard. Its vestibule is covered by a Marinid-period dome, fluted on the outside and ornamented within by painted and carved stucco. The inner archway also received Marinid decoration. The doors retain original elements and were restored between 2005 and 2007. Replica doors made in the 1950s stand at the western Bab Sbitriyyin and southwestern Bab al-Gna’iz; fragments of their earlier doors are held by the Dar Batha Museum. The northwestern Bab al-Shama’in and Bab al-Maqsura retain heavy bronze fittings, including Almoravid-era knockers.
Beside Bab al-Ward, the Almohad-period Bab al-Hafa has a small channel crossing its floor. The channel allowed worshippers to wash their feet while entering.
Funerary oratory and other spaces
The Jama’ al-Gna’iz, or funerary oratory, is an Almoravid-period annex behind the southern prayer wall and west of the mihrab’s axis. Kept apart from the main prayer hall for funeral rites, it has a cupola of muqarnas and ornate arches. Reused capitals from al-Andalus appear in its doorways and supporting columns.
Other annexes include latrines at the northwestern edge and an arched prayer space for women on the northeastern side. The mosque’s first purpose-built library chamber is also set near the women’s section, at the northeastern corner.
Library and manuscripts
Library rooms
The first purpose-built library chamber, established in 1349, is a square room about 5.4 metres on each side. A Marinid wooden screen stands above its entrance, and an inscription records its foundation by Sultan Abu Inan Faris. A room for Quran readings was added above an adjoining street in 1361. The library’s present building also reflects later work. In the late sixteenth century, Sultan Ahmad al-Mansur built a chamber behind the prayer wall. A major expansion beginning in 1940 added a 23-metre reading room with a painted wooden ceiling and an entrance from outside the mosque. The expansion was inaugurated in 1949.
Collection
The library holds volumes of Malik’s Al-Muwatta written on gazelle parchment, a copy of Ibn Ishaq’s Sirat, and a ninth-century Quran manuscript on the same material. Its collection also includes a Quran given by Sultan Ahmad al-Mansur in 1602 and a 1320 copy of Ibn Rushd’s commentary on Maliki law. Among its other manuscripts is the author’s original copy of Ibn Khaldun’s Al-‘Ibar, including the Muqaddimah, which he gave to the library in 1396.
A certificate on deer parchment rediscovered in the library records an authorization issued in 1207 to Abdellah Ben Saleh Al Koutami. It names three doctors as authorities and records the presence of the city’s chief judge and two witnesses. Some scholars regard it as the oldest surviving precursor of a medical doctorate.



