The History of Moroccan Manuscripts and Libraries: Qarawiyyin, the Royal Library and the Books of Fez

The history of Moroccan manuscripts begins in Fez, in a mosque-university founded by a woman in the 9th century, and runs through a thousand years of copyists, sultans, scholars and desert libraries. Morocco's old books are not museum pieces: they are the working records of a civilisation that wrote its law, science, poetry and faith by hand, and many can still be seen in the libraries that hold them.

This guide follows the history of Moroccan manuscripts from Qarawiyyin in 859 to today's digitisation projects: the royal collections of Rabat, the madrasa libraries of Fez, the desert library of Tamgrout, and the books that crossed the Sahara from Timbuktu. Dates scholars argue about are marked as unsettled.

An illuminated Moroccan manuscript with gold-leaf calligraphy open on a carved wooden stand in the history of moroccan manuscripts

In this guide

The History of Moroccan Manuscripts at a Glance

The short version: Morocco's manuscript culture starts with the University of al-Qarawiyyin in Fez, founded in 859, whose library is among the oldest in the world still in use. From there it spreads through the Marinid madrasas, the royal libraries of Marrakech, Meknes and Rabat, and the desert library of Tamgrout.

Four things define the history of Moroccan manuscripts. The books were practical: law, medicine, astronomy and grammar, copied for students and judges. The script is distinctive — the rounded Maghrebi hand, unlike the scripts of the east. The collections moved with power, rising with a capital and scattering when its dynasty fell. And much of it survives — in Fez, Rabat and Tamgrout, thousands of manuscripts are still held today.

Why Fez Became the City of Books

Fez became the city of books because it was, for centuries, the city of scholars. Founded in the late 8th century, it sat on the trade routes between the Mediterranean, the Sahara and the Atlantic, and its rulers competed to attract teachers. A city that imports teachers soon imports books.

The book trade shaped the city's geography, and the history of Moroccan manuscripts is written in its streets. The Koutoubia mosque of Marrakech takes its name from the Arabic word for books — kutub — because booksellers worked in the streets around it, and Fez had its own book souks near Qarawiyyin. Our Fez travel guide walks through the medina where this trade still leaves traces.

Qarawiyyin: The World's Oldest University Library

The University of al-Qarawiyyin was founded in 859 by Fatima al-Fihri, a wealthy woman from Kairouan in present-day Tunisia, who used her inheritance to build a mosque that became a centre of learning. UNESCO describes it as the oldest existing, continuously operating educational institution in the world. Its library grew with it, and the history of Moroccan manuscripts starts there.

The library's collection holds around 4,000 manuscripts, including Qur'ans, works of law, medicine, astronomy and grammar. Among its oldest holdings is a Qur'an written in Kufic script and dated to the 9th century, and a manuscript of Ibn Khaldun's Muqaddimah that the library dates to the 14th century. The exact dating of the oldest items is debated, and the catalogue gives some dates as estimates.

Famous names passed through Qarawiyyin. Leo Africanus, the 16th-century traveller and geographer, studied there; tradition also places the young Maimonides among its students in the 12th century, though historians debate the details. A persistent legend sends the future Pope Sylvester II to study in Fez — no document proves it. The UNESCO listing for the Medina of Fez records the university and its library as part of a World Heritage site.

The reading room of the Qarawiyyin library in Fez, with carved cedar shelves and rows of ancient books

The Royal Library of Rabat

If Qarawiyyin is the scholar's library, the Royal Library of Rabat is the sultan's. It grew out of the general library founded under the French Protectorate in the 1920s and later became the library of the Alaouite kings, housed in the royal palace complex. Its shelves hold the manuscripts collected by the sultans: illuminated Qur'ans, royal chronicles, diplomatic correspondence, and the books of the court.

The Royal Library is not a public library in the ordinary sense — access is restricted, mainly to researchers with permission — and its holdings are less documented than Qarawiyyin's. That secrecy is itself part of the history of Moroccan manuscripts: royal collections were instruments of prestige.

Paper, Ink and the Copyists of Fez

No history of Moroccan manuscripts makes sense without the copyists. Before printing, every book was written by hand, and Fez supported a whole trade around the work: paper-makers, ink-makers, calligraphers, illuminators and binders.

Paper reached the Maghreb from the east, and Fez had paper mills by the 12th century, using linen rags beaten to pulp and dried in sheets. The ink was made from soot and gum arabic; the pens were cut from reeds, and the script was the rounded Maghrebi hand. A skilled copyist produced a few pages a day, and a long work took months.

The Marinid Madrasas and Their Libraries

The Marinid sultans, who ruled from Fez in the 13th and 14th centuries, built the libraries at the heart of the history of Moroccan manuscripts. Each madrasa — a college for students of law and religion — came with its own library, endowed with books as deliberately as with carved cedar.

