History of the World's Oldest Library; Al-Qarawiyyin Library and University, Fez

Al-Qarawiyyin Library and University, Fez There is something magical about the medina, or old city, of Fez. Many liken it to stepping back in time as travellers get lost amongst the labyrinthine sandstone walls of…

22 Oct 19 · 7 mins read

Al-Qarawiyyin Library and University, Fez

There is something magical about the medina, or old city, of Fez. Many liken it to stepping back in time as travellers get lost amongst the labyrinthine sandstone walls of the world’s largest car-free urban space. Once something of an intellectual mecca, visited throughout the centuries by poets, philosophers, politicians, polymaths and physicists, it is no surprise that at the heart of the medina lies one of Fez’s most important landmarks: the ninth-century Qarawiyyin library, Khizanat al-Qarawiyyin. The complex is made up of a library, mosque and university, making the university the first degree-granting institution in the world. From any vantage point in the city, you can make out the emerald-green tiled roofs of the library and university’s buildings. Recently restored, the library is home to some incredible historical artefacts and offers a glimpse into the intricate and vibrant story of Fez, once the city of sultans.

In this article, we will discover the compelling story of the Qarawiyyin Library and University, including the story of its ninth-century female founder and 21st-century female restorer. This article was inspired in part by a chapter in Justin Marozzi’s book Islamic Empires: Fifteen Cities that Define a Civilisation entitled ‘Fez – the Athens of Africa’ published by Allen Lane in 2019, as well as other articles linked throughout. Read on to learn more about this spiritual and cultural powerhouse and the role it has played in shaping the Fez we know today.

This is part of our collection of Morocco-related articles that we share as useful background information before you go on a Morocco tour with us, or to simply help you as you firm up your travel plans. All of those articles can be found here.

The Founding of Fez

An image of the tanneries in Fez, Morocco
Fez, Morocco

Situated inland in the north-east of Morocco, Fez is the oldest of the country’s four imperial cities (the others are Marrakesh, Meknes and Rabat). Fez was built by the first Muslim dynasty, the Idrissids in the late eight-century. It is said that Idris I decided that the capital Volubilis (now an excavated Berber city outside of Meknes) was too small a capital and sought something more lavish. He drew up plans for a new, grander capital but died before anything could be done about it. The task, then, was up to his son, Idris II. In his book Islamic Empires, Justin Marozzi recounts the mythological story of how Idris II came to found the city. Legend has it that while Idris II was looking for a site he encountered a Christian monk (supposedly the monk was over 150 years old). The monk told Idris II that on the site their used to be a city called Zef and that one day, a man named Iris would ‘renew it, revive it from oblivion, make stand its ruins; and that its importance would be great, its destiny momentous’ (Marozzi 2019, p. 156). Idris declares that he is that man and says he will reverse the name of the ancient city that once lay there.

When it was first founded, Fez developed as two separate settlements on each bank of the Fez River. Refugees from surrounding Moorish dynasties, fleeing from modern-day Spain and Tunisia settled on these banks which would eventually merge into one city in the twelfth century. Fez’s location, and the landscapes that surrounded it, proved to be auspicious. Thanks to the confluence of two rivers, the city had a seemingly never-ending supply of water and it was close to quarries, from which building supplies could be sourced. It was surrounded by the forests of the Middle Atlas mountains as well as arable land where farmers grew fruit, cereals and olives and raised livestock. The proximity of mountain ranges meant that the climate in Fez was considered more temperate than other parts of North Africa (though the it does still get very hot in summer!).

Fatima al-Fihri: The Tunisian Trailblazer in Morocco

The eye-catching green roof of the Qarawiyyin Mosque in Fez
The eye-catching green roof of the Qarawiyyin Mosque in Fez

Credited with founding oldest existing, continually operating and first degree-awarding educational institution, Fatima al-Fihri cuts a formidable figure in history. It was her vision and investment that saw the founding of the Qarawiyyin Mosque and Madrassa (school) almost 1200 years ago and in part thanks to her that the universities as we know them today exist.

