Quick answer: In 857 or 859 CE, a woman named Fatima al-Fihri spent her inheritance building a mosque in Fez, Morocco. Over the following centuries that mosque grew into the University of al-Qarawiyyin, which UNESCO and Guinness World Records recognise as the oldest existing, continually operating institution of higher learning in the world. Her personal story survives mainly through one medieval chronicle written long after her death, so some details are firm and others are reported with real uncertainty.
A family from Kairouan settles in Fez
Fatima’s father, Mohammed Bnou Abdullah al-Fihri, was a well-educated merchant who passed his love of learning on to his children. The family came from Kairouan, a major city of Islamic North Africa in what is now Tunisia. At some point in the early ninth century Fatima migrated with her father and sister from Qayrawan in Tunisia to Fez in Morocco.
In the ninth century, Fez was the capital of the Idrisid dynasty, the first Islamic state based in present-day Morocco. Fez had drawn a sizeable community of emigrants from Kairouan, and the al-Fihri family settled among them. It is this community that Fatima’s mosque would eventually serve.
An inheritance, and a mosque built without a patron
When Muhammad al-Fihri died, his daughter Fatima inherited his wealth. Rather than keep it, or hand it to the ruling dynasty to spend on her behalf, she commissioned the construction of a mosque in Fez, using her inheritance to fund the entire project outright rather than relying on royal or communal patronage.
According to the same tradition, her sister Maryam used her own share of the family wealth the same way. According to the Rawd al-Qirtas by Ibn Abi Zar, in 859 the Al-Qarawiyyin Mosque was founded by Fatima al-Fihri, the daughter of a wealthy merchant, and her sister Mariam is likewise reputed to have founded the Al-Andalusiyyin Mosque the same year. The two mosques, al-Qarawiyyin for the Kairouan community and al-Andalusiyyin for families of Andalusian background, still stand on opposite banks of the river that runs through the old city of Fez.
Timeline: from a single mosque to a university
| Period | Event | How well attested |
|---|---|---|
| Early 9th century | Fatima al-Fihri born in Kairouan to a merchant family | Agreed in outline; exact year not fixed in the sources |
| Early 9th century | Family migrates from Kairouan to Fez, capital of the Idrisid state | Agreed |
| 857 or 859 CE (245 AH) | Fatima inherits her father’s wealth and funds the al-Qarawiyyin mosque; her sister Maryam reportedly funds the Andalusian mosque the same year | Core narrative from Ibn Abi Zar’s 14th-century chronicle; the exact year and the “two sisters” detail are both questioned by modern historians |
| 10th century | The mosque becomes Fez’s leading congregational mosque and a center of advanced teaching | Reported in later sources |
| c. 880 (approximate) | Fatima al-Fihri dies | Approximate date given by secondary sources |
| 12th century, Almoravid era | Major rebuilding and decoration in Andalusian style; Maimonides reportedly studies there | Architecture well documented; Maimonides link is tradition, not a certain record |
| 1349 CE (750 AH) | Marinid Sultan Abu Inan Faris establishes a dedicated library building beside the mosque | Widely reported |
| 14th century | Ibn Khaldun uses the library while working at the Marinid court in Fez | Well documented through his own writings and later scholarship |
| 1602 CE (1011 AH) | Saadian Sultan Ahmad al-Mansur gifts an illuminated Quran to the library | Recorded in library catalogues |
| 1963 | Incorporated into Morocco’s state university system | Official date |
| 1965 | Officially renamed University of Al Quaraouiyine | Official date |
| 2012 to 2016 | Library restored by architect Aziza Chaouni and reopened to a wider public | Documented |
What the early sources say, and where they differ
Fatima’s story is told by Ibn Abi Zar (d. between 1310 and 1320) in The Garden of Pages, known as Rawd al-Qirtas, as founder of the mosque. That book is a 14th-century chronicle that describes the rulers of the Maghreb and a local history of the city of Fez. It is written more than four centuries after Fatima is said to have lived.
Because she was first mentioned many centuries after her death, her story has been hard to substantiate, and some modern historians doubt her existence. Wikipedia’s entry on the university goes further, noting that this foundation narrative has been questioned by some modern historians who see the symmetry of two sisters founding the two most famous mosques of Fez as too convenient and likely originating from a legend, and Ibn Abi Zar is also judged by contemporary historians to be a relatively unreliable source. Sources also disagree on the precise year, giving the mosque’s founding as 857 or 859.
None of this means the core outline is false. It means that, as with many figures from the ninth century, the detailed narrative comes from a single later chronicle rather than a contemporary document, and historians are honest about that gap. You can check any Hijri year mentioned here against the Gregorian calendar with the site’s own Hijri date converter.
From a neighborhood mosque to a seat of learning
The mosque did not open as a university with a faculty and a curriculum. Teaching grew up around it gradually, through scholars holding circles, granting permissions to teach, and building a library. The mosque went on to become the most important congregational mosque in Fez and one of the foremost intellectual centers in Islamic North Africa.
Though the university first focused on religious instruction, its fields of study quickly expanded to include logic, medicine, mathematics and astronomy, among many others. It is also credited with introducing a system of awarding degrees according to different levels of study in a range of fields, such as religious studies, grammar and rhetoric.
Named scholars connect to the institution across several centuries. The Marinid sultan Abu Inan Faris appointed Ibn Khaldun to a clerical post at court and gave him access to the library at al-Qarawiyyin, which by the fourteenth century held one of the largest manuscript collections in the Islamic world. The mystic and philosopher Ibn al-Arabi is recorded as having studied there in the twelfth century. Tradition also connects the Jewish philosopher Maimonides to the school during his family’s years in Fez in the 1160s, though the record of his formal study there is not certain and the association is carried by tradition rather than documents.
A library that outlasted dynasties
The mosque’s library grew through donations from rulers and scholars over hundreds of years. It holds more than 4,000 manuscripts, including a 9th-century Quran written in Kufic script on camel skin, some of the earliest known Islamic hadith manuscripts, and an original manuscript of Ibn Khaldun’s Muqaddimah. It is also said to hold a manuscript on the Maliki school of Islamic jurisprudence by the Spanish jurist and philosopher Ibn Rushd, dated 1198.
By the 2010s the building itself needed urgent repair. In 2012 the Moroccan Ministry of Culture asked architect Aziza Chaouni to rehabilitate the library so it could reopen to the general public. The restoration took several years, and the project is often noted for a fitting detail: a library founded by a woman twelve centuries earlier was brought back to life by a woman architect. The reopened complex now holds a reading room, a manuscript restoration laboratory and exhibition space alongside the historic collection.
Recognition as the world’s oldest university, and what that claim covers
The University of al-Qarawiyyin is recognised by UNESCO and Guinness World Records as the first degree-granting educational institute in the world. It is worth being precise about what that record measures. One careful account of the claim notes that Guinness uses the category “oldest existing and continually operating higher-learning institution,” which is not the same as universal agreement over the first university.
In practical terms, this means higher teaching developed around the mosque through scholars, circles, texts and permissions; it did not begin with a modern faculty charter in 859. The 859 date marks the founding of the mosque itself. The teaching institution we would recognise as a university today took shape gradually afterward, and then formally, through its incorporation into Morocco’s modern state university system in 1963 and its official renaming two years later.
What this story offers the reader
A few things stand out clearly, even allowing for the gaps in the record.
First, an individual act of private charity, carried out with no state funding and no public ceremony, produced an institution that has served students for over a thousand years. Islamic teaching has a name for exactly this kind of giving, where the benefit keeps flowing long after the giver has died.
إِذَا مَاتَ الإِنْسَانُ انْقَطَعَ عَنْهُ عَمَلُهُ إِلاَّ مِنْ ثَلاَثَةٍ إِلاَّ مِنْ صَدَقَةٍ جَارِيَةٍ أَوْ عِلْمٍ يُنْتَفَعُ بِهِ أَوْ وَلَدٍ صَالِحٍ يَدْعُو لَهُ
Abu Huraira (Allah be pleased with him) reported Allah's Messenger (ﷺ) as saying:When a man dies, his acts come to an end, but three, recurring charity, or knowledge (by which people) benefit, or a pious son, who prays for him (for the deceased)
A mosque, a library and a line of teaching that still continues in Fez today fit squarely into that category of lasting good.
Second, the story is transmitted as the story of a woman acting as founder and sole patron of one of the major religious and educational institutions of her region, in the ninth century. Whatever uncertainty attaches to the details, that is the shape in which later generations chose to remember her.
Third, the library’s own history is a reminder that knowledge needs upkeep as much as it needs founding. Manuscripts that survived war, fire and thirteen centuries of use nearly did not survive simple damp and neglect in the twentieth century. A building, like a tradition of learning, has to be looked after by every generation that inherits it.
Sources
- Wikipedia: University of al-Qarawiyyin
- Wikipedia: Fatima al-Fihriya
- Wikipedia: Rawd al-Qirtas
- Wikipedia: Ibn Abi Zar
- Wikipedia: History of Fez
- Odyssey Traveller: Qarawiyyin Library, Fez, Morocco
- The History Blog: Oldest library in the world renovated, digitized
- TED Ideas: Restoring the world’s oldest library
- The Muslim Post: Al-Qarawiyyin, Fatima al-Fihri and the World’s Oldest University Claim
Header photo of University of al-Qarawiyyin: JasmineartGallery, CC BY-SA 4.0, via Wikimedia Commons.