The oldest is the Seffarine Madrasa, founded in 1271, followed by the Attarine Madrasa of 1323–1325 and the great Bou Inania Madrasa of 1350–1355, built by Sultan Abu Inan Faris. Bou Inania, with its courtyard, minaret and ablutions hall, is the finest Marinid building in Fez, and its library once served the students in its cells. Our guide to the history of Moroccan architecture covers these buildings.

What the Manuscripts Contain

Open a Moroccan manuscript collection and the first surprise is how practical it is. Religion and law dominate — Qur'ans, commentaries, collections of legal opinions — but beside them sit works of medicine, astronomy, mathematics, grammar, history, poetry and Sufi mysticism.

Medicine was a strong tradition in the history of Moroccan manuscripts: Moroccan physicians commented on Avicenna and Averroes and added their own herbals from the plants of the Atlas and the Sahara. Astronomy set the prayer times and the calendar.

The Golden Qur'ans: Illumination and Calligraphy

The most beautiful objects in the history of Moroccan manuscripts are the illuminated Qur'ans. Moroccan calligraphers wrote in the Maghrebi script, with its rounded letters and sweeping curves, and the finest copies were decorated with gold leaf, lapis blue and vermilion — geometric borders, chapter headings in gold, and divine names picked out in colour.

These were not the everyday Qur'ans of the mosque. A golden Qur'an was a commission for a sultan or a great family, and it could take a calligrapher and an illuminator a year or more. The gold was real — beaten leaf laid on the page — and the blue came from lapis lazuli imported from the east, which is why the finest pages still shine after six centuries. Some copies were written on parchment, a few on gazelle skin. Our guide to the history of Moroccan jewellery shows the same taste for gold and geometry in another craft.

The Great Private Libraries of Fez

Beyond the mosques and madrasas, Fez's great families kept libraries of their own — the Fassis, the Benjellouns, the Tazis and others whose names still mark the medina's streets. A private library was a family's pride and its capital: hundreds of volumes, inherited, bought or copied by the family's own scribes, shelved in a room of the house and opened to the scholars the family patronised.

These libraries are the least documented part of the history of Moroccan manuscripts, because they were private. Some were dispersed when families left Fez; others were donated to Qarawiyyin or the state; a few remain in family hands today. Historians estimate that private collections once held as many manuscripts as all the public libraries combined.

The Saadian and Alaouite Collectors

When power moved south to Marrakech, the books followed. Sultan Ahmad al-Mansur, who ruled from 1578 to 1603, built the El Badi Palace and filled it with a library to match, drawing scholars and manuscripts from across his empire. The Saadian court collected lavishly — illuminated Qur'ans, histories, and the books of its scholars.

The Alaouite sultans who followed collected in their turn. Moulay Ismail, who ruled from Meknes from 1672 to 1727, gathered manuscripts into his new capital, and later sultans added to the royal collections that became the Royal Library of Rabat. Each move of the capital meant a move of the books.

The Timbuktu Connection: Manuscripts Across the Sahara

The most dramatic chapter in the history of Moroccan manuscripts crosses the Sahara. In 1591, Ahmad al-Mansur sent an army across the desert and conquered the Songhai Empire, taking Timbuktu — then one of the great centres of Islamic learning, with libraries of thousands of manuscripts. Scholars and books were brought back to Marrakech, including the scholar Ahmad Baba, who lived in the city from 1593 to 1608.

Ahmad Baba (1556–1627) was the most famous scholar of Timbuktu, author of a biographical dictionary of the scholars of the western Sudan, and his own library was legendary. His enforced stay in Marrakech made him a bridge between the two manuscript worlds: he taught in Morocco and carried Moroccan books back to Timbuktu when he returned.

Caravans carried books south with the salt and gold trade for centuries after, and the books that survive in both cities still share hands, scripts and subjects. The Treaty of Fez of 1912 ended the old order centuries later, but the manuscript traffic across the Sahara had already shaped both libraries.

Ancient manuscripts in worn leather bindings on wooden shelves in the Tamgrout library in the Draa Valley

Losing and Saving the Books

Manuscripts are fragile, and the history of Moroccan manuscripts is full of losses. Fire was the great enemy: libraries burned in palace fires and in the fighting that accompanied the fall of dynasties, and a single fire could destroy a collection built over centuries. Water, insects and the damp of the Fez winter did slower damage.

Neglect was as dangerous as disaster. A manuscript that nobody reads is a manuscript that nobody repairs, and as printed books spread in the 19th and 20th centuries, handwritten volumes were set aside — stored in chests, forgotten in mosque back rooms. Some were sold and left the country; others crumbled.

But the saving was systematic too. The waqf endowments that locked books into libraries also protected them: an endowed manuscript could not legally be sold, and the endowment paid for its keeper. In the 20th century the state began to gather and restore them — first in Rabat, then in Fez.