Al Fihri was born in Qayrawan, Tunisia to a wealthy merchant family. Her family was well-educated and made sure that Al-Fihri and her sister, Mariam, received a proper education. In the early 9th century, they left Tunisia to settle in Fez, along with many other migrants. When her father died, many of Al-Fihri’s male relatives had passed away, which meant both Al-Fihri and her sister inherited a sizeable fortune. They were intelligent and pious women and rather than squandering away the money, they sought to invest it back into the community somehow. Having developed a profound respect for education thanks to her family, Al-Fihri decided to put her money, as well as her time and dedication, into building an educational institution. Some sources say that she was so devoted to this cause that she fasted for the 18 years that it took to build the complex. She oversaw the construction, which included classrooms, a prayer hall, a library and a courtyard. The university was established in 859 and offered courses on the Qur’an and religious texts and Al-Fihri is thought to have attended lectures there in her later years. Al-Fihri also pioneered the idea of creating a place where you would not just be educated but would also be granted a certificate to show your education had been complete. Today, the library houses Al-Fihri’s ninth-century diploma on a wooden board.

Expansion and Notable Alumni

Over the years, the Qarawiyyin grew and quickly cemented its reputation as a centre of learning and culture. In the early 12th-century, under the Almoravid Dynasty, a large restoration project took place and the complex was enlarged, its surface area stretching to around 6000 square metres, according to Marozzi. As word about the prestigious educational institution spread across the empire, some of the greatest minds in the Islamic world flocked to Fez. Some of the university’s most notable former students include:


An image of Jewish scholar Maimonides
Jewish scholar Maimonides

The Sephardic Jewish philosopher Moses ben Mamon, or Maimonides, studied at the Qarawiyyin in the 12th-century. Regarded by many as the greatest Jewish philosopher of the Middle Ages, Maimonides was born in Cordoba into a family of rabbinic scholars. Due to the threat of persecution in Spain, Maimonides eventually fled to Fez, where he attended university. While in Fez, he composed Mishneh Torah, a 14-volume text on Jewish law. The publication of this would see him established as one of the leading rabbinical thinkers of his time. After his studies, he journeyed to Fostat in Egypt and trained to become a physician, progressing to become to the official doctor of Saladin, the rule of Egypt.

Ibn Khaldun

A bust of Ibn Khladoun
A bust of Ibn Khladoun

In the 14th-century, the pioneering historian and historiographer Ibn Khaldun is thought to have studied at the Qarawiyyin University. Often described as ‘the man who invented modern history’ and ‘the father of philosophy’, the North-African historian is known for developing one of the first nonreligious philosophies of history in his ground-breaking work Muqaddimah. In Muqaddimah, Khaldun theorised why civilisations rise and fall without looking solely at divine factors. Marozzi describes him as ‘the most distinguished Qarawiyyin alumnus bar none’ (p. 153).

Leo Africanus

Leo Africanus, also known as Ibn al Wazzan, was an Andalusian diplomat and Islamic scholar who studied at the university during the 16th-century. After completing his education in Fez, he travelled widely through North Africa but during a voyage through the Mediterranean he was captured by Christian pirates and presented to Pope Leo X as a gift. He was forced to be a slave of the Pope, he freed him after a year after converting him to Christianity. In 1526, he completed what would be his finest work A Geographical Historie of Africa.

Restoration and Reopening

An image featuring the ornate tile-work at the Qarawiyyin
Some of the ornate tile-work at the Qarawiyyin

