Skip to main content
EditionEnglish edition·Édition française
History · Morocco: The Long Empire

Idris II and the Founding of Fez

If Idris I gave Morocco its state, his son Idris II gave it its soul — founding Fez, the city that would be Morocco's spiritual and intellectual capital for twelve centuries.

← All history reports


Morocco 791–828

If Idris I gave Morocco its state, his son Idris II gave it its soul — founding Fez, the city that would be Morocco's spiritual and intellectual capital for twelve centuries.

Idris II was born two months after his father's assassination in 791, raised under the regency of the faithful Rashid and then the Berber chief Abu Khalid Yazid. At eleven, in 803, he was proclaimed imam in Walili — a child ruler whose reign would prove one of the most consequential in Moroccan history.

The young imam's first great act was urban: around 808–809, he founded Fez on the banks of the Oued Fes, at the strategic hinge between the Atlantic plains and the Middle Atlas. Walili was a Roman ruin; Fez was a purpose-built capital — or rather, two cities: Madinat Fas on one bank for the Berber tribes, al-Aliya on the other for Arab settlers. Idris II populated his new capital deliberately: he welcomed waves of immigrants — first Berbers, then, decisively, Arab families fleeing revolts in Ifriqiya and, after 818, thousands of Andalusi refugees expelled from Córdoba by the Umayyads, followed by families from Kairouan. Fez became from its birth what it remains: a crucible where Berber, Arab, and Andalusi fused into Moroccan civilization.

The Andalusi quarter — Adwat al-Andalus — and the Qarawiyyin quarter — Adwat al-Qarawiyyin — took shape under his reign. The refugees brought crafts, law, and learning: the Fez that would produce the world's oldest university was seeded by the exiles Idris II sheltered. The imam built the first mosques, the first walls, the first markets; he organized the tribes into a functioning administration and extended Idrisid authority across northern Morocco.

Idris II died in 828, barely thirty-six, and was buried in Fez — his tomb in the heart of the old city remains a place of pilgrimage. His sons divided the realm, and the Idrisid state fragmented into principalities; the dynasty's direct power waned within a century. But the fragmentation hardly mattered beside the permanent achievement: Fez. Through Almoravid, Almohad, Marinid, and Alaouite centuries, Fez remained the fixed point — the city of the ulama, the madrasas, the tanneries, the Qarawiyyin — while capitals rose and fell around it. To found Fez was to found Morocco's continuity: whatever dynasty ruled, it ruled through Fez, and Fez remembered Idris.

The Idrisid mint at Fez struck some of the earliest Islamic coins of the Maghreb — silver dirhams bearing the shahada, tangible proof that the new state commanded an economy, not just an army. Idris II's urbanism was equally deliberate: the two banks of Fez were a political technology, housing Berber and Arab populations separately while the markets, mosques, and the ruler's palace between them forced daily mixing — difference managed by design, the Moroccan art of coexistence in embryo. The division of the realm among his sons after 828 is often told as failure, but it seeded something durable: the Idrisid principalities — Nekor, the Tlemcen emirate, the northern chiefdoms — carried sharifian legitimacy into every corner of the Maghreb, so that when the Almoravids rose two centuries later, they rose in a landscape the Idrisids had made sharifian. The dynasty's blood ran in the veins of later saints and scholars; the Alaouites themselves, arriving in the Tafilalt centuries later, claimed the same Hasanid line. Idris II died at thirty-six having founded a city that would outlive every empire of his age — a return on eleven years of rule that no conqueror's battlefield can match.

At a glance: 791–828 · Founder

Impact on civilization

Part of Morocco: The Long Empire — more than eight centuries of continuous Moroccan statehood, from the Idrisids to the reigning Alaouites.

Related in Universal Encyclopedia: The Wattasids · Idris I · Yusuf ibn Tashfin · Abd al-Mu'min
Sources:
  • The Cambridge History of Africa, vol. 2
  • Encyclopaedia of Islam: Idris II; Fas
  • Ibn Abi Zar, Rawd al-Qirtas
  • UNESCO — Medina of Fez
  • Jamil Abun-Nasr, A History of the Maghrib

Across the Bureau

How did Christianity conquer Rome?How did humans tame fire?How did Islam expand so fast?AE — Country ProfileAfghanistan — Country ProfileAlbania — Country ProfileHistory of AE — TimelineHistory of Afghanistan — Timeline