Restoration Today: Digitisation and the Qarawiyyin Reopening

The modern chapter of the history of Moroccan manuscripts began with restoration. In 2016, the library of al-Qarawiyyin reopened after a careful restoration led by the Moroccan-Canadian architect Aziza Chaouni, who rebuilt the reading rooms and brought the collection back into use. The reopening made headlines around the world, and for the first time in decades the library's treasures — the 9th-century Qur'an, the Muqaddimah manuscript — could be seen and studied properly.

Digitisation runs alongside restoration. The National Library in Rabat and the Qarawiyyin library are photographing their manuscripts page by page, so that a scholar elsewhere can read a book that once required a journey to Fez. The work is slow, and only part of the collections is digitised so far.

The work matters because manuscripts still decay. Every year of handling and humidity costs a little more, and the digital copy is the insurance policy: the book itself can rest on a climate-controlled shelf while its image travels the world. The history of Moroccan manuscripts, begun with a woman's endowment in 859, now continues on screens — the same texts, in the same script, reaching readers the copyists never imagined.

Where to See Moroccan Manuscripts Today

Seeing the manuscripts takes a little planning for anyone following the history of Moroccan manuscripts: the libraries are working institutions, not museums. The table below gives the practical picture, with prices checked in November 2026 — verify on arrival.

PlaceCityWhat you seeAccess and price
Qarawiyyin LibraryFezThe oldest collection: Qur'ans and the Muqaddimah manuscriptBy arrangement; the mosque is closed to non-Muslims
Bou Inania MadrasaFezMarinid courtyard and library roomsOpen to visitors, about 20 MAD ($2)
Attarine MadrasaFezMarinid library and carved cedarOpen to visitors, about 20 MAD ($2)
Tamgrout LibraryDraa ValleyAround 4,000 manuscripts, including a gazelle-skin Qur'anOpen to visitors, small donation about 20 MAD ($2)
National LibraryRabatManuscript reading rooms and exhibitionsOpen to researchers; exhibitions free
Royal LibraryRabatThe sultans' illuminated Qur'ans and chroniclesRestricted to researchers with permission
DateEvent
859Fatima al-Fihri founds Qarawiyyin in Fez
12th centuryPaper mills working in Fez
1271Seffarine Madrasa founded, the oldest in Fez
1323–1325Attarine Madrasa built under the Marinids
1350–1355Bou Inania Madrasa built by Abu Inan Faris
16th centuryTamgrout library founded in the Draa Valley
1591Moroccan conquest of Songhai; Timbuktu manuscripts reach Marrakech
2016Qarawiyyin library reopens after restoration

Frequently Asked Questions

Where is the oldest library in Morocco?

The oldest library in Morocco is the library of the University of al-Qarawiyyin in Fez, founded with the university in 859 by Fatima al-Fihri. UNESCO describes Qarawiyyin as the oldest continuously operating educational institution in the world.

Can visitors see the Qarawiyyin library?

Visits are by arrangement rather than open entry, and the mosque itself is closed to non-Muslims. The library reopened in 2016 after restoration, and researchers can apply for access; occasional guided visits show the reading rooms.

What is the Royal Library of Rabat?

The Royal Library of Rabat is the library of the Alaouite kings, holding the sultans' manuscripts — illuminated Qur'ans, royal chronicles and court correspondence. It grew from the general library founded in the 1920s and admits researchers with permission.

What is the Tamgrout library?

The Tamgrout library is a 16th-century manuscript library in the Draa Valley, a southern outpost in the history of Moroccan manuscripts, kept by the Nasiriyya zawiya, holding around 4,000 manuscripts including a Qur'an on gazelle skin. Unlike the royal collections, it is open to visitors for a small donation of about 20 MAD ($2).

How many Moroccan manuscripts survive?

No exact count exists, and estimates vary. Qarawiyyin holds around 4,000 manuscripts and Tamgrout around 4,000 more, with thousands in the National Library and the Royal Library of Rabat and more in private hands. Scholars estimate that only a fraction of what Morocco once held still survives.

Why are Moroccan manuscripts written in a different script?

Moroccan manuscripts use the Maghrebi script, a rounded hand written with a broad reed pen, distinct from the scripts of the east. It developed in the Maghreb and Andalusia over centuries, and it is one of the clearest marks of the history of Moroccan manuscripts — a book's script alone can often place it in Fez.

Conclusion

The history of Moroccan manuscripts is the history of a country that wrote its memory by hand: a university founded by a woman in 859, madrasa libraries built by sultans, private collections kept by families, and a desert library in the Draa Valley. The books survived fire, war, neglect and four centuries of moving capitals — and today they are being restored, catalogued and digitised, so that the pages the copyists of Fez wrote can be read anywhere in the world. The history of Moroccan manuscripts is not finished.

Leave a Comment