In 2012, the Moroccan-Canadian architect, Aziza Chaouni, was tasked with restoring the Qarawiyyin. Having grown up in Fez, Chaouni was thrilled to be asked by the Moroccan government to transform the complex, which had fallen into disrepair over the years and was suffering from a long list of architectural problems, exacerbated by the heart and humidity of the Moroccan climate, including broken tiles and a poor drainage system. A long challenge lay ahead of Chaouni with the last proper restoration project wrapping up decades earlier in the 1940s. When talking about other restoration attempts that had been carried out, Chaouni told CityLab ‘The internal organs needed work. You can put makeup on someone who is very ill, and they’ll look good for a few hours, but on the inside they’re still very sick, so it won’t last’.

Over the next four years, Chaouni and her team worked hard to transform the remarkable institution into a place that reflected its glory. Given that a branch of the Fez River ran underneath the library’s floor, Chaouni constructed an underground canal that diverted the river. She integrated new and sustainable technologies, like solar panels, an updated gutter system and water collection for garden irrigation.

The Qarawiyyin complex is home to over 4,000 historical books and ancient texts written by renowned scholars and thinkers over the centuries. Some of the literary gems housed in the library include a ninth-century copy of the Qur’an, escribed on camel skin, a manuscript of Ibn Khaldun’s Muqaddimah and a manuscript by Averroes on Islamic jurisprudence. Thanks to Chaouni, digital locks now guard access to these rare books and air-conditioning helps to prevent humidity from damaging their quality.

In the past, the library was only accessible to scholars and students but Chaouni vigorously petitioned for part of the library to be open to the general public. She wanted it to be a place people could visit and take in the history of Fez. The Moroccan government agreed and the library now has a wing open to the public, which features an exhibition room and a café.

Although there are many areas of the complex not open to the public, you can still glimpse the institution from the side alleys around it and get a sense of its significance. As well as the Qarawiyyin, there is much to admire in Fez, which is still seen as Morocco’s cultural capital. Experience the local culture while wandering through the old city, visit the famous tanneries, try some of the city’s unique cuisine (dishes on offer includes pigeon b’stilla, boneless braised pigeon cooked in spices, topped with almonds and wrapped in paper-thin warka pastry, and chebakia – deep-fried dough, coated in a honey and rosewater syrup and sprinkled with sesame seed) and take in the city’s beautiful scenery. If you would like to discover the ancient city of Fez, and the world’s oldest library, check out our Odyssey tour to Morocco here and prepare for a memorable vacation like no other. If you’re interested in learning more about Morocco and its history, click here.

Related Tours

Morocco tour

20 days

Apr, Oct, Mar

Morocco tour for senior travellers

Visiting Morocco

Embark on an unforgettable journey through Morocco: A Gateway to a world of vibrant colors, cultural diversity, and endless wonder. Join our escorted small group tour designed for senior travellers, whether you're a couple or a solo adventurer, and immerse yourself in the captivating allure of Casablanca, Fez, Meknes, Rabat, Marrakech and beyond. Experience the richness of Moroccan traditions and heritage as we explore this enchanting destination.

From A$11,915 AUD

View Tour
Egypt tour valley of the kings

18 days

Jan, Nov

Egypt tour: escorted small group history & cultural tour of Egypt

Visiting Egypt

Our small group program for senior and mature couples and solo travelers takes us to contemporary feats such as the Aswan Dam and also to current crucibles of the Egyptian experience such as Tahrir Square. Proof, were it needed, that Egypt’s role as the pivot of civilisation is far from ended. There is the opportunity to visit our Morocco, Jordan or Iran tours before embarking on this tour of Egypt.

From A$12,950 AUD

View Tour
Ancient History of Jordan

9 days

Jan, Oct

Ancient History of Jordan | Escorted Small Group Tour

Visiting Jordan

Explore Jordan, visiting its capital city, Amman Jordan, the ancient Desert Castles, Petra and the Dead Sea on a small group package tour for mature and senior travellers travelling as a couple or Solo.

From A$6,750 AUD

View Tour

Join 22,383 like-minded travellers receiving our weekly newsletter.

Special offers and promotions
A$350 AUD first trip travel voucher
The latest tours and articles