Discovering...
Discovering...

In 788 CE a fugitive prince from Baghdad arrived among the Berber tribes of northern Morocco. Within three years he controlled a kingdom. His son built Fes. Their legacy still shapes every corner of Morocco you visit today.
Omar Benali· Sahara & Southern Routes Editor
A former desert driver turned writer, Omar has guided and travelled the routes from Ouarzazate to Merzouga and Zagora for years. He writes about the Sahara, kasbah roads and the Draa and Dades valleys. Ouarzazate · 14+ years covering Morocco
Published 2 May 2025 Last updated 29 April 2026
The Idrisid dynasty was the first independent Islamic state in Morocco — and, for many historians, the moment the country became Morocco rather than simply a distant western province of an eastern empire. It lasted less than two centuries, but what it built — the city of Fes, the Maliki legal tradition, the model of Sharifian rule — outlasted every dynasty that followed.
Understanding the Idrisids makes visiting Morocco richer in practical, immediate ways. The medina of Fes el-Bali that you walk through today follows a street plan that Idriss II commissioned around 809 CE. The town of Moulay Idriss Zerhoun, where the dynasty’s founder is buried, is one of Morocco’s most atmospheric pilgrimage sites and pairs perfectly with the Roman ruins of Volubilis 5 km away. And the Qarawiyyin mosque — the oldest continuously operating university in the world — sits where it does because of who Idriss II invited to settle in his new city.
What follows is the story, then the sites.
Six moments that explain how a single exiled prince transformed Morocco’s political and religious landscape.
788 CE
Fleeing the Abbasid caliph in Baghdad after the Battle of Fakh, Idriss ibn Abdallah — a great-great-grandson of the Prophet Muhammad through Ali — reaches the Berber tribe of the Awraba at Walili (Volubilis). The tribe’s chief Ishaq ibn Mohammed recognises him as imam and protector, giving him a political base almost immediately.
789 CE
Idriss I is formally recognised by several Berber tribes as their religious and political leader. His combination of Sharif lineage — descent from the Prophet — and military acumen unites communities that had resisted Byzantine and Umayyad pressure for a generation. Within a year he controls territory across northern Morocco.
791 CE
Haroun al-Rashid sends the Abbasid agent Sulayman ibn Jarir to poison Idriss I with a gift of perfume. He dies, but his Berber concubine Kanza is pregnant. Their son — Idriss II — is born six months later and eventually proclaimed imam at age eleven under the regency of the freedman Rashid ibn Yasir.
808–809 CE
Idriss II relocates the capital from Walili south to a new city on the Fes River. He lays out the royal precinct on the right bank — the nucleus of what becomes Fes el-Andalus — and invites thousands of refugees from the Umayyad reconquest of Córdoba and from the Aghlabid-controlled Kairouan. These immigrants bring skills in ceramics, leatherwork and scholarship that permanently shape the city's character.
859 CE
Though founded two generations after Idriss II's death, the University of al-Qarawiyyin in Fes grows directly from the literate, devout community the Idrisids assembled. Fatima al-Fihri, daughter of a wealthy merchant who had come from Kairouan, endows the mosque and the adjacent madrasa. It is recognised by UNESCO and the Guinness Book of Records as the world's oldest continuously operating university.
974 CE
Internal divisions among Idrisid princes, combined with pressure from the Fatimid caliphate in the east and the Umayyads of Córdoba in the north, gradually erode the dynasty's hold. The last significant Idrisid ruler, Hasan ibn Kannun, is captured and taken to Córdoba around 974 CE. The dynasty dissolves, but the Islamic institutions, city plan, and Sharifian prestige it created outlast every subsequent Moroccan state.
Idriss I was the first ruler to base political authority in Morocco on descent from the Prophet. Every major subsequent dynasty — Saadian, Alaoui — claimed the same Sharifian lineage. King Mohammed VI today holds the title "Commander of the Faithful" within this same framework.
The Idrisids established Maliki fiqh (jurisprudence) as Morocco's official legal tradition. It remains so today. Maliki law differs from other Sunni schools in emphasising the practice of the people of Medina as a source alongside Quranic text — an orientation that shaped Moroccan court practice for over a thousand years.
By inviting scholars from Córdoba and Kairouan, Idriss II ensured Fes became a meeting point for the most sophisticated Islamic intellectual currents of the age. The Qarawiyyin mosque-university, founded in 859 CE and still operating, is the direct institutional descendant of that founding demographic.
The annual pilgrimage festivals at saints' tombs — a defining feature of Moroccan popular Islam — grew from the reverence for Idriss I and II. The Moussem of Moulay Idriss Zerhoun is Morocco's largest such gathering, but the pattern it exemplifies repeats in hundreds of towns across the country.

