University of al-Qarawiyyin
The University of al-Qarawiyyin in Fez, Morocco, founded as a mosque in 857-859 CE, is recognised by UNESCO as the oldest existing, continually operating institution of higher learning in the world, and a historic centre of Maliki legal scholarship in the western Islamic world.

The University of al-Qarawiyyin (Arabic: جامعة القرويين, Jāmiʿat al-Qarawiyyīn), in the old city of Fez, Morocco, is a mosque and centre of learning founded in 857–859 CE and recognised by UNESCO and the Guinness Book of World Records as the oldest existing, continually operating institution of higher education in the world. Founded as a congregational mosque endowed by Fatima al-Fihri, it grew over the following centuries into the principal seat of religious and legal scholarship in the western Islamic world, and in the twentieth century it was reorganised as a state university within the modern Moroccan educational system, where it continues to operate today.
This article treats al-Qarawiyyin as an institution and a building — its architecture, its historic library, its curriculum and its place in the Maliki legal tradition, and its passage into the modern era. The life of its founder and the circumstances of its endowment are covered in the article on Fatima al-Fihri.
Foundation and Early Growth
Al-Qarawiyyin was established in the Qarawiyyin quarter of Fez, a district settled by families who had migrated from Kairouan (al-Qayrawan, in present-day Tunisia) — the origin of its name. It began as a congregational mosque endowed as a waqf (a perpetual religious endowment) by Fatima al-Fihri around 857–859 CE, during the rule of the Idrisid dynasty and within the wider Abbasid-era Islamic world. As with many great mosques of the early Islamic centuries, teaching circles formed around scholars in its prayer hall from an early date, and over time these informal halaqat developed into a structured centre of instruction.
Fez itself was well placed for such an institution. Positioned at a crossroads between al-Andalus, the wider Maghreb, and the trans-Saharan routes toward West Africa, the city drew scholars and students from across these regions, and al-Qarawiyyin became the meeting point of their intellectual traditions. By the tenth and eleventh centuries it had become the foremost mosque-college of Morocco, a status it retained through the successive dynasties that ruled the city.
The Building
The mosque that stands today is the product of more than a thousand years of expansion and embellishment, in which each ruling dynasty of Fez left its mark. The original ninth-century structure was comparatively modest; the great enlargements came later.
A major expansion in the mid-tenth century, carried out while the Umayyad Caliphate of Córdoba exercised influence over northern Morocco, enlarged the prayer hall and gave the mosque its square-shafted minaret, among the earliest surviving minarets in the region. Under the Almoravids in the twelfth century the prayer hall was extended and enriched with elaborate carved-plaster domes and muqarnas (honeycomb vaulting), work that ranks among the finest surviving Almoravid architecture. The Marinid sultans of the thirteenth and fourteenth centuries added the ablutions facilities, the courtyard fittings, and a ring of residential colleges (madrasas) nearby to house students, integrating the mosque into a wider educational quarter.
Architecturally, al-Qarawiyyin belongs firmly to the western Islamic tradition. Its interior is a hypostyle hall — a broad, low space in which rows of horseshoe arches on piers and columns divide the prayer hall into many aisles, running parallel to the southern wall toward which the worshipper faces. Successive enlargements made it one of the largest mosques in North Africa, with a capacity of some tens of thousands of worshippers at its fullest. The decorative vocabulary is that of Moroccan and Andalusian art: carved cedar ceilings, sculpted plaster (ataurique), and zellij mosaic tilework in geometric patterns.
The Almoravid rebuilding of the twelfth century was decisive for the interior as it now appears. It furnished the central nave leading to the mihrab with a sequence of ornate muqarnas (honeycomb) domes carved in plaster, among the earliest and most accomplished such vaults in the western Islamic world, together with the carved-plaster and epigraphic ornament borrowed from the Andalusian style then in fashion. The Almoravids also endowed the mosque with a monumental minbar (pulpit) of inlaid wood. Screening the approach to the mihrab is the anaza, a carved and decorated wooden partition that functions as a symbolic outdoor mihrab.
The rectangular courtyard (sahn) at the heart of the complex was fitted, under the Saadian dynasty in the sixteenth and seventeenth centuries, with two projecting pavilions that consciously echo the fountain pavilions of the Court of the Lions at the Alhambra, together with a large basin for ablutions. Among its specialised rooms is a dar al-muqit, the timekeeper's chamber, which housed instruments and water clocks used to fix the hours of prayer — a reminder that astronomy and timekeeping were practical concerns of the mosque as well as subjects of study within it. The whole complex is entered through numerous gates from the surrounding lanes of the medina, into which its green-tiled roofs and white minaret rise as one of the defining landmarks of the old city of Fez.
The Library
Al-Qarawiyyin's library (al-Khizana) is among the oldest working libraries in the world, its origins reaching back to the mosque's early centuries and receiving a decisive endowment under the Marinid sultan Abu Inan Faris in the fourteenth century. Sustained by waqf revenue and by donations of scholars' personal collections, it accumulated a manuscript holding of the first importance for the study of Islamic law, theology, language, and science in the Maghreb.
Its collection is reckoned in the thousands of volumes and includes works of great rarity. Among its most celebrated holdings are a ninth-century Qur'an written in Kufic script on gazelle parchment and an early copy of the Muqaddimah, the great work of historical theory by Ibn Khaldun — a manuscript of such value that it was lent to the Louvre in Paris for exhibition during the library's modern restoration. The holdings also include historic legal, grammatical, and scientific texts and original endowment and licensing documents, and they remain a primary resource for researchers of Maghrebi and Andalusian scholarship. Access to the manuscripts has traditionally been restricted to scholars granted formal permission.
Centuries of use took their toll on the building and its contents — damp, structural decay, and the fragility of the older manuscripts all threatened the collection. Between roughly 2012 and 2016 the library was thoroughly restored under the direction of the Canadian-Moroccan architect Aziza Chaouni, whose work repaired the historic fabric and added climate-controlled storage, a conservation laboratory, and a reading room, alongside the digitisation of manuscripts. The restored library, overseen by its curator (in this period Abdelfattah Bougchouf), was reopened in 2016 and drew international attention to al-Khizana as one of the oldest continuously maintained repositories of its kind, and to the fact that this pillar of the institution, like the institution itself, owed its origin to a woman's endowment.
A Centre of Maliki Learning
The intellectual identity of al-Qarawiyyin was shaped above all by the Maliki school of Islamic jurisprudence, which was dominant across North Africa and al-Andalus. The mosque became the principal centre in which Maliki law was taught, its texts commented upon, and its jurists trained, and the ijazah (licence to transmit and teach a text) issued by its scholars carried authority throughout the western Islamic world.
This role gave al-Qarawiyyin an influence that extended far beyond Fez. As the pre-eminent seat of Maliki learning in the Maghreb, it helped standardise the legal and religious education of scholars who then carried that training outward — southward across the Sahara into the West African centres of learning such as Timbuktu, and into the wider region where the Maliki madhhab prevailed.
The teaching of law sat within a broader curriculum that Muslim scholars traditionally divided into two branches: the ʿulum al-naqliyya, the "transmitted sciences" grounded in revelation — Qur'anic recitation and exegesis (tafsir), hadith, jurisprudence (fiqh) and its principles, and the Arabic linguistic sciences of grammar, rhetoric, and lexicography that underpinned them — and the ʿulum al-ʿaqliyya, the "rational sciences" such as logic, arithmetic, geometry, astronomy, and medicine. The transmitted sciences, and Maliki law above all, formed the core; the rational sciences were studied in support of them and according to the strengths of the teachers available in any given generation.
Instruction followed the method common to the mosque-colleges of the Islamic world. A scholar taught seated against a pillar or in the courtyard, his students gathered in a circle (halaqa) around him, working through a set text line by line as he read, explained, and answered questions. Mastery was recognised not by an examination in the modern sense but by the ijazah, the licence a teacher granted a student to transmit and teach a particular text on his authority — a personal chain of transmission (isnad) that linked each new teacher back through his masters to the author of the work and, ultimately, to its origins. The authority of an al-Qarawiyyin ijazah carried weight across the western Islamic world, and the certificates and their chains of transmission were carefully recorded.
Scholars
Fez and its mosque-university drew and produced a long line of scholars over the medieval and early modern centuries. The historian and statesman Ibn Khaldun (1332–1406), a native of Tunis whose career carried him across the Maghreb and al-Andalus, was among those associated with the scholarly milieu of Fez in his day. The traveller and geographer al-Hasan ibn Muhammad al-Wazzan (c. 1494 – c. 1554), later known in Europe as Leo Africanus, received his education in Fez in the generation around 1500 and left one of the fullest descriptions of the city and its mosque in his account of Africa.
The historical sources associate a wider circle of jurists, grammarians, and Qur'anic scholars with al-Qarawiyyin across the centuries, particularly within the Maliki legal tradition for which it was the leading school. The precise details of who taught or studied there in the earliest periods are not always securely documented, and this article does not attribute to the institution figures for whom the connection rests only on later or uncertain tradition.
The Modern University
Al-Qarawiyyin's passage into the modern era mirrored the wider transformation of Islamic education under colonial rule and independence. During the French protectorate over Morocco (1912–1956), traditional Islamic instruction at al-Qarawiyyin continued alongside a new French-language school system, and the mosque became a focus of Moroccan cultural and national identity in a period when that identity was under pressure.
After Morocco regained independence in 1956, the government reorganised al-Qarawiyyin's teaching. In 1963 it was incorporated into the state education system as a university under the supervision of the ministry of education, with formal faculties, degree programmes, and modern administration, while retaining its religious character and its historic mosque. Its faculties, teaching Islamic law and theology, Arabic language, and related disciplines, are today distributed across sites in Fez and other Moroccan cities. Women, whose access to formal instruction at the mosque had historically been limited, are admitted as regular students in the modern university.
Status and Recognition
Al-Qarawiyyin's distinction as the oldest existing, continually operating degree-granting institution rests on its unbroken function as a place of higher learning from the medieval period to the present. This status has been recognised by UNESCO and recorded in the Guinness Book of World Records, and the mosque stands within the Medina of Fez, itself inscribed as a UNESCO World Heritage Site.
The claim has also prompted a scholarly discussion about how a "university" should be defined. Al-Qarawiyyin and comparable institutions such as al-Azhar in Cairo (founded in the tenth century) developed as mosque-colleges within the Islamic tradition of the madrasa, with teaching circles, licensed transmission of texts, and endowed support — a model distinct in its organisation from the corporate, chartered universities that emerged in medieval Europe from the eleventh and twelfth centuries. Historians differ on how far the two traditions are comparable and on what, if anything, each owed to the other. What is not in dispute is al-Qarawiyyin's antiquity and continuity, and the central place it held for more than a millennium in the religious and intellectual life of the western Islamic world.
References and Further Reading
Primary Islamic Sources
- Qur'an, Surah al-Alaq (96:1–5) — "Read in the name of your Lord who created" — the scriptural foundation of the Islamic valuation of learning that underlay institutions such as al-Qarawiyyin.
- Al-Wazzan, al-Hasan ibn Muhammad (Leo Africanus). Descrittione dell'Africa (Description of Africa), on Fez and its great mosque. [Original c. 1526 CE]
- Ibn Abi Zar. Rawd al-Qirtas (al-Anis al-Mutrib), a history of Fez and the Moroccan dynasties. [Original c. 1326 CE]
- Endowment (waqf) records and ijazah documents preserved in the al-Qarawiyyin library.
Classical Islamic Sources
- Ibn Khaldun, Abd al-Rahman. Al-Muqaddimah, on learning, cities, and the transmission of knowledge in the Maghreb. Translated by Franz Rosenthal. Princeton: Princeton University Press, 1967. [Original c. 1377 CE]
- Al-Maqqari, Ahmad ibn Muhammad. Nafh al-Tib, on the scholarly links between al-Andalus and the Maghreb. Cairo: Dar al-Kutub al-Misriyyah, 1949. [Original c. 1629 CE]
- Ibn al-Ahmar. Buyutat Fas al-Kubra (The Great Houses of Fez). [Original c. 14th century CE]
Academic and Scholarly Sources
- Terrasse, Henri. La Mosquée al-Qaraouiyin à Fès. Paris: Klincksieck, 1968.
- Le Tourneau, Roger. Fez in the Age of the Marinides. Norman: University of Oklahoma Press, 1961.
- Makdisi, George. The Rise of Colleges: Institutions of Learning in Islam and the West. Edinburgh: Edinburgh University Press, 1981.
- Bloom, Jonathan M. Architecture of the Islamic West: North Africa and the Iberian Peninsula, 700–1800. New Haven: Yale University Press, 2020.
- Pedersen, Johannes. The Arabic Book. Princeton: Princeton University Press, 1984.
- Lulat, Y.G.-M. A History of African Higher Education from Antiquity to the Present. Westport: Praeger, 2005.
Further Reading
- Gaudio, Attilio. Fès: Joyau de la civilisation islamique. Paris: Les Presses de l'UNESCO, 1982.
- Shillington, Kevin, ed. Encyclopedia of African History, entry on Fez and Moroccan learning. New York: Routledge, 2005.
- Irwin, Robert. Ibn Khaldun: An Intellectual Biography. Princeton: Princeton University Press, 2018.
- Encyclopaedia Britannica, entry "Qarawiyyin."
- Aziza Chaouni Projects. Documentation of the al-Qarawiyyin Library restoration (2012–2016).
- UNESCO World Heritage Centre. Documentation on the Medina of Fez.
Mentioned In
2 articles reference this topic