"The tomb of Idriss I at Moulay Idriss Zerhoun still draws pilgrims who believe a visit here carries the spiritual merit of seven pilgrimages to Mecca."
— Traditional Moroccan saying
Four sites connect directly to the dynasty — and all are reachable on a well-planned Morocco itinerary.
The hilltop town built around the tomb of Idriss I, 25 km north of Meknès. Non-Muslims could not stay overnight until 2005; now it welcomes all visitors. The annual Moussem festival in late summer draws pilgrims from across Morocco.
Getting there: ~3 hr from Marrakech; ~1 hr from Fes
The walled medina that Idriss II's settlement became. The Andalusian and Kairouan quarters he established are still distinct neighbourhoods. Walking through the tanneries and souks is to walk through the physical legacy of 9th-century Idrisid urbanism.
Getting there: Fly into Fes-Saïss Airport (FEZ)
The mausoleum of Idriss II sits in the heart of Fes el-Bali, close to the Qarawiyyin mosque. The ornate tiled exterior is accessible to all; the inner sanctuary is for Muslims. The surrounding alley (Talaa Kbira) is one of the most atmospheric streets in the medina.
Getting there: 15-minute walk from Bab Bou Jeloud gate
The Roman city where Idriss I was first received by the Awraba. The mosaics and triumphal arch survived because Idriss I chose to build his own capital elsewhere rather than demolish the Roman structures. A UNESCO World Heritage Site and a 40-minute drive from Moulay Idriss.
Getting there: ~30 km from Meknès
Practical note: Moulay Idriss Zerhoun and Volubilis are almost always visited together as a day trip from Meknès or Fes — Meknès is the more convenient base and adds its own imperial-era sights. Budget a full day and hire a guide at Volubilis (guides are licensed, knowledgeable, and indicatively priced from around 150–200 MAD for a 90-minute tour). The pilgrimage town itself takes around 90 minutes to explore on foot; enter through the lower gate and climb toward the zaouia.
Idriss ibn Abdallah — known as Idriss I or Moulay Idriss — founded the dynasty in 788 CE. He was a direct descendant of the Prophet Muhammad through the line of Ali and Fatima, which gave him powerful religious legitimacy. He fled to Morocco after backing the losing side in the Battle of Fakh against the Abbasid caliph Haroun al-Rashid, and was welcomed by the Awraba Berber tribe near the Roman ruins of Volubilis. He unified several Berber tribes under his authority and established the first independent Islamic polity in the far Maghreb.
Moulay Idriss I is considered the founding father of Islamic Morocco — the figure who transformed the country from a mosaic of Berber tribes into a coherent Muslim state independent of eastern caliphates. His Sharifian bloodline (descent from the Prophet) created the template for Moroccan political legitimacy that all subsequent dynasties — Almoravid, Almohad, Merenid, Saadian, Alaoui — have worked to emulate or inherit. The town of Moulay Idriss Zerhoun, built around his tomb, remains Morocco's foremost pilgrimage destination, and the current royal family traces its own Sharifian legitimacy partly back to his example.
Idriss II founded the city of Fes around 808–809 CE on the banks of the Fes River, roughly 25 km south of his father's base at Volubilis. He attracted two large waves of settlers: refugees from Córdoba after the Umayyad crackdown on a Berber revolt (bringing the Andalusian Quarter its name), and families from Kairouan in what is now Tunisia. These immigrants introduced the crafts, cuisine, and scholarship that made Fes the intellectual capital of the western Islamic world. The city's famous tanneries, ceramics traditions, and leather-working guilds all trace directly to that 9th-century founding demographic.
The Idrisids consolidated Sunni Islam in Morocco, specifically the Maliki school of Islamic law, which remains Morocco's official legal tradition today. Islam had reached North Africa decades before Idriss I, but the Idrisids gave it a stable institutional framework — mosques, madrasas, and courts operating on Maliki jurisprudence. They also brought a distinctly Sharifian spiritual culture: reverence for the Prophet's family, a tradition of Sufi-adjacent piety, and the practice of moussem pilgrimages to saints' tombs, all of which define popular Moroccan Islam to this day.
Idriss I is buried in the town of Moulay Idriss Zerhoun, perched on twin hills above the Sebou plain, about 25 km northwest of Meknès. His tomb (zawiya) is the centrepiece of the town and was for centuries off-limits to non-Muslims even for an overnight stay — that restriction was lifted in 2005. The annual Moussem of Moulay Idriss, held in late August or September, is one of Morocco's largest religious festivals, drawing pilgrims who believe visiting the tomb carries special spiritual merit (baraka). Most visitors pair the town with nearby Volubilis on a day trip from Meknès or Fes.
The Idrisid dynasty lasted approximately 185 years, from Idriss I's arrival in Morocco in 788 CE to the capture of the last significant Idrisid prince, Hasan ibn Kannun, around 974 CE. The dynasty did not fall at a single moment — it fragmented over the 10th century as rival factions aligned with either the Fatimid caliphate (based in what is now Tunisia and later Egypt) or the Umayyad caliphate of Córdoba. What persisted far longer than the political dynasty was its institutional legacy: the city of Fes, the Maliki legal framework, and the Sharifian model of rule that Morocco's monarchy still draws on today.
The main sites are Moulay Idriss Zerhoun (the tomb town, best on a half-day trip from Meknès), Volubilis (the Roman city where Idriss I was received — 40 minutes from Moulay Idriss, UNESCO listed), and Fes el-Bali (the entire old medina, with the Zawiya of Idriss II and the Qarawiyyin mosque at its heart). A private guided tour makes sense because the historical connections between sites are not obvious without context — a good guide can link the Idriss tomb, the Andalusian and Kairouan immigrant quarters in Fes, and the Roman ruins into a coherent narrative that reads as living history rather than a list of old buildings.
Plan it with a local expert
Crafting extraordinary journeys through Morocco's timeless landscapes. 100% private journeys, handcrafted around you.
from $2,054Essential Morocco: Imperial Cities Circuit
from $5,978Sahara to Sea: Morocco Complete