The Idrisid Imamate: From Ancient Morocco to the Ribāṭ Age

Long before Mawlāy Idrīs crossed the mountains into Walīlī (Volubilis), Morocco was already an ancient and self-conscious civilization. To the Greeks, it was the land of the Mauroi; to the Romans, it was Mauretania Tingitana, a kingdom whose rulers negotiated with emperors and whose cavalry rode in distant provinces from Britannia to Syria. The celebrated Juba II—scholar, geographer, and philosopher—reigned here with his queen Cleopatra Selene, daughter of Egypt’s last pharaoh. Their capital at Volubilis stood as one of the great cities of the Mediterranean world, where Roman administration, local Moorish culture, and Hellenistic learning blended into a uniquely Moroccan synthesis. Across the plains and coastal zones, cities like Sala, Tingis, and Tamuda flourished with commerce, agriculture, stone architecture, and maritime trade. Christianity spread early through these regions; bishops and monastic communities became part of the Moroccan landscape. Even the Canary Islands lay within Morocco’s maritime sphere, confirming that this was not a marginal land but a sovereign world with deep cultural roots.

When Islam arrived in the 1st/7th century, it encountered not a tribal vacuum but a society already formed by centuries of statehood, diplomacy, and spiritual traditions. Early Arab commanders, including ʿUqba ibn Nāfiʿ, met communities capable of political negotiation, conversion, and alliance. Islam settled into Moroccan life through teaching, kinship, and gradual integration rather than collapse or destruction. Yet Morocco did far more than adopt Islam; it became the western frontier of the Islamic world and one of its most decisive military actors. Under Ṭāriq ibn Ziyād, Moroccan forces crossed the strait that now bears his name, opening al-Andalus and transforming the history of Europe and the Mediterranean. The conquest of Iberia was not merely an Arab initiative; it was a Maghrebi-led movement, carried by the discipline, courage, and strategic genius of the Amazigh tribes. For the first time, Morocco’s ancient martial energies were directed onto a new civilizational horizon.

This world of cities, tribes, and Islamic expansion was shaken profoundly by the great Berber Revolt of the 2nd/8th century. The decisive confrontation, the Battle of al-Ashrāf, shattered the Umayyad army and severed the line that had once tied Damascus to the Maghrib and al-Andalus. From that moment, the western Islamic world became autonomous. Khārijite emirates—fierce, doctrinal, militarily trained—rose across Morocco. They wielded power, collected taxes, wrote law, and commanded armies, yet they lacked the one ingredient that could unite the land: prophetic legitimacy. The Umayyads could no longer impose authority; the Abbasids, distant and distrusted, held no moral claim over Morocco. The region stood at once strong and ungoverned, ancient and fractured, Islamic yet without a rightful Imām.

Thus, when Mawlāy Idrīs ibn ʿAbd Allāh, grandson of the Prophet ﷺ, survivor of Fakh, and bearer of the Ḥusaynī party described in Al-Ibrīz—the party that upholds the Muhammadan truth when kings betray it—arrived at Volubilis in 172/789, he did not enter chaos or emptiness. He entered a landscape waiting for a moral axis. In the East, the descendants of the Prophet ﷺ had been slaughtered at Karbalāʾ and persecuted at Fakh; but in the West, a people shaped by ancient sovereignty, Christian memory, and new Islamic ethics stood ready to receive a lineage that carried not merely political grievance but the residue of Prophetic authority.

From this point, the tone of history changes. Mawlāy Idrīs was not a fugitive seeking protection; he was the sole surviving standard-bearer of a stalled Islamic revolution, the Zaydi revolt that had tried to rescue the caliphate from tyranny and restore it to the House of Muḥammad ﷺ. His mission in the Maghrib cannot be reduced to a claim for justice or an escape from Abbasid violence. He embodied a messianic possibility, a continuation of the Prophetic project in a world where the East had collapsed under despotism.

In him converged several currents: the Qurashī ancestry that made him heir to the Muhammadan kingdom; the Zaydi ethos that demanded a ruler act or fall; the Ḥusaynī spirit that saw martyrdom as a political testimony; and the Maghribi longing for a unifying, legitimate imam. He arrived not as a stranger but as the culmination of a Prophetic horizon migrating westward. In the meeting between Mawlāy Idrīs and the Awraba chieftains, Morocco’s ancient kingdoms met the surviving remnant of the Prophet’s ﷺ household. The imamate did not begin in Morocco with a refugee; it began with the Muhammadan trust relocating itself to the one land still capable of receiving it.

This is the moment when Morocco ceased being only an ancient country and became—through Mawlāy Idrīs—the custodian of Prophetic legitimacy, the western sanctuary of the Muhammadan line, and the horizon from which many believed the future renewal of Islam would one day rise.

I. The Eastern Lineage of Revolt: From Medina to Fakh

The story of Mawlāy Idrīs ibn ʿAbd Allāh does not begin at Walīlī, nor even with the Abbasid persecution that forced him westward. Its roots lie in Medina, where the earliest fissures of Islamic political life produced a distinct moral tradition within the House of the Prophet ﷺ. This tradition—shaped not by sectarian ideology but by a relentless commitment to justice, transparency, and ethical governance—formed a lineage of principled defiance extending from the first generation of Ahl al-Bayt to the upheavals of the second Islamic century.

After Karbalāʾ, the descendants of Imām al-Ḥasan al-Sibṭ ibn ʿAlī ibn Abī Ṭālib (d. 50/670) emerged in Medina as a quiet but persistent alternative to imperial models of rule. Their patriarch, ʿAbd Allāh al-Kāmil ibn al-Ḥasan al-Ridā (d. 145/762), embodied piety, restraint, and open critique of Umayyad excess. His household preserved a vision of leadership grounded not in conquest but in the moral constitution of Qurʾānic rule. This atmosphere produced a series of ethical revolts, whose aims were not doctrinal separation but restoration of legitimacy. Zayd ibn ʿAlī al-Sajjād (d. 122/740)—great-grandson of Imām al-Ḥusayn ibn ʿAlī (d. 61/680)—initiated the clearest expression of this ethos. His uprising in Kūfa articulated what became the Zaydi imprint: resistance to injustice, insistence on accountability, and the refusal to sanction rulers whose authority contradicted Qur’ānic ethics. Although later Zaydism took on theological contours, Imām Zayd himself fought on ethical grounds, not sectarian ones.

His martyrdom generated successors. Yaḥyā ibn Zayd fell in Khurasan in 125/743. The uprising of al-Nafs al-Zakiyya in Medina signaled the widespread conviction that the caliphate required a leader of prophetic descent to restore justice. Meanwhile, Abbasid promises of supporting Ahl al-Bayt dissolved once they gained power in 132/750. Medina became a monitored zone, and the Hasanids realized that the new dynasty intended not partnership but containment. The House of ʿAbd Allāh al-Kāmil became a symbolic conscience for the Ummah, representing the ethical horizon of the prophetic family in contrast to the increasingly rigid structures of caliphal politics.

Into this genealogy was born Idrīs ibn ʿAbd Allāh, a great-grandson of al-Ḥasan whose political instinct was shaped by the living memory of the Prophet ﷺ and by the intellectual climate of Medina, where Ahl al-Bayt were regarded as the “living essence of knowledge,” to borrow Imam ʿAlī’s terminology. In sermons attributed to him, ʿAlī defines his family as the loci of divine knowledge, the pillars of Islam, the custodians of revelation, and the gates through which the faith must be approached. Such statements were not metaphysical claims; they articulated a political principle: legitimacy and justice were inseparable from the moral authority of the Prophet’s household. Zayd expressed the same ideal in verse, describing Ahl al-Bayt as “the lights before creation” and “the axis of truth.” Idrīs inherited this worldview not as an ideological program but as the natural horizon of a family that had long been treated as the conscience of the Muslim community.

This lineage reached its tragic apex in the massacre of Fakh in 169/786, often called “the second Karbalāʾ.” When al-Ḥusayn ibn ʿAlī al-Ḥasanī rose against Abbasid tyranny near Mecca, he represented the cumulative grievances of decades. The revolt was quickly crushed; the aftermath was brutal. Bodies were left exposed; families terrorized; heads sent to Baghdad. Early Islamic memory treated the event as seismic. Reports circulated that the Prophet ﷺ had foretold a righteous descendant who would be slain at Fakh and whose martyrdom would be doubly rewarded. The moral trauma of the valley near Mecca, where Companions had once walked, became emblematic of Abbasid collapse of legitimacy. Mawlāy Idrīs escaped the battlefield with his brother Yaḥyā, carrying wounds and the certainty that the East could no longer shelter Ahl al-Bayt.

Yet his departure was not merely flight. Yaḥyā is reported to have said to him: “We have a banner that will rise in the West at the end of time. God will manifest the truth through its people. Perhaps it will be you—or a man from your descendants.” This statement—preserved in al-Rāzī’s Akhbār Fakh—and echoed in Moroccan collective memory, reframes Idrīs’s journey as the continuation of a prophetic trajectory rather than the relocation of a defeated partisan.

Two further traditions reinforced this logic. One, preserved by al-Ifrānī and cited from al-Jumān, recounts a prophetic assurance to Lalla Fāṭima al-Zahrā’ that the Berbers would become the helpers of her descendants—the ḥawārīyūn of Ahl al-Bayt—and that when the children of al-Ḥasan and al-Ḥusayn scattered after oppression, only the Berbers would shelter them. The second is the well-known ḥadīth in Muslim: “The people of the West will remain visibly upon the truth until the Hour is established.”
While its exact scope is debated, Maghribi scholars long interpreted it as a spiritual confirmation of the Western role in preserving the integrity of the faith.

By the time Mawlāy Idrīs left Egypt, these strands—Zaydi ethics, Hasanid legitimacy, prophetic foresight, and Maghribi expectation—had begun to converge. He was not only a political survivor; he was the last unbroken thread of a moral tradition that refused to separate governance from righteousness. He carried the heritage of Medina’s ethical protests, the memory of the Prophet ﷺ, the teaching of Imam ʿAlī about the indispensability of Ahl al-Bayt for the Ummah’s guidance, and the Zaydi insistence that an imam must rise against tyranny whenever conditions allowed.

Thus, when Mawlāy Idrīs reached the borders of Morocco, he arrived not as a wanderer seeking refuge but as the embodiment of a lineage that had exhausted the East and now moved toward a new horizon. The Maghrib—after the Moorish Revolt, the collapse of Umayyad authority, and the fragmentation that followed the decisive battlefield of al-Ashrāf—was a land rich in sovereignty but lacking a legitimate axis. In this fractured political landscape, the appearance of a grandson of the Prophet ﷺ was not an accident of geography but the meeting point of prophecy, history, and necessity. The Western imamate began not in a tribal council at Walīlī, but in Medina generations earlier, and Idrīs’s arrival in the Maghrib represented its rightful continuation in a land destined, as many believed, to uphold the truth until the end of days.

2. The Maghrib Before Mawlāy Idrīs

When Mawlāy Idrīs entered the western lands, he encountered a Maghrib already deeply Islamized yet politically fragmented—a condition born directly from the Battle of al-Ashrāf (129/746). In that confrontation, Berber armies destroyed the Umayyad force led by Kulthūm ibn ʿIyāḍ al-Qushayrī, bringing to an end the last serious attempt to restore eastern military authority across the far West. The defeat was not merely tactical; it ended Umayyad military sovereignty in the Maghrib and broke the administrative chain linking Damascus to Ifrīqiya and al-Andalus.

From this moment emerged a series of minor political formations, unified less by shared purpose than by a common refusal of Qurashī authority. The Barghwāṭa confederation (127/744), on the Atlantic plains, founded by Ṣāliḥ ibn Ṭarīf, amounted to a sealed micro-order—doctrinally eccentric, inward-looking, and incapable of regional political integration beyond its immediate territory. In the Rif, the polity of Nakūr (91/709), established by Ṣāliḥ ibn Manṣūr, remained a narrow coastal enclave, sustained by local alliances and maritime traffic, without the means or vision to shape the Maghrib at large. In the far southeast, Sigilmāsa, founded by Samgū ibn Wāsūl under Ṣufrī Kharijite leadership (140/757), functioned as a commercial outpost rather than a state—wealthy through transit, yet structurally incapable of political integration. To the east, the Rustamid polity of Tahert (160/776), founded by ʿAbd al-Raḥmān ibn Rustam, governed a clerical island: morally rigorous, territorially thin, and deliberately limited in ambition.

Beneath these political structures ran a deeper intellectual current shaped by the ethical revolts later articulated within the Muʿtazilite-inflected movements of Imām Zayd, his brother Ibrāhīm (145/76), and Muḥammad al-Nafs al-Zakiyya (145/76). Their uprisings formulated an ethical grammar that took firm root in North Africa: rule is conditional upon justice, authority is accountable, and resistance becomes legitimate once divine equity is violated. This posture—ethical rather than sectarian—found a natural home in the leadership of Abū Layla Isḥāq b. Muḥammad b. ʿAbd al-Ḥamīd, chief of the Awraba, the most powerful branch of the Masmuda.

Long before the Idrīsid settlement, the Awraba had already translated this grammar into action. During the first Islamic openings in Ifrīqiya, they stood at the center of organized resistance, most notably under Kusaila (d. 63/683), whose leadership exposed the limits of Umayyad expansion and imposed heavy costs on commanders such as ʿUqba b. Nāfiʿ. The contrast was stark: while Syria, Iraq, Egypt and Persia entered Islam within a single generation, the Maghrib resisted for nearly seventy years. Yet once this long cycle of coercive expansion collapsed—after the fall of al-Kāhina—the entry into Morocco itself unfolded with minimal resistance, signaling not submission, but a shift toward negotiated legitimacy.

Crucially, unlike the Khārijites who categorically rejected Qurashī leadership, the Awraba maintained an important nuance: they acknowledged that a descendant of the Prophet ﷺ could rightfully rule, provided he embodied justice and moral courage. This predisposition made them uniquely prepared to recognize in Mawlāy Idrīs not a foreign claimant but the very figure whose lineage and biography fulfilled their highest expectations of leadership.

Yet the Maghrib before Mawlāy Idrīs cannot be understood without the parallel transformation taking place across the strait. The establishment of the second Umayyad emirate in Córdoba—often described as Andalusian—was, in its origins, a profoundly Moroccan event. Its founder, ʿAbd al-Raḥmān ibn Muʿāwiya (d. 172/788), the only surviving Umayyad prince, reached safety not in Iberia but in Nakūr, where the Zanāta sheltered him. His mother’s Moorish lineage opened doors no Arab ally could provide, and it was Zanāta cavalry who accompanied him into Andalusia, helped him negotiate alliances, and enabled him to seize Granada and Seveilla. The Umayyad restoration in al-Andalus was therefore not an exilic project from the East but a Berber reconstruction, facilitated—and in many respects engineered—by Moroccan tribes.

This Moroccan presence extended into religious and revolutionary movements as well. The first Shiʿi uprising in the West, led by Muḥammad ibn ʿAbd Allāh al-Miknāsī (fl. 172/789), a native of Miknāsa (a major Berber confederation, preserved toponymically in the name Meknès), ignited a twenty-year rebellion against ʿAbd al-Raḥmān I in al-Andalus. His revolt drew on the same Zaydi ideals that animated Eastern uprisings, further illustrating how Moroccan intellectual and political currents shaped the western Islamic world. It was again the collaboration of Umayyads and their Zanāta uncles that ultimately suppressed this revolution—an early demonstration of the enduring Moroccan imprint on Andalusian affairs.

Taken together, these developments reveal a West that was never peripheral and never derivative. Long before Rome, Carthage had already turned the western Mediterranean into an African sphere, and from that world Hannibal (d. 183 BCE) carried war through Iberia and into Italy itself. Long before Islam, and long after Rome, Morocco pressed itself into Iberia as force, movement, and command. This was already visible in the Roman age through the Mauroi cavalry, most starkly embodied in the Mauretanian general Lusius Quietus (Kitos). Entrusted by Trajan with the suppression of the great Jewish uprisings of 115–117, Quietus led mobile North African forces across Cyrenaica, Egypt, Cyprus, and Mesopotamia, crushing revolts that threatened Rome’s eastern arteries. The very naming of the conflict as the Kitos War inscribes a Moroccan commander into imperial memory, revealing how Maghribi military power was projected far beyond the western Mediterranean.

Lusius Quietus Commanding the Moorish Cavalry, a Cast Taken from Trajan's Column, AD 110-113

Lusius Quietus Commanding the Moorish Cavalry, a Cast Taken from Trajan's Column, AD 110-113

Ṭārif ibn Mālik (fl. 91/710), whose name endures in Tarifa, opened the passage as reconnaissance and declaration. He was soon followed by Ṭāriq ibn Ziyād (d. 101/720), whose name came to command the strait itself—Gibraltar—turning a stretch of water into a governed threshold, aided by Julian of Sabta, a Ghumāra Moroccan whose authority was rooted in that corridor. What followed was not improvisation but the opening (al-Futūḥāt) of al-Andalus, conducted within the framework of an Arab-Islamic civilizational project, articulated in Arabic, legitimated by Qurʾānic authority, and led in the name of the Umayyad polity, yet carried on the ground by large-scale Amazigh participation, including sustained Moroccan migration that settled, defended, and administered the peninsula. Along the axis binding Tingis to Baetica, Arab leadership and Maghribi force together shaped conquest, access, and early governance, confirming that al-Andalus emerged as a western extension of Islam, articulated in Arabic, yet materially and structurally formed as a northern extension of the Moroccan world.

It was into this world—politically fragmented yet intellectually primed, religiously alive yet lacking a single moral center—that Mawlāy Idrīs arrived after surviving the massacre of Fakh. The Maghrib did not wait for him to become Muslim; it waited for him to become unified. The ethical legacy of Imām Zayd, the rational discourse of the Muʿtazila, the political maturity of the Awraba, the dynastic memory carried by Zanāta, and the Moroccan–Andalusian axis forged by centuries of shared history all converged to produce a singular moment of recognition. When the Awraba extended their bayʿa in 172/789, they did not pledge allegiance to a stranger but to the long-awaited moral axis capable of transforming competing experiments into a Western Imamate rooted in prophetic descent and attuned to the realities of the far West.

With Mawlāy Idrīs, the Maghrib ceased to be a landscape of parallel polities and became instead a single civilizational project, one that would define Moroccan identity for more than a millennium.

3. Mawlāy Idrīs I: The Western Imamate Begins

Mawlāy Idrīs did not enter the Maghrib al-Aqṣā (roughly modern Morocco and western Algeria) as a claimant negotiating his place among tribes; he entered it as a fact that reorganised the horizon of power. His presence did not ask whether authority was available in the Maghrib—it exposed that authority had been missing its rightful center since the Battle of al-Ashrāf severed the East from the West. The Umayyad sword had shattered on Moorish resistance, the Abbasid claim had never crossed the desert with conviction, and what remained across the Maghrib was force without legitimacy and doctrine without gravity. Into this landscape came a man whose lineage did not require explanation, whose silence carried more weight than proclamations, and whose very survival after Fakh announced that the prophetic household had not been extinguished but displaced. From the moment Mawlāy Idrīs stood in Walīli, the question was no longer whether Morocco could be ruled, but whether Baghdad and Cordoba could tolerate a rival center grounded in the blood of the Prophet ﷺ.

The claim Mawlāy Idrīs embodied was not local. It was not tribal. It was not improvisational. It was caliphal in scope, even when it avoided the vocabulary of empire. His khuṭba did not circulate as a pious sermon but as a declaration of moral sovereignty. His letters to the scholars of Egypt were not appeals for endorsement; they were notices that the West had entered the circle of legitimate command without Abbasid mediation. The Abbasids understood this immediately. They did not hear in his words a dissident voice but a rival grammar of rule—one that drew its authority directly from the House of the Prophet ﷺ and therefore rendered dynastic succession, court theology, and coerced consensus structurally obsolete. What Baghdad sensed was not rebellion but replacement.

Cordoba sensed it too. The second Umayyad state, often misread as an Andalusian miracle, was in truth a Moroccan creation from its first breath. ʿAbd al-Raḥmān al-Dākhil survived because Zanāta blood protected him, because Nakkūr sheltered him, because Berber arms escorted him across the strait and seated him in al-Andalus. The Umayyad restoration was Maghribi in muscle even as it draped itself in Syrian memory. Yet the Umayyads ruled by survival, not legitimacy. Their authority rested on endurance after catastrophe, not on prophetic inheritance. Mawlāy Idrīs therefore did not merely challenge Cordoba politically; he eclipsed it symbolically. Fez (Fās) did not need to outmatch Cordoba in splendor to threaten it. It threatened Cordoba by existing as a city whose ruler did not descend from conquerors but from the Messenger ﷺ himself.

Morocco under the Idrissids: Mints, Towns, and Silver Infrastructure (2nd–3rd c. AH / 8th–9th c. CE)

The choice of Fez was neither incidental nor aesthetic. Mawlāy Idrīs read the land with the eye of a statesman, not a mystic. He chose a site bound by rivers, fed by springs, protected by mountains, and open to trade routes that braided the Sahara, the Atlantic, and the Mediterranean into a single economic field. Wādī al-Jawāhir—the River of Gems—was not a poetic name; it was an inventory of power. Water meant mills, mills meant grain, grain meant silver, silver meant sovereignty. Thousands of wheels turned day and night, grinding wheat into currency long before coins bore inscriptions. Fez rose not as a palace city but as a hydraulic engine whose labor fed authority upward. This was not an imitation of Baghdad’s ceremonial excess nor Cordoba’s courtly refinement. It was something older and more dangerous: a city whose wealth was structural, not performative.

From this abundance emerged the Idrīsid dirham, and with it a declaration that Morocco had entered history as a monetary sovereign. Coinage is never neutral. To mint is to rule, and to circulate is to convince. Mawlay Idrīs struck silver dirhams and copper fulūs immediately upon his proclamation as imām in 172/788–789, a practice continued by his successors, signaling that authority in the Maghrib would be articulated not only through bayʿa and khuṭba (the sovereign prerogative by which a ruler’s name is proclaimed during the Friday congregational sermon), but through metal, weight, and inscription.

The early Idrīsid dirhams largely followed Abbasid numismatic conventions, yet their distinctions were deliberate and principled. Beneath the name of Idrīs appeared the name of ʿAlī, affirming lineage to the Household of the Prophet ﷺ within the medium of currency itself. More decisively, the coinage replaced the prevailing Abbasid formula with the Qurʾānic proclamation of truth, Qurʾān 17:81 (“The truth has come, and falsehood has perished”), explicitly attributed to Mawlay Idrīs. This verse bore a known association with the cause of Ahl al-Bayt, having appeared earlier on coinage issued during the uprisings of al-Nafs al-Zakiyya in Medina, Ibrāhīm in Baṣra, and Yaḥyā in Ṭabaristān. Struck in Fez, its reappearance signaled the establishment of authority grounded in truth and justice, and situated the Idrīsid mint within a continuous Hasanid tradition while standing apart from Abbasid command.

The Idrīsid dirham thus did not merely facilitate exchange; it carried allegiance. Its inscriptions announced wilāya as much as weight. In a world where the Abbasids had weaponized sovereign theologization and the Umayyads authoritarian solidarism, the Idrīsids fused economy and Prophetic wilāya into a single act of governance. Silver from the mountains, and grain from the plains passed through Fez and returned stamped with an authority that did not require Baghdad’s blessing.

Markets followed. So did people. Fez became a magnet for those fleeing the violence of collapsing orders: Andalusi families escaping Umayyad purges, scholars displaced by Abbasid suspicion, merchants seeking stability beyond Khārijite volatility. Refuge did not weaken the city; it multiplied it. New quarters formed, trades specialized, alliances crystallized. Zawāgha, the indigenous population, did not vanish; they anchored the city’s continuity. Arab tribes did not erase Amazigh structures; they fused with them. What emerged was not a transplanted society but a Fāsi one—disciplined by law, energized by trade, and bound by allegiance to an imamate that felt neither foreign nor imposed.

This allegiance was enacted weekly. Mawlāy Idrīs understood the mosque as an instrument of state. Masjid al-Ashyākh was not merely a place of prayer; it was Morocco’s first parliament, court, and broadcasting tower. From its minbar flowed the khuṭba that named authority, articulated policy, and reminded the population that justice was not abstract but administered. Here disputes were resolved, oaths sworn, commands issued. The mosque replaced the palace because the imamate did not require theatrical separation from the governed. Authority resided where the community gathered, not behind walls.

Silver dirham issued under Idrīs I, struck at Tudgha in 174/792, modeled on Abbasid coinage but uniquely inscribed with the name ʿAlī ibn Abī Ṭālib, asserting Idrīsī sharīfian legitimacy through lineage and coinage.

From Fez, Mawlāy Idrīs moved outward with deliberate speed. Aghmāt was secured to anchor the south. Barghawāṭa, whose heterodoxy threatened the Qurʾanic order itself, was weakened and contained, not glorified as an exotic anomaly. Sigilmāsa, guardian of the Saharan gold routes, was brought into the Idrissid orbit, tying the economy of West Africa to the sovereignty of Fez. Each campaign followed the same pattern: force when necessary, incorporation when possible, reorganization always. Territories were not looted; they were integrated. Resistance did not invite annihilation; it invited restructuring.

Throughout this expansion, Mawlāy Idrīs did not impose Mālikism, nor did he seek to reconcile his project with Abbasid jurisprudence. The ethical core of his rule remained Zaydī–Hasanid: justice as obligation, resistance to tyranny as duty, wilāya as axis. Mālikism would later enter al-Andalus as a political tool after Umayyad legitimacy eroded, but in Mawlāy Idrīs’s Morocco it held no founding role. To suggest otherwise is to mistake later apologetics for original intent. Tolerance is not adoption, and accommodation is not allegiance.

The ideological geography of the West shifted accordingly. Tanga (Tangier) emerged as a Shiʿi hub, as Abū al-Ḥasan al-Ashʿarī (d. 324/935) himself observed in Maqālāt al-Islāmiyyīn—not because Morocco had become doctrinally sectarian, but because wilāya had found land. Fez functioned as a new Kūfa, not in imitation but in structure: a city where allegiance, politics, and theology converged in lived space. khuṭbas were not sermons but mobilizations. Coins were not metal but messages. Marriage itself became policy when Mawlāy Idrīs wed Kanza, binding the imamate to Amazigh power and ensuring that succession would not fracture along tribal lines. The state acquired heredity without forfeiting legitimacy.

Baghdad watched all of this with mounting alarm. What frightened the Abbasids was not Mawlāy Idrīs’s rhetoric but his success. The West was no longer a distant frontier; it was becoming a rival center with its own economy, army, ideology, and prophetic claim. The path toward Ifriqiya lay open. Beyond it, Egypt. The logic was unbearable. Thus poison replaced debate, and infiltration replaced confrontation. The betrayal of al-Shammākh, a Zaydī who sold principle for proximity, was not an anomaly but a method perfected by the Abbasids against Ahl al-Bayt. Mawlāy Idrīs was murdered not because he failed, but because he was about to succeed too completely.

Yet the assassination misfired. The state did not collapse. Rāshid held administration steady. Tribes did not scatter; they consolidated. Most tellingly, the unborn child in Kanza’s womb was acknowledged as ruler before drawing breath. A crown placed on a pregnant woman is not symbolism; it is constitutional clarity. It declared that the Idrissid project was no longer charismatic but institutional, no longer contingent on a single life but embedded in Morocco itself.

By the time Mawlāy Idrīs was buried in Walīli (modern Zarhūn), Morocco was no longer a periphery awaiting direction. It was a center that had learned to govern itself with prophetic legitimacy, economic intelligence, and territorial command. Fez stood not as an experiment but as a challenge—to Baghdad’s theology, to Cordoba’s dynasty, and to history’s assumption that the West merely receives what the East produces. What Mawlāy Idrīs founded was not a dynasty alone, but a new axis of Islam, anchored in baraka, sustained by labor, defended by geography, and announced to the world in silver.

4. Mawlāy Idrīs II: The Imām Who Never Saw the East

Do not bow to any authority but ours, for the Kingdom of God (imāmat al-Ḥaqq) you seek is not attainable—except through us.
— From the first khuṭba of Mawlāy Idrīs II, 188/804.

This was not a slogan uttered in defiance. It was a declaration of existence. When Mawlāy Idrīs II would later pronounce these words in his first khuṭba in 188/804, they did not echo rebellion — they announced arrival. The far West was no longer waiting for recognition; it spoke as origin. What rendered this declaration intolerable to Baghdad and its Aghlabid vassals in Ifrīqiya, as well as to the Umayyad emirate across the straits in al-Andalus, was not its audacity but its timing: it was uttered by an imām who had never seen the East, owed it nothing, and embodied a form of legitimacy that lay beyond negotiation or containment.

That legitimacy began before his birth. When Mawlāy Idrīs I was assassinated by Abbasid poison in 177/793, the Idrissid state did not collapse into panic. It froze. Morocco held its breath. The tribes did not scatter. The bayʿa was not revoked. Authority did not revert to confederations. Instead, the land waited — not metaphorically, but politically — for what lay in the womb of Kanza bint Ishāq.

For two months, Morocco existed in suspension. Was the child a boy or a girl? Was the lineage to continue, or was the Idrissid project to be remembered as a brief flare extinguished before maturity? This was not private curiosity; it was a matter of state. Amazigh leaders, elders of Awraba, Sanhāja, Hawwāra, and Zanāta, watched the pregnancy as one watches a frontier battle. The fate of a sovereign Islamic order hinged on birth.

When the child was born male, the reaction was immediate and decisive. This was not merely relief — it was recognition. The tribes did not say “a son has been born.” They said: Idris has returned. They named him Idris. Not as memory. As continuity.

Calling him Idris was not sentimental homage to a murdered father. It was a political act. It declared that the imamate had not been interrupted, only concealed. That assassination had failed. That Abbasid poison had not broken the chain. The name Idris became a statement: legitimacy survives death.

Around the infant formed a triangle of guardianship that would shape the most Moroccan imām in Islamic history.

Kanza, his mother, was not a passive vessel of lineage. She was Amazigh nobility, Idrissid by marriage, Awraba by blood, and Moroccan by instinct. Through her, the child belonged not only to the Prophet’s House but to the land itself. Her pregnancy was guarded as a trust. Her son was raised not as a foreign prince but as the child of the tribes. In her care, the imamate learned intimacy.

Isḥāq (d. 192/808), his grandfather, was not merely a political elder. He represented the continuity of Amazigh authority that had chosen Idriss I not out of fear but out of expectation. His presence ensured that the state did not drift back into tribal fragmentation during the child’s minority. He was the anchor of experience, the guarantor that governance would not be suspended while lineage matured.

And then there was Rāshid (fl. 188/804). He was not a regent in the classical sense, but the memory of the father walking beside the son. He carried the political intelligence of Mawlay Idrīs I—the grammar of alliances, the discernment of enemies, the cartography of loyalties—and transmitted it without suspending the labor of rule. He raised the child not as a sheltered heir, but as an imām to be forged, even as the state continued to extend its reach under his hand. Education was relentless: Qurʾān before play, language before leisure, history before ornament. Horsemanship, archery, and strategy were taught not as aristocratic pursuits, but as instruments of survival, imparted alongside an active governance that did not preclude, and indeed quietly prepared for, expansion beyond Morocco toward Ifrīqiya.

By the age of seven, the child had memorised the Qurʾān. By eleven, he had absorbed not only law and language, but the psychology of power. He knew who had betrayed his father. He knew which tribes hesitated. He knew why Baghdad feared Morocco. Nothing was hidden from him. When the bayʿa was finally taken for Mawlāy Idrīs II in the mosque of Zarhūn, it was not a symbolic oath to a boy. It was a renewal of a decision already made years earlier: Morocco would not return to the East.

From that moment, the Idrissid project stopped breathing quietly and began to speak aloud. If Mawlay Idrīs I ruled with restraint and geometry, his son ruled with sound—with a voice meant to travel, collide, and refuse containment. This was not noise as chaos, but noise as sovereign disturbance. Mawlay Idrīs II did not limit himself to pious letters of daʿwa dispatched toward Egypt or the Ḥijāz; he practiced diplomacy as proclamation. Envoys moved. Titles circulated. Names were spoken where they were not supposed to be heard.

The khuṭba became his instrument. Not a sermon, but a weekly act of domination. Each Friday, his name rose from pulpits as a reminder that the assassination had failed twice—first in poison, then in attempted oblivion. He claimed Amīr al-Muʾminīn, the title still borne by the Moroccan monarch, not as ornament but as acoustics: a name designed to echo across seas and chancelleries.

And it did. In 198/813, Pope Leo III informed Charlemagne that the patrician Gregory of Sicily had received a Muslim envoy sent by the amiralmumin of Africa—a mangled Latin ear catching what Baghdad feared most: the West speaking in the first person. This was not rumor; it was recognition forced by presence.

Even the coinage shouted. At Tahlīṭ, in 197/812–813, a singular coin was struck declaring: “Muḥammad is the Messenger of God and the Mahdī is Idrīs b. Idrīs.” Not merely a ruler, but al-Mahdī—a name loaded, dangerous, and deliberate, inherited from the vocabulary of the Ahl al-Bayt and the blood of al-Nafs al-Zakiyya. Metal, sermon, embassy: three registers of the same voice.

This was the signal Baghdad could not suppress: a western polity that did not wait for formal recognition but embedded itself directly into the monetary circuits of the age. Idrissid dirhams entered exchange networks spanning the Carolingian world, the Scandinavian trading sphere, and the Byzantine Mediterranean, before circulating in greater density through the Khazar Khaganate and other steppe polities, and more centrally within Abbasid accumulation zones across the eastern caliphate.

Yet silver was only the visible layer. Ibn al-Abbār reports in al-Ḥulla that Mawlay Idrīs II minted gold dīnār—a direct challenge to caliphal monopoly, for gold coinage was restricted to the great powers: Byzantium and Baghdad alone. The Aghlabid governor Ziyādat Allāh (223/838) sent al-Maʾmūn al-ʿAbbāsī a sum of 1,000 dīnār struck in the name of Idrīs al-Ḥasanī—not as tribute but as evidence. The message was clear: a descendant of the Prophet ﷺ was minting gold independently in the far West. This was not a provincial emirate. It was a rival caliphate.

This imām had no memory of Mecca or Medina, yet he carried them in lineage. He had never seen the East, yet the East trembled at his name. He was not a refugee; he was a native sovereign. Not a survivor; a beginning. Morocco did not merely accept him. It embraced him as its own creation.

This is why Mawlāy Idrīs II feels closer than his father. Why his tomb is warmer in the popular imagination. Why Fez carries his imprint more deeply. He was not the man who arrived — he was the man who grew. And with him, Morocco stopped being a destination for legitimacy and became its source.

5. The Two Cities, The Two Imams

Between 172 and 176 (788–793), Mawlay Idrīs I carved Fez into existence on the right bank of Wādī al-Jawāhir. He negotiated with the Banū Yazghitān, purchased their forested land, laid foundations, raised walls, built Masjid al-Ashyākh, and struck the first Idrīsid dirhams. He did this while consolidating tribal alliances, expanding eastward toward Tlemcen, and fending off Aghlabid hostility from Ifrīqiya. Fez was not leisurely conceived—it was built under pressure, by a Hachimite imām who understood that survival required more than bayʿa and baraka. It required place: a city that could mint coins, grind grain, house armies, and anchor loyalty when words alone failed. Then in 177/793, Abbasid poison ended him.

Plan of early medieval Volubilis (Walili, Zerhoune), highlighting the location of the Idrīsī palace complex

Plan of early medieval Volubilis, highlighting the location of the Idrīsī palace complex, after Corisande Fenwick and the INSAP–UCL Volubilis Archaeological Project, emphasizing the spatial anchoring of Idrīsī authority within the former Moorih city.

For sixteen years, Fez stood as his monument and his widow's trust. Kanza bint Ishāq carried the state in her womb, then in her arms, then in her counsel as Rāshid trained the boy who bore his father's name but had never seen his father's face. Idrīs II grew up inside the architecture his father had left behind—walked the streets his father had planned, prayed in the mosque his father had built, watched the river turn the wheels his father had set in motion. He learned statecraft not from theory but from inheritance made visible. Every wall in Fez was a lesson. Every mill was a command.

By 188/803, when the bayʿa was formally renewed for him in the mosque of Zarhūn, Mawlay Idrīs II was no longer a boy. He was eleven, but eleven in a world where survival required precocity, where assassination was policy, and where hesitation invited predators. By the time Rāshid himself was assassinated—another Abbasid agent, another mawlā bought with promises—Idrīs II was alone, but he was ready. Four years later, in Rabīʿ al-Awwal 192 (January 808), he crossed the river his father had named Wādī al-Jawāhir and began building on the opposite bank. This was not expansion. It was declaration.

Fez, built by Idrīs I, was the city of arrival. It announced that the West could shelter a sharīf, that prophetic lineage could take root outside the Hijaz, that an imamate did not require Abbasid permission to exist. It was defiant in its existence but cautious in its ambition. Idrīs I built walls thick enough to withstand siege, a mosque large enough to gather the faithful, a mint capable of striking currency, and a network of mills to convert water into bread. He built what a refugee builds when he knows enemies are watching: a city designed to survive.

Al-ʿĀliyya, built by Idrīs II in 192, was the city of ascendancy. It announced that survival was no longer the question—sovereignty was. The name itself—al-ʿĀliyya, "the Most High"—was not topography alone (though the western bank did rise slightly above the eastern). It was theology compressed into syllables. It echoed ʿAlī ibn Abī Ṭālib, gate of prophetic knowledge and ancestor of the line. It proclaimed elevation—moral, spiritual, political. Where Fez had asked "Can we endure?", al-ʿĀliyya answered "We have already won."

The duality was architectural and constitutional. Two cities facing each other across a river, each with its own walls, gates, mosque, qaysariyya, mint, and markets. But they were not twins—they were stages. Fez was the foundation laid by a father who had fled Fakh with wounds still fresh, who remembered the taste of Abbasid betrayal, who built knowing that survival was negotiation with geography, tribes, and time. Al-ʿĀliyya was the elevation built by a son who had never seen the East, who owed it nothing, who inherited his father's caution but refused his father's limits. This is the difference: Idrīs I built to anchor. Idrīs II built to announce.

When Mawlay Idrīs II purchased the land of the Banū al-Khayr al-Zuwāghiyyūn for 3,500 dirhams—a thousand more than his father had paid for the eastern bank—he was not merely acquiring real estate. He was relocating sovereignty. He did not add to Fez; he built beside it, above it, in answer to it. He established his residence at Dār al-Qayṭūn, a name that would remain tied to Idrīsid memory for centuries. Adjacent to it, he built Masjid al-Shurafāʾ—the Mosque of the Sharifs—where he would lead prayers, deliver khuṭbas, administer justice, and eventually be buried.

This mosque was bigger than Masjid al-Ashyākh across the river. It was more central to the commercial traffic of the city, and it carried something his father's mosque could not: presence. It was the place where the living imām governed, not the place where a martyred father was remembered. It was the site where allegiance was renewed weekly, where law was announced, where the baraka of the Ahl al-Bayt was not a historical claim but a fact, visible, tangible, seated on a minbar and speaking in a voice the gathered could hear.

From the height of al-ʿĀliyya, Idrīs II could see both cities: his father's Fez to the east, his own creation to the west, and between them the river threading both into a single economic organism. What began as a few installations along the water soon expanded; by the early 3rd/9th century, numerous workshops operated on its banks, and in later periods the number grew dramatically. The steady flow powered mechanisms that processed grain and sustained urban growth. As inhabitants multiplied, fiscal revenues increased, enabling military organisation and, eventually, the consolidation of territorial authority. This was the infrastructural vision set in motion by Idrīs I and systematically developed by his son. Together, the paired settlements evolved into an integrated economic system driven by the river’s regulated energy.

The chroniclers debated endlessly the origin of the name "Fez." Some said it came from faʾs, the great golden axe discovered when digging foundations—so large it seemed mythic, a tool from an earlier age when giants worked stone. Others said it inverted Sāf, an ancient name whispered by a Christian monk who saw Idrīs I surveying the land and foretold a city that would outlive empires. Others still claimed it honored a Persian contingent killed in a landslide during construction, or a stuttering man who dropped the rāʾ from Fāris and gave the city its name by accident.

The variety of explanations is itself the answer. "Fez" became a name that absorbed every origin story because the city absorbed every population. But beneath the legends, the meaning was never obscure. Faʾs is the blade—the tool that cuts earth, that splits stone, that makes wilderness into field. It is the instrument of transformation, the force that turns nature into order. To name a city "Fez" was to name it conquest over landscape, to declare that this place would not remain forest and spring but would become polis, shaped by human will and prophetic purpose.

And "al-ʿĀliyya"—the Most High—was the hand that raised the blade.

The maps depicts Idrissid Fez as a deliberately divided twin city, separated by Wādī al-Jawāhir,

The maps depicts Idrissid Fez as a deliberately divided twin city, separated by Wādī al-Jawāhir, and records the traditional names of the gates of both the eastern city of Idrīs I and the western al-ʿĀliyya of Idrīs II, reflecting their parallel urban structures and identities

Together, the two names formed a single statement: Fez cuts, al-ʿĀliyya commands. One was force applied to earth; the other was authority applied to history. One was the labor of the father; the other was the voice of the son.

What unfolds after the founding of al-ʿĀliyya is not urban expansion but the strategic ignition of a metropolis destined to shoulder a sacred and enduring mandate—precisely what al-Qayrawān in Ifrīqiya, for all its administrative stature, never achieved. Under the Umayyads and later the Abbasids through their Aghlabid governors from Khurasan, al-Qayrawān served as a fortified checkpoint, a station for imperial oversight rather than a holy capital with its own radiating authority. Its purpose was surveillance, not sanctification; order, not destiny.

This is why Fez rapidly ceases to resemble earlier Maghribi centres. It does not imitate Córdoba, a courtly city revolving around a single palace axis. Nor does it replicate Baghdad, a caliphal projection sustained by distant imperial extraction. Fez emerges instead as a polycentric organism structured around movement rather than monument. Its force resides everywhere and nowhere at once: dispersed through mosque and market, mint and mill, yet ultimately manifesting as holiness, baraka, and the unmistakable stamp of divine success.This diffusion is not dilution. It is the architecture of endurance—the reason Fez persists where other capitals remained stations on someone else’s road.

By the time al-ʿĀliyya is complete, Fez—in the expanded sense, meaning both banks together—possesses a doubled urban infrastructure designed for resilience: two congregational mosques (Masjid al-Ashyākh built by Idrīs I, and Masjid al-Shurafāʾ built by Idrīs II), two qaysariyyas for high-value trade in silks, books, and spices, and two mints, each bank capable of striking dirhams independently. Markets are organized by craft, with blacksmiths, tanners, dyers, carpenters, potters, and weavers each claiming their own street, standards, and autonomy. Each bank has its own walls and gates, rendering it defensible on its own, while hydraulic infrastructure—springs, watercourses, mills, and irrigation channels—feeds both sides of the river, binding the twin cities into a single economic organism while preserving their structural independence.

This was not duplication born of inefficiency. It was redundancy born of foresight. If one bank burned, the other survived. If one mosque closed, the other taught. If one mint was sacked, the other coined. There was no single point of failure. You could not behead Fez because Fez had no single head.

Compare this to Baghdad, built by the Abbasid caliph al-Manṣūr in 145–149 (762–766) as a perfect mandala—concentric circles radiating from the caliph's palace at the center, streets aligned like spokes, gates positioned at cardinal points, a geometric diagram of hierarchy frozen into brick and earth. It was breathtaking. It was also structurally fragile. When the Mongols sacked Baghdad in 656/1258, they destroyed the center, and the city ceased to function. The organizing principle was the palace; remove it, and the streets lost their meaning.

Compare it to Córdoba, where the Great Mosque, the Umayyad palace complex, and the administrative quarters all orbited caliphal presence. The city's economy depended on Andalusi agricultural surplus and Mediterranean trade networks organized by state contract. When the Umayyad caliphate collapsed in 422/1031, the organizing principle vanished. Within a generation, Córdoba fragmented into irrelevance, its population scattered to the taifa kingdoms, its mosques emptied, its markets reduced.

Fez had no center to strike at. Authority circulated through its fabric like lifeblood. The imām held significance, yet the imām did not constitute the system. The system was hydraulic, architectural, devotional, economic—and sanctified by baraka, framed by prophecy, sustained by allegiance. Such a structure could endure the removal of any single piece, even the ruling house that inaugurated it.

This is why when Mawlay Idrīs II was assassinated in 213/828—another Abbasid poisoning, another mawlā bought with promises, another son of the Prophet ﷺ dead before his time—Fez did not collapse.

But water and walls alone do not explain what Fez became. What transformed two settlements into a metropolitan center—what made Fez dangerous to Baghdad and Córdoba alike—was not infrastructure but human magnetism. People came because Fez offered what no other Maghribi city could: refuge that felt like opportunity.

The first wave arrived in 189/804, just before al-ʿĀliyya was founded—an Andalusi delegation whose presence would alter the trajectory of Fez. They were not mere exiles drifting westward in search of shelter. They were survivors of the Rabaḍ uprising, the great convulsion that had shaken Córdoba under al-Ḥakam I: scholars, qāḍīs, administrators, artisans, and Jewish financiers preserving commercial networks, whose revolt had exposed the fracture between moral authority and princely rule. Emerging from the arbaḍ—the suburban quarters that sustained Córdoba’s economic, intellectual, and commercial life—they brought with them a political theology shaped by resistance and a model of urban cohesion grounded in shared craft, law, and commerce.

Mawlay Idrīs II did not merely shelter them—he employed them in the key pillars of his state. He appointed ʿUmayr ibn Muṣʿab al-Azdī as vizier, entrusted the judiciary to ʿĀmir ibn Muḥammad ibn Saʿīd al-Qaysī, and appointed Abū al-Ḥasan ʿAbd al-Malik ibn Mālik al-Mālikī al-Anṣārī as secretary. They became his scribes, his tax collectors, his diplomats, his urban planners. They brought institutional memory from al-Andalus—how courts functioned, how markets were regulated, how mosques were endowed, how cities worked—and embedded that knowledge into the nascent Idrīsid administration.

Then came the second wave in 202/817: the exiles of al-Rabaḍ, the suburb of Córdoba that had revolted against Umayyad taxation and been crushed with systematic brutality. The Umayyad response was not negotiation but expulsion. Some eight thousand families—men, women, children, entire kinship networks—were driven out, their properties confiscated, their futures erased. They scattered across the Mediterranean: some to Alexandria, where they became mercenaries; some to Crete, where they founded an emirate; and some—perhaps three thousand families—came to Fez.

Mawlāy Idrīs II did not disperse the Andalusi exiles among tribes or bury them in rural settlements. He gave them a quarter—visible, central, and named after them. The eastern bank, once simply Fez, became ʿAdwat al-Andalus, the Andalusian Bank. And to anchor their presence within the city’s ritual and political architecture, the state built for them a new congregational mosque, Masjid al-Andalus, ensuring that their quarter possessed a civic heart equal in stature to any Idrīsid foundation. This was not charity. It was strategy. Every family settled there, every workshop opened, every prayer offered beneath the arches of the new mosque amounted to a diplomatic rebuke to Córdoba: a public testament that the Umayyads had lost the loyalty of their own subjects, that their justice rang hollow, and that their authority could, in fact, be refused.

And these Andalusis brought more than bodies. They brought civilization—not as metaphor but as measurable technique. They were masters of carpentry (the geometric precision of Andalusi woodwork, the interlocking joints that required no nails), ironwork (forges, tools, weapons), construction (the art of building with rammed earth, tile, and stone in ways that withstood earthquake and siege), and above all the decorative arts: zellij (mosaic tilework, tiny glazed pieces arranged in patterns that seemed to breathe), plaster carving (muqarnas, arabesques, calligraphy cut into walls), and architectural ornamentation that transformed surfaces into scripture.

Fāsī architecture—the style that would define Moroccan visual culture for a millennium, the aesthetic that tourists now photograph in medinas without knowing its origin—was born in this moment. It was Andalusi technique applied to Amazigh structure, shaped by Idrīsid ambition and Moroccan materials (limestone from the Middle Atlas, cedar from the Rif, clay from the Saïss plain). It was a fusion that could only happen in Fez, where migration was not trauma but catalysis.

They were not the last to arrive. Over the same decade, families from Ifrīqiya—especially from al-Qayrawān—began moving into Fez, driven by Aghlabid volatility or drawn by a city whose prestige in scholarship and commerce was rising with unusual speed. They settled on the western bank, in al-ʿĀliyya, which soon became known as ʿAdwat al-Qarawiyyīn, the Qayrawani Bank. To root this community within the emerging metropolitan structure, the Idrīsids established a second congregational mosque, Masjid al-Qarawiyyīn, giving al-ʿĀliyya the same architectural and institutional weight as the Andalusi bank across the river.

Decades after Mawlāy Idrīs II’s death, al-Qarawiyyīn—built in the shadow of his sanctuary and within sight of his tomb—had become the most consequential institution in the western Islamic world. Its location was not incidental. To pray, teach, or issue judgment in al-Qarawiyyīn was to operate within the orbit of the Idrīsid legacy; the mosque’s authority was inseparable from the saint-founder whose memory anchored the city. Even when dynasties shifted, the proximity of the mosque to Mawlāy Idrīs’s shrine ensured that political legitimacy in Fez passed through sacred, Idrīsid geography.

From this vantage point, al-Qarawiyyīn evolved into the intellectual parliament of the Muslim West. Here Mālikī law was interpreted for the entire Maghrib and al-Andalus. Here scholars were examined and licensed, their ijāzāt recognized from Timbuktu to Cairo to Damascus. Here manuscripts were copied, authenticated, and circulated; the sanad of a ḥadīth or legal opinion gained weight simply by tracing a link to al-Qarawiyyīn. And here fatwās were deliberated that could stabilize rulers or isolate them, justify revolts or forbid them. It became the chamber where knowledge was certified, where consensus was shaped, and where power was debated before it was enacted.

Crucially, after the fall of the Idrīsid state, it was al-Qarawiyyīn—and the scholars who governed its intellectual life—that ensured Mālikism became the primary madhhab of Morocco. Without a central dynasty to impose doctrine, the authority of law migrated to the mosque. Judges, jurists, and notables all passed through its curriculum; the Mālikī school became the shared legal language of cities, tribes, and courts alike. What began as a congregational mosque for a Qayrawani quarter thus became the anchor of Moroccan orthodoxy and the enduring heir of Idrīsid political theology.

This was the genius of Fez's cosmopolitanism: it did not erase difference but institutionalized it. Andalusis brought craft, Qayrawanis brought scholarship, Awraba and Zanāta brought military power and tribal networks, trans-Saharan merchants brought gold, Jewish craftsmen brought metallurgy and specialized finance, Christian traders (in the early decades) brought Mediterranean connections and the languages of commerce. No single group could claim monopoly. No single identity could define the city. Fez became pluralist by structure, and this pluralism made it anti-fragile.

When one patronal class weakened, others sustained the city. When one dynasty fell, Fez’s networks endured. This resilience explains its survival through successive ruptures: the fragmentation of the Idrīsid state after (213/829), the Almoravid conquest in the 5th/11th century, the Almohad invasion in the 6th/12th century, the Marinid decline in the 9th/15th century, the Saʿdian interregnum in the 10th/16th century, and the ʿAlawite consolidation in the 11th/17th century. The city did not depend on any single ruler—it depended on the cumulative strength of its systems.

6. Strategic Dispersal, the Civil War, and Resilience

When Mawlāy Idrīs II died in 213/828—poisoned, like his father before him, by an agent in Abbasid pay—he left behind not a stable succession but a constellation of grief. His mother, Kanza bint Isḥāq, had already buried three generations: her father Isḥāq, the Awraba chieftain who had first welcomed Idrīs I to Walīlī; her husband, the founding imam; and now her only son, dead at thirty-seven. None had perished from illness or old age. All had been murdered—methodically, deliberately, by a caliphal apparatus in Baghdad that understood one thing with absolute clarity: the Idrīsids could not be allowed to endure.

Yet endure they did, and Kanza understood why. She was not merely the widow of one imām and the mother of another. She was the matriarch of the most dangerous lineage in the Islamic West—twelve grandsons, all young, all bearing the blood of the Prophet ﷺ, and all visible targets for the same poison that had taken their father and grandfather. The eldest, al-Qāsim, was perhaps twenty-one. Muḥammad (221/836), the second-born, perhaps twenty. ʿĪsā (233/847), the third and most powerful, a few years younger still. Some were barely adolescents. At least one may still have been a child.

Kanza had watched the Abbasids perfect their method. They did not invade. They did not declare war. They infiltrated. A servant bought with promises. A mawlā positioned near the imām's table. A trusted figure turned informant. Rāshid, the loyal guardian who had raised Idrīs II and administered the state during his minority, had been killed the same way. The pattern was undeniable: concentration invited assassination. So long as the Idrīsids gathered in a single city, under a single roof, around a single table, they remained within reach of an intelligence network that had already demonstrated, across three generations, that it could kill anyone, anywhere, at any time.

Kanza's response was not panic. It was geometry. She divided Morocco. Not in the way later historians would frame it—as the tragic mistake of a grieving matriarch or the chaotic dissolution of a once-unified state—but as a calculated act of survival, executed with the precision of a general distributing forces across a battlefield. Each grandson was assigned a region. Each region corresponded to a strategic necessity. Each assignment reflected not merely his age or capability but the political and kinship networks that could protect him through his mother's lineage.

Al-Qāsim, the eldest, was given Tanga and the northern coast—Sala, the Rif corridor, and control over the Strait of Gibraltar. This was not a consolation prize. It was dominion over Morocco's most strategically vital threshold, the maritime gateway between continents, the passage through which armies, embassies, and ideas moved between the Maghrib and al-Andalus. To rule Tanga was to hold a blade to the throat of anyone who wished to cross.

Muḥammad, the second-born, was given Fez—the symbolic and economic heart of the Idrīsid project, the city his grandfather had founded and his father had doubled, the place where baraka, commerce, and legitimacy intersected most visibly. With Fez came nominal leadership over his brothers, a claim rooted in his position as second-eldest and his control over the city that bore the dynasty's imprint most indelibly. Yet nominal authority, as events would soon demonstrate, is a fragile thing when divorced from material power.

ʿĪsā, the third-born, was given the interior: Tadla, Tāmasnā, Sala, extending as far as Zagora. More importantly, he was given proximity to Jabal ʿAwwām, the silver mines that fed the Idrīsid dirham. ʿĪsā was not merely assigned a territory—he was granted control over the mineral foundation of sovereignty itself. In a state whose economy ran on silver, whose legitimacy was announced through coinage, and whose independence was measured by its ability to mint without external permission, ʿĪsā's domains were not peripheral. They were essential. And ʿĪsā himself, even at his young age, was known to be charismatic, forceful, and capable—a prince whose personality matched the weight of his inheritance.

Dāwūd was placed at Hawwāra in the region of Wahrān, the eastern corridor connecting Morocco to Ifrīqiya. This was not exile—it was the assignment of a sentinel, a prince positioned where ʿAbbāsid and Aghlabid influence would have to pass if they wished to reach Fez. Ḥamza was sent to Zarhūn, where Idrīs I had first been proclaimed imām, a location thick with memory and legitimacy. ʿAbd Allāh was assigned Lamṭa—deep in the south, securing the edges of the Saharan trade routes and maintaining Idrīsid presence among the Ṣanhāja tribes of the pre-Sahara. ʿUmar, vigorous and loyal, was entrusted with the Rif highlands and the confederation of Sanhāja and Ghumāra tribes, a role that combined military command with diplomatic necessity.

And beyond these direct sons of Idrīs II, even the Sulaymanid line—the descendants of Sulaymān, brother of Idrīs I—retained Tlemcen, affirming that legitimacy was not monopolized by a single branch but distributed across the family.

This was not fragmentation. It was federation. And it was, in its essence, a replication of the Fez model across the entire territorial expanse of Morocco. Just as ’Mawlay Idrīs I had built Fez on one bank of Wādī al-Jawāhir and Mawlay Idrīs II had built al-ʿĀliyya on the other, creating a doubled city where neither half could collapse without the other surviving, so too did Kanza construct a doubled—indeed, a multiplied—state, where the fall of one node could not bring down the network.

Each grandson carried baraka. Each would marry into the tribes of his region, weaving Qurayshī blood into Amazigh kinship structures and creating a matrix of loyalty that transcended any single center. Each would build: mosques, markets, ḥammāms, mints if necessary, and in some cases entirely new cities. The Idrīsid presence was not to be confined to Fez. It was to be inscribed across Morocco's geography, written into its rivers, mountains, and coasts, so that even if Fez fell, even if one brother was killed, even if the Abbasids succeeded in poisoning another generation, the project itself would endure.

Kanza had other motives as well. She understood that concentrated power among twelve young men—sons of different mothers, tied to different tribal confederations, possessed of different temperaments and ambitions—would produce rivalry, resentment, and eventually violence. To keep them all in Fez would be to place them in a confined arena where competition for precedence, resources, and recognition would inevitably escalate. Distance, by contrast, allowed each to build his own legitimacy, his own authority, his own identity, without the constant friction of comparison and contestation.

And she understood something darker still. The Abbasid apparatus that had killed her father, her husband, and her son did not operate only through poison. It operated through bribery, infiltration, and manipulation. If trained mawālī could be placed at the imām's table, then trained concubines could be placed in the imām's bed. If advisors could be bought, then so could wet nurses, stewards, and secretaries. If a dynasty could be killed directly, it could also be destroyed indirectly—by sowing distrust, amplifying grievances, and turning brother against brother. After five successful assassinations, why would the Abbasids not escalate to psychological warfare? Why would they not plant rumors, engineer disputes, and manipulate the very succession itself?

Kanza could not prevent this entirely. But she could limit its damage by ensuring that even if one branch of the family was compromised, corrupted, or turned against the others, the remaining branches would survive, geographically separated, politically autonomous, and therefore harder to manipulate as a collective.

Her strategy, in short, was prophylactic. Not in the weak sense of avoiding conflict—conflict, she knew, was inevitable—but in the strong sense of ensuring that no single conflict, no single betrayal, no single assassination could decapitate the entire line. What she could not prevent, however, was the constitutional tension her own division had created.

The crisis crystallized under Muḥammad ibn Idrīs, known as al-Khalīfa, who ruled from Fez. His most consequential decision was the monopolization of the mint, restricting the striking of the Idrīsid dirham to al-ʿĀliyya alone. In a state whose economy depended exclusively on silver—gold being monopolized by the Midrārids of Sigilmāsa—control of the mint was control of sovereignty itself.

ʿĪsā ibn Idrīs, governor of Tadla, Tāmasnā, Dukāla, and the Atlas, did not initially rebel. Raised in Fez, educated within the Idrīsid court, he governed with competence and loyalty. His break in 215/830 was not ideological. It was economic and structural. The silver mines of Jabal ʿAwwām, Wāziqqūr, Zīz, and Tudgha, lay within his sphere. When Muḥammad al-Khalīfa denied the brothers the right to mint, he effectively reduced them to governors without fiscal autonomy. ʿĪsā responded by striking coinage at Wāziqqūr near Khénifra, asserting not independence from the imamate, but participation in it. The response from Fez was war.

Silver dirham issued under Imām'Isa ibn Idris (great-grandfather of Shaykh ʿAbd al-ʿAzīz al-Dabbāgh) at Wazzaqur mint in  225/840.

Silver dirham issued under Imām'Isa ibn Idris (great-grandfather of Shaykh ʿAbd al-ʿAzīz al-Dabbāgh) at Wazzaqur mint in 225/840.

This conflict must be understood through the lens of age and manipulation. When it erupted, Muḥammad was in his early twenties at most. ʿĪsā, a year or two younger, was known even then for his charisma and force of personality. These were not seasoned statesmen weighing constitutional principles in council chambers. They were young men—sons of a murdered father, grandsons of a murdered grandfather, surrounded by advisors whose loyalties were unknown, married to women whose families had their own interests, and governing territories they had only recently inherited.

The mint monopoly was, on its surface, a reasonable assertion of central authority. Muḥammad, as the second-born son and ruler of Fez, had a legitimate claim to regulate the currency that bore the family name and the Qurʾānic inscriptions that declared their mission. To allow each brother to mint independently risked debasement, confusion, and the fracturing of monetary sovereignty—an outcome that would weaken the dynasty in the eyes of both internal populations and external rivals.

Yet ʿĪsā's position was equally coherent. He controlled the source of the silver itself. To deny him the right to mint was to transform him from an autonomous amīr—a prince of the House of Mawlay Idrīs, governing a real territory with real resources—into a subordinate administrator, dependent on Fez for the very coins needed to pay his soldiers, feed his administration, and demonstrate his legitimacy. It was, in effect, to strip him of sovereignty while leaving him with all the responsibilities of rule.

The conflict, therefore, was not about greed or ambition. It was about the unresolved question at the heart of Kanza's division: Were the brothers co-rulers of a shared imamate, or was one brother the imām and the others merely his governors?

Muḥammad's monopoly implied the latter. ʿĪsā's minting asserted the former. And because this question had never been formally answered—because Kanza's division had been executed in haste, under duress, with a dozen young boys to protect and no time to draft a constitution—it remained ambiguous. Ambiguity, in the hands of young men under pressure, becomes conflict.

But there is another layer to this crisis that the sources hint at but do not explore. By the time Muḥammad and ʿĪsā clashed, the Abbasid intelligence apparatus had already successfully assassinated five key figures in the Idrīsid project: Idrīs I, Idrīs II, Isḥāq, Rāshid, and others whose names are lost. These were not random murders. They were systematic operations, requiring long-term infiltration, the cultivation of insider access, and the ability to position agents close enough to the imām's household to administer poison without detection.

If such an apparatus existed—and the historical record confirms that it did—why would it stop at direct assassination? Why would it not also seek to destabilize the family through indirect means: planting concubines who whispered division, cultivating viziers who amplified tensions, bribing stewards who framed disputes in the worst possible light, and shaping the very advice that young, inexperienced rulers received?

When Muḥammad decided to monopolize the mint, was it his own idea? Or was it the suggestion of an advisor who understood that such a move would provoke ʿĪsā? When ʿĪsā struck coins in defiance, was it purely a principled response? Or had his own counselors framed Muḥammad's decision as an unforgivable insult, an assault on his dignity and autonomy, something that could not be tolerated without loss of honor?

We do not know. The sources do not tell us. But to treat the conflict as if it emerged purely from internal Idrīsid dynamics—as if young men in their twenties, ruling a fragmented state, surrounded by advisors of uncertain loyalty, were making decisions in a vacuum—is to ignore the documented reality of Abbasid operations across the Islamic world.

What we do know is this: the conflict escalated without mediation. No council of elders was convened. No arbitration was attempted. No senior figure from the family—no uncle, no respected scholar, no tribal leader with ties to both brothers—stepped forward to defuse the tension before it became war. This absence is suspicious. Either such figures did not exist, which seems unlikely given the extensive kinship and tribal networks the Idrīsids had built, or they were prevented from acting, sidelined, discredited, or otherwise neutralized.

This war was, as later sources implicitly admit, economically inevitable but politically disastrous. No mediation was attempted. No council was convened. The absence of mediation is made more striking by the silence surrounding Kanza herself. Where was the grandmother who had orchestrated the division? If she still lived, why did she not convene the brothers? The sources do not tell us. But her absence—whether through death, illness, or marginalization—removed the one figure who might have prevented the war. Without Kanza, the protective architecture she had built had lost its keystone.

Al-Qāsim, governor of Tanga and Sabta—the most perceptive of the brothers—refused to take part. His withdrawal was not cowardice but foresight. As the eldest, al-Qāsim had watched his father die young and his uncles fall to Abbasid poison. He understood something Muḥammad had not yet grasped: that the Idrīsid house could withstand external enemies, but not fratricidal war. Once brothers turned their swords against one another, legitimacy itself would erode, and the Abbasids would no longer need poison. His refusal, preserved in verse, marks one of the earliest internal critiques of Idrīsid strategy—and it led him to withdraw from the struggle into a small settlement near Tanga, where he established a ribāṭ: a space of watchfulness and restraint rather than conquest, quietly prefiguring a form of authority that would become foundational to Moroccan Sufism.

But al-Qāsim's wisdom did not prevail. Muḥammad entrusted the campaign to ʿUmar, another brother, vigorous and loyal. ʿUmar led forces south into the Atlas and defeated ʿĪsā at Wādī al-ʿAbīd. Yet this was not a decisive victory in any meaningful sense. ʿĪsā was not killed. He was not captured. He withdrew—strategically, deliberately—into Ayt ʿAttāb and the fortified settlements of the interior, preserving his followers, his resources, and his claim. He did not vanish. He waited. And he did not wait long.

When Muḥammad al-Khalīfa and his brother ʿUmar were assassinated in 221/836, the political landscape shifted. Authority in Fez weakened. A child, ʿAlī Ḥaydara, ascended nominally, ruling in name rather than power. In this vacuum, ʿĪsā re-emerged, restored his emirate, expanded southward as far as Sūs, and resumed silver dirhams at Zīz in 229/843. His resumption of minting was now explicit and public, and the numismatic record confirms that he adopted the caliphal-style laqab al-Muntaṣir Billāh—the very title previously borne by his brother Muḥammad—signaling transfer of authority.

What later becomes unmistakable is that ʿĪsā’s horizon was never limited to Tadla or the Atlas. His objective was Fez itself. Between 266/880 and 279/893, numismatic evidence demonstrates that Fez was ruled not by the line of Muḥammad al-Khalīfa, but by members of ʿĪsā’s own branch. Coins struck in the city during this period bear the names of his descendants, leaving no doubt that control of the capital passed into their hands. This was not an anomaly or a momentary seizure; it was the delayed fulfillment of a political trajectory set in motion decades earlier.

The Idrīsid crisis, therefore, was not a rebellion against legitimacy, but a struggle over how legitimacy should be exercised. The assassinations were not anomalies. They followed the same pattern that had claimed Idrīs I, Idrīs II, Isḥāq, and Rāshid. Muḥammad, who had sought to concentrate authority in Fez and monopolize the mint, was dead. ʿUmar, who had been rewarded with the governorship of Tanga for his victory over ʿĪsā, was also dead. Both had been young men and both had been visible, centralized, and therefore targetable. And both had been in Fez, or operating closely within its orbit.

Meanwhile, ʿĪsā—who had been defeated militarily, driven from his initial base, and forced into the Atlas—survived. Al-Qāsim, who had refused to participate in the war and remained in his ribāṭ, survived. Dāwūd, stationed at Taza in the eastern corridor, survived. The brothers who had been dispersed, who governed their own regions with autonomy, who were not gathered under a single roof or dependent on a single table—these were the ones the Abbasid apparatus could not reach. The pattern was undeniable. Kanza had been right.

The succession of ʿAlī ibn Muḥammad, later known as Ḥaydara, was a constitutional improvisation born of necessity. He was a child—some sources suggest he was no older than ten or twelve—and his authority was nominal at best. Real power fragmented among the surviving brothers, regional strongmen, and the tribal confederations that had initially supported the Idrīsid rise. Fez did not collapse, but neither did it command. It became one center among many, primus inter pares in theory, but structurally incapable of enforcing obedience. And in this fragmentation, something unexpected occurred: the Idrīsid project did not end. It adapted.

And what came next was not retreat into irrelevance, but something the conventional narrative of dynastic decline fails to anticipate: the Idrīsids began building again, especially in the north.

Al-Baṣra near Asilah emerged as a renewed Idrīsid center, while Jarāwa near Tlemcen secured the eastern frontier against Aghlabid pressure. In the Rif, Ḥajar al-Naṣr was constructed as a deliberate stronghold controlling tribal routes, not as a refuge of retreat. Tiṭwan (Tetouan), developed as a fortified castle on the remains of Tamuda, took shape during sustained conflict with the Umayyads and their Zanāta clients, locking the northern frontier and the strait. To these must be added Jawṭa (Jūta) on the Subū: a thriving river-port and market whose prosperity gave rise to the Idrīsid branch of al-Jawṭī, later called upon to govern Fez after the fall of the Marinids. Its commercial intensity left a cultural trace in the vernacular term “Jūṭiyya”, used for markets so dense with merchants and customers that trade itself seems to overflow. Together, these foundations mark a decisive shift from a single capital to a distributed Idrīsid geography of power, urbanity, and memory.

These were not the actions of a collapsing dynasty. They were the actions of a family adapting its strategy, learning from its losses, and inscribing itself into Morocco's geography in a way that transcended any single urban center. Where Idrīs I had built Fez as the anchor of legitimacy, his grandsons built everywhere—along rivers, among tribes, near trade routes, in defensible highlands. They did not abandon the model of Fez. They replicated it. And in doing so, they ensured that even when Fez itself fell into rival hands, the Idrīsid presence in Morocco remained undeniable.

In 263/877, Dāwūd ibn Idrīs entered Fez. It was during this period that Dāwūd renewed and inaugurated al-Qarawiyyīn, an act that must be read symbolically. Even amid political instability, the Idrīsids invested in institutions that outlived rulers. Mosques, mints, and cities mattered more than palaces.

This was not chaos. It was a federal system functioning exactly as Kanza's division had implied it should. Fez mattered, but it was not essential. The imamate was shared, not monopolized. And the survival of the family—embedded in cities, tribes, and sanctuaries across Morocco—no longer depended on who sat in al-ʿĀliyya.

The conventional narrative of Idrīsid decline rests on a misreading of what constitutes political success. It assumes that a state must be centralized to be functional, that fragmentation equals failure, and that the inability to maintain a single, unchallenged capital represents the collapse of legitimacy. But this model—borrowed from Abbasid Baghdad, from Umayyad Córdoba, from the centralized imperial polities of the East—was never the Moroccan reality.

Morocco in the 3rd/9th century did not have the bureaucratic infrastructure, the fiscal surplus, or the coercive military capacity to sustain a centralized state on the Abbasid model. What it had was kinship, baraka, tribal alliances, and a landscape that favored dispersion over concentration. The Idrīsids did not fail to build a centralized state. They succeeded in building something else: a distributed network of authority, grounded in prophetic descent, amplified through marriage and alliance, sustained by local economies, and capable of surviving the assassination of any single node.

When the Fatimids and Umayyads would later clash over Morocco, using local tribes as proxies and turning the Maghrib into a battlefield of imperial rivalry, the Idrīsids would lose Fez, lose cities, lose visible power. But they would not lose Morocco. They would retreat into the Rif, rebuild at Ḥajar al-Naṣr, and continue to govern in the name of the Prophet's House for another century. And when they were finally driven from political power entirely, they would not vanish. They would transform once again—this time into a spiritual network of ribāṭs, zawāyā, and sanctuaries that no army could conquer and no caliph could erase.

The Idrīsid answer to fragmentation was not reconquest. It was reinscription. And in this, they revealed a form of political intelligence that the empires hunting them never understood: that legitimacy rooted in baraka, kinship, and sanctity does not require a throne. It only requires presence. And presence, once distributed across a land, cannot be eliminated by killing an amīr.

7. Imperial Crushing and the Revenge of the Sharīfs

When Mawlāy Idrīs II died in 213/828—poisoned, like his father, by Abbasid agents—the consequences radiated across the entire Islamic West. His death did not merely create a succession crisis in Fez. It destabilized the entire geopolitical architecture of North Africa, triggering two simultaneous crises: one internal (the Idrīsid civil war over the mint and succession), and one external (the collapse of the regional balance that had constrained imperial ambitions for decades).

The Idrīsid state, under Mawlāy Idrīs II, had been expanding eastward. Tlemcen had been secured, the eastern approaches to Ifrīqiya were opening. Had Mawlāy Idrīs II lived another decade, the trajectory was clear: Morocco would not remain a regional power but would become a Western Islamic imamate, projecting authority from the Atlantic to Tripoli, absorbing the Aghlabid territories, and establishing a unified sharīfian state across North Africa. The Abbasids understood this. So did the Aghlabids. This is why they killed him.

But his death produced an unintended consequence: it weakened both the Idrīsids and the Aghlabids simultaneously. The Idrīsids fragmented into a federal system of competing brothers. The Aghlabids, however, lost their reason for existence. Their entire purpose, as Abbasid governors of Ifrīqiya, had been to function as a checkpoint—a military and administrative barrier designed to contain Idrīsid expansion and prevent the Maghrib from unifying under sharīfian leadership. With Mawlāy Idrīs II dead and his sons divided, the Aghlabids no longer had a mission. Their armies, their taxation, their administrative apparatus—all justified by the threat of Idrīsid expansion—now seemed excessive, oppressive, and without clear purpose.

This created a vacuum. And into that vacuum flowed a new force that would transform North African politics for the next century: the Fatimids. Their rise was not the product of overwhelming military strength but of strategic exploitation of compounded fragilities. An Ismāʿīlī missionary, Abū ʿAbd Allāh al-Shīʿī, had spent nearly two decades conducting a clandestine daʿwa among the Kutāma Berbers of western Ifrīqiya. When Aghlabid authority fractured and internal revolts multiplied, he moved decisively. In 296/909, Kutāma forces entered Qayrawān and proclaimed the manifestation of the hidden imām, ʿUbayd Allāh al-Mahdī (d. 322/934), who asserted descent from Fāṭima through Ismāʿīl b. Jaʿfar al-Ṣādiq.

ʿUbayd Allāh had attempted to travel westward in secret, imitating Mawlāy Idrīs I's concealed journey. But when he passed through Sigilmāsa, the Midrārids—who controlled the trans-Saharan gold trade—captured and held him for ransom. Abū ʿAbd Allāh eventually secured his release, and the Ismāʿīlī leadership traveled to Sigilmāsa to retrieve their imām. Many saw him in person for the first time there, in a remote Moroccan desert emirate.

Once installed in Qayrawān, ʿUbayd Allāh issued his first command as caliph: execute Abū ʿAbd Allāh al-Shīʿī—the kingmaker, the man who had spent two decades building the movement, along with his family. The Fatimid caliphate thus began as it would end: with imprisonment, betrayal, and assassination. Two and a half centuries later, Ṣalāḥ al-Dīn al-Ayyūbī would abolish the Fatimid state (567/1171) through the same methods—eliminating the dynasty through murder and confinement.

The Fatimids never embedded themselves in the Maghrib. They remained strangers, ruling through Berber proxies and garrison force. Where the Idrīsids had married into tribes, spoken Tamazight, and become Moroccan, the Fatimids governed from a distance, imposed Ismāʿīlī doctrine on a Mālikī population, and were despised accordingly. Within sixty years, they would abandon Ifrīqiya entirely, moving their capital to Egypt (969/972) because they could not hold the land that had brought them to power. But before they left, they would attempt to accomplish what the Abbasids had failed to do: erase the Idrīsids completely.

When the Fatimid state consolidated in Ifrīqiya, it turned westward. Thirteen years after seizing Qayrawān, in 309/921, it dispatched a military expedition led by Maṣāla ibn Ḥabūs al-Miknāsī against the Far Maghrib. The reigning Idrīsid imām was Yaḥyā ibn Idrīs ibn ʿUmar ibn Idrīs ibn Idrīs (d. 309/921). Maṣāla besieged Fez. When the siege prolonged and provisions dwindled, Imām Yaḥyā was forced into a humiliating accommodation: he concluded a truce and was compelled to pronounce the khuṭba in the name of the Fatimid ruler from the minbars of Fez. Idrīsid autonomy, for the first time, was subordinated to external authority.

Maṣāla installed a Fatimid governor in Fez: Rayḥān al-Kutāmī, a member of the same Kutāma Berber confederation that had brought the Fatimids to power. The Fatimids believed the matter settled. They had forced the Idrīsid imām to submit, installed their own administrator, and demonstrated that sharīfian legitimacy could be subordinated to Ismāʿīlī authority. They were wrong.

The following year, in 310/922, an Idrīsid prince rallied the resistance. His name was al-Ḥasan ibn Muḥammad ibn al-Qāsim ibn Idrīs ibn Idrīs, and he was known by the epithet al-Ḥajjām (the cupper)—earned after he was wounded in the place where cupping is performed, yet continued fighting with such ferocity that the name became a badge of courage rather than injury. He was young, militant, and unwilling to accept that the dynasty his great-great-grandfather had founded would bow to Fatimid usurpers.

Al-Ḥasan al-Ḥajjām gathered what remained of Idrīsid supporters—tribal allies, urban loyalists, sharīfs who had refused to flee—and launched a swift campaign to retake Fez. He stormed the city, killed the Fatimid governor Rayḥān al-Kutāmī (some sources say he exiled him instead, but the effect was the same: Fatimid authority was expelled), and received the bayʿa from the people of Fez. The Idrīsid khuṭba was restored. The Fatimid experiment had lasted barely a year.

Al-Ḥasan did not stop at Fez. He extended his authority over Liwāta, Ṣafrūn, and Miknāsa—key towns in the region—demonstrating that this was not a local revolt but the restoration of Idrīsid rule across northern Morocco. For years, he governed successfully, maintaining order, defending the cities, and proving that the Idrīsids were not a spent force but a dynasty capable of resurgence even after catastrophic losses.

This was intolerable to the Fatimids. They had claimed to represent Ahl al-Bayt, to restore justice through the Mahdī's guidance, to bring the Maghrib under the rightful rule of Fāṭima's descendants. Yet here was an actual descendant of Fāṭima—through al-Ḥasan ibn ʿAlī, through the line of Mawlāy Idrīs I and II—who had expelled their governor, restored sharīfian rule, and demonstrated that the people of Morocco preferred an Idrīsid imām to a Fatimid one.

The response, when it came, was not theological debate or negotiation. It was violence, systematic and total, administered through a proxy who would become synonymous with the extermination of the sharīfs in Morocco. They found such a figure in Mūsā ibn Abī al-ʿAfiya al-Miknāsī, cousin of Maṣāla ibn Ḥabūs and member of the same Zanāta confederation of Miknāsa that had long resented Idrīsid claims to supremacy.

Around 327/939, Mūsā was appointed Fatimid governor over a vast territory stretching from Taza to the basin of the Malwiyya River. His mission was explicit: crush Imām al-Ḥajjām, retake Fez, and ensure that the Idrīsids would never rise again. Mūsā marched on Fez. The two forces met in battle near the city. The imām fought fiercely, but Mūsā's forces—backed by Fatimid resources, Zanāta tribal levies, and the accumulated resentment of those who had never accepted Idrīsid rule—overwhelmed him. Al-Ḥasan was defeated and forced to retreat into Fez itself, seeking refuge behind the walls his ancestors had built.

But the walls did not save him from betrayal. His own governor in Fez, Ḥāmid ibn Ḥamdān al-Hamdānī, turned against him, imprisoned the imam, and held him as Mūsā’s forces closed in. Facing certain execution, al-Ḥasan attempted a nocturnal escape, climbing the city wall under cover of darkness. The descent failed. He fell, shattered his leg, and crawled in agony to ʿAdwat al-Andalus, where he hid for three days. His injuries proved fatal. Al-Ḥasan ibn Muḥammad al-Ḥajjām—the last Idrīsid imām to rule Fez with effective authority—died not in battle, but from the consequences of betrayal. And with his death, Mūsā ibn Abī al-ʿAfiya's reign of terror truly began.

At the entrance to Wādī al-Jawāhir—the River of Gems, the waterway that Mawlāy Idrīs I had named for the prosperity it generated, the river that turned the mills that fed Fez, the hydraulic artery of the Idrīsid project—Mūsā assembled four hundred Idrīsid sharīfs. Men, adolescents, perhaps some boys—descendants of Mawlāy Idrīs II, grandsons and great-grandsons of the imāms who had built Morocco into a center of Islamic civilization. They were beheaded. All of them. In a single act. Their bodies left at the water's edge, their heads displayed, their blood flowing into the river that had once symbolized Idrīsid abundance.

The massacre was deliberate. It was not a battle. It was not suppression of a revolt. It was extermination by category—the methodical killing of an entire lineage, executed in the most visible location possible, at the entrance to the city that bore the imprint of their ancestors. The site became known, from that day forward, as Wādī al-Shurafāʾ—the River of the Sharīfs—a name that transformed geography into memorial, a name that refused to let the dead be forgotten.

Seven hundred sharīfs, according to some accounts, fled Fez during Mūsā's reign and the reign of his son Abū al-Qāsim after him, scattering into the Atlas, the Rif, the Saharan edges, anywhere that offered refuge from a governor who had made genocide policy. The Idrīsids, who had once ruled cities, now hid in mountains. Who had once minted coins, now carried nothing. Who had once delivered khuṭbas from minbars, now whispered prayers in caves.

The sources preserve a detail that reveals how completely Mūsā's memory was cursed: "He was buried at Bāb al-Ḥamrāʾ in Fez, and the people of Fez still urinate on his grave and stone it to this day." Centuries after his death, the ritual pollution of his tomb continued. This was not ordinary political enmity. This was the judgment of a city that could not forgive, that had absorbed the massacre into its collective memory, and that responded with the most visceral form of desecration available: treating the grave of the killer as a latrine. Even in death, Mūsā could not escape the curse of Wādī al-Shurafāʾ.

It is crucial to understand that Mūsā acted in the name of the Fatimids. The massacre at Wādī al-Shurafāʾ was not the act of a rogue warlord. It was Fatimid policy. The Fatimids, who ruled by claiming descent from Fāṭima, who proclaimed themselves the rightful imāms of Ahl al-Bayt, who denounced the Abbasids and Umayyads for their persecution of the Prophet's ﷺ family—these same Fatimids ordered the extermination of the actual descendants of Fāṭima who ruled in Morocco.

The Umayyads of Córdoba, despite their enmity toward the Idrīsids, had never directly killed an Idrīsid. They feared repeating Karbalāʾ. They used Zanāta proxies, offered bribes, supported rival claimants—but they avoided the open massacre of sharīfs because they understood that such an act would curse their dynasty forever. The ghost of al-Ḥusayn ibn ʿAlī haunted them still.

But the Fatimids had no such restraint. They had already betrayed and executed their own founder. They had already demonstrated that their doctrine prioritized esoteric hierarchy over prophetic kinship. The murder of four hundred Idrīsids was not an aberration. It was the logical conclusion of a movement that valued power over legitimacy.

And Mūsā's own position was never secure. He had been appointed by the Fatimids, yet when the Umayyads of Córdoba extended their influence southward and offered him better terms, he switched allegiance. He became a double agent, a governor who served two masters and trusted neither, who enriched himself through betrayal and who died, fittingly, not in his bed but in battle at the Malwiyya River, killed in one of the endless skirmishes that defined his reign. His dynasty, the Miknāsī line he had hoped to establish, did not endure. His name, however, endured—not as a conqueror but as the man who committed the third great massacre of the Prophet's ﷺ family.

The first had been Karbalāʾ in 61/680, where al-Ḥusayn ibn ʿAlī and his household were slaughtered by Umayyad forces. The second had been Fakh in 169/786, where al-Ḥusayn ibn ʿAlī al-Ḥasanī and his followers were crushed by Abbasid troops, and from which Mawlāy Idrīs I had fled westward to found Morocco's imamate. Now there was a third: Wādī al-Shurafāʾ in Fez, where four hundred descendants of the Prophet ﷺ were beheaded in a single day, their blood staining the river that had once fed the mills of the Idrīsid state.

Three massacres. Three centuries. Three powers—Umayyad, Abbasid, and Fatimid—all converging on a single family, all seeking to extinguish a lineage that refused to accept that political authority could be divorced from prophetic descent. But history, as the Idrīsids understood it, was longer than any single reign of terror. And memory, particularly the memory of blood, does not dissipate. It accumulates. It waits. And when the conditions allow, it returns—not as lamentation, but as retribution.

The Idrīsids who survived the massacres did not disappear. They did what their ancestors had done after Karbalāʾ and after Fakh: they adapted, dispersed, and waited. Some withdrew to Qalʿat al-Nasr—the Fortress of the Eagle—in Jabal Ḥabīb in the Rif highlands, among the Ghumāra and Ṣanhāja tribes who had once sheltered Idrīs I. Others melted into the Atlas, where ʿĪsā's descendants still held influence. A few remained in the cities, their genealogies quietly maintained, their sharīfian identity whispered rather than proclaimed. And some—crucially—crossed the Strait to al-Andalus.

Al-Andalus in the late 4th/10th century was not the unified emirate of ʿAbd al-Raḥmān III. It was fragmenting under the weight of its own contradictions. The Umayyad rulers had become ceremonial figures, eclipsed by their ḥājibs (chamberlains), particularly the ʿĀmirid dynasty founded by Muḥammad ibn Abī ʿĀmir, known as al-Manṣūr, who had reduced the Umayyad ruler Hishām II to a prisoner in his own palace, ruling in his name while monopolizing all real power.

al-Idrīsī’s world first map from Nuzhat al-mushtāq fi’khtirāq al-āfāq‍

Abū ʿAbd Allāh Muḥammad Ibn Muḥammad Ibn ʿAbd Allāh Ibn Idrīs Al-Ḥammūdī al-Idrīsī’s world first map from Nuzhat al-mushtāq fi’khtirāq al-āfāq‍ ‍(“The Pleasure of the Traveler in Discovering the World”), known as the Tabula Rogeriana; it was completed in 548/1153.

After al-Manṣūr’s death in 392/1002, his sons—first ʿAbd al-Malik, then ʿAbd al-Raḥmān, mockingly called Sanchuelo—attempted to preserve ʿĀmirid control. When Sanchuelo forced Hishām II to name him successor in 399/1009, the Umayyad elite and the Andalusī population rebelled. Sanchuelo was killed, the ʿĀmirid arrangement collapsed, and al-Andalus slid into prolonged internal conflict that dismantled Umayyad authority in Córdoba. It was into this chaos that the Idrīsids re-entered history.

ʿAlī and al-Qāsim ibn Ḥammūd had crossed to al-Andalus during the reign of al-Manṣūr, joining the waves of Moorish soldiers recruited into the Umayyad armies. They were competent, loyal, and crucially, they did not advertise their Idrīsid lineage. In a military apparatus dominated by Amazigh contingents—Zanāta, Ṣanhāja, Maṣmūda—they blended in. They rose through the ranks not as sharīfs but as soldiers. No one asked about their genealogy. No one needed to know that the men commanding squadrons of cavalry were great-great-great-grandsons of Idrīs II, that they carried in their blood the memory of Wādī al-Shurafāʾ, that they had not forgotten what Mūsā ibn Abī al-ʿAfiya had done, or what the Umayyads—through their Zanāta proxies—had enabled.

When the fitna erupted and rival Umayyad claimants began tearing al-Andalus apart, one of them—Sulaymān al-Mustaʿīn bi-llāh—recognized that he needed military support to seize Córdoba. The Moorish soldiers who had sustained the ʿĀmirid regime were now kingmakers. Sulaymān cultivated them, promised them land and titles, and in 399/1009 they helped him overthrow his rival Muḥammad ibn Hishām al-Mahdī and proclaim him king. As reward for their service, Sulaymān distributed key governorships. In 403/1013, he appointed ʿAlī ibn Ḥammūd governor of Sabta, the fortress-city that controlled the African side of the Strait of Gibraltar. Shortly after, he gave ʿAlī's brother al-Qāsim the governorship of al-Jazīra al-Khaḍrāʾ (Algeciras), the port on the European side.

ʿAlī ibn Ḥammūd did not remain content with Sabta. In 404/1013, he declared the city independent, severing ties with Sulaymān and establishing Sabta as an autonomous Idrīsid base. The following year, he seized Málaga. And there, in Málaga in Rabīʿ al-Awwal 405/October 1014, he was proclaimed caliph by the Moorish soldiers and the Andalusī population. Not governor. Not emir. Caliph. He took the title al-Nāṣir li-Dīn Allāh—the one who makes God's religion victorious—a title heavy with prophetic resonance, a title that announced not merely political ambition but religious mission.

This was not rebellion in the ordinary sense. It was declaration: that the Umayyads had forfeited legitimacy, that their caliphate was a hollow shell sustained by violence and lies, that the time had come for the Prophet's ﷺ family to reclaim what had always been theirs. ʿAlī ibn Ḥammūd did not ask for recognition from Córdoba. He marched toward it.

Sulaymān al-Mustaʿīn, the caliph ʿAlī had once served, gathered his forces and marched out to meet him. The two armies met near Córdoba in Shawwāl 406/April 1016. The battle was brief and decisive. Sulaymān's forces, weakened by internal division and demoralized by the endless civil war, broke under the Idrissid assault. Sulaymān himself was captured, along with his brother and his father. They were brought before ʿAlī ibn Ḥammūd in chains. What happened next was execution. ʿAlī ibn Ḥammūd ordered all three killed.

The sources do not record whether ʿAlī pronounced a formal sentence, whether he invoked Wādī al-Shurafāʾ, whether he reminded the dying Umayyads of Karbalāʾ. But the silence itself is eloquent. This was not justice performed for an audience. It was qiṣāṣ—retribution, blood for blood, the settling of a debt that had accrued across three centuries.

Sulaymān and his family were, in the words of one chronicler, "the last of the cursed tree." The Qurʾānic phrase is deliberate: al-shajarah al-malʿūnah—the tree cursed in the Qurʾān (Sūrat al-Isrāʾ, 17:60), a tree that appears in a vision of the Prophet ﷺ and becomes a trial for mankind, a tree associated in Sunni and Shīʿī exegesis alike with the Umayyad dynasty itself. The chronicler continues: a tree "uprooted from above the earth, having no stability" (Sūrat Ibrāhīm, 14:26). The language is not neutral. It is scriptural condemnation, theological erasure, the declaration that the Umayyads were not merely a defeated dynasty but a cursed lineage whose time had ended.

In Dhū al-Ḥijja 407/May 1016, ʿAlī ibn Ḥammūd entered Córdoba as a conqueror. The gates opened. The population, exhausted by a decade of civil war and desperate for any semblance of order, came out to receive him. He was proclaimed Amīr al-Muʾminīn—Commander of the Faithful—and acclaimed as al-Nāṣir li-Dīn Allāh. The Friday khuṭba was delivered in his name. Coins were struck bearing his titles. And for the first time in the history of al-Andalus, the name read from the minbar of the Great Mosque of Córdoba was not Umayyad. It was Ḥasanī. It was Idrīsī. It was Hāshimī. The Umayyad emirate of al-Andalus had fallen. And it had fallen to the descendants of those it had massacred.

The symbolism was overwhelming. Córdoba, the city that ʿAbd al-Raḥmān I had built as a refuge after his family was slaughtered by the Abbasids in the East. Córdoba, the city that had proclaimed itself the rival of Baghdad and the keeper of Umayyad legitimacy after Damascus fell. Córdoba, the city whose caliphs had allied with Mūsā ibn Abī al-ʿAfiya and the Zanāta to crush the Idrīsids in Morocco. That city now bowed to an Idrīsid caliph.

The revenge was not merely political. It was theological. It was historical. It was the inversion of Karbalāʾ: this time, the family of the Prophet ﷺ had won. It was the vindication of Fakh: the survivors had not been crushed but had returned. It was the answer to Wādī al-Shurafāʾ: for every sharīf beheaded at the river, a Umayyad dynasty had been beheaded at Córdoba.

And it was not temporary. ʿAlī ibn Ḥammūd ruled as caliph until his assassination in 408/1018—killed, as so many of his ancestors had been, by forces that could not defeat him openly and resorted to treachery. But his death did not restore the Umayyads. His brother al-Qāsim succeeded him, then ʿAlī's sons Yaḥyā and Idrīs, each proclaimed caliph in turn.

The Umayyads, who had ruled al-Andalus for nearly three centuries, were overthrown in Córdoba. Not by the Fatimids. Not by the Abbasids. But by an Idrīsid sharīf—a descendant of the family whose massacre at Wādī al-Shurafāʾ the Umayyads had enabled through their Zanāta allies.

By 422/1031, the Umayyad emirate of al-Andalus ceased to exist. Córdoba fragmented into mulūk al-ṭawāʾif—rival local rulers. And the Idrīsids, who had been massacred, hunted, and forced into hiding, had returned to rule in Córdoba itself, even if briefly.

This was not the restoration of the Idrīsid state in Morocco. That would not occur. But it was something more enduring: the demonstration that the Idrīsids had outlasted their persecutors. The Abbasids, who had poisoned Idrīs I and Idrīs II, were in terminal decline, their caliphate reduced to a ceremonial shell in Baghdad. The Fatimids, who had enabled Mūsā ibn Abī al-ʿAfiya, had moved to Egypt and abandoned the Maghrib. And now the Umayyads, who had allied with the Zanāta to crush the sharīfs, were gone.

Three empires had tried to erase the Idrīsids. All three had failed. And all three—Abbasid, Fatimid, Umayyad—would eventually collapse, while the descendants of Idrīs I, scattered across Morocco and al-Andalus, embedded in tribes and sanctuaries, remained.

The blood of Wādī al-Shurafāʾ had been answered. Not by the restoration of a centralized state. Not by the rebuilding of Fez as a caliphal capital. But by the erasure of the Umayyad name from al-Andalus, accomplished by men who had survived by becoming invisible and returned as conquerors when the moment allowed.

The lesson was clear: empires rise and fall. Dynasties come and go. But baraka, rooted in prophetic descent and sustained by the memory of martyrdom, endures across centuries and returns when least expected, not as lamentation but as reckoning.

8. Why Empires Fall and Baraka Endures: The Idrīsid Answer to Power

The question is not why the Idrīsid state fell. States fall. The question is why, after the state fell, the Idrīsids did not disappear. Why dynasties that conquered them eventually sought their blessing. Why every Moroccan ruler, from the Almoravids to the ʿAlawīs, needed them to legitimize power. Why a family that lost cities, armies, and treasuries—that was massacred, hunted, and driven into hiding—became more indispensable after losing political authority than they had been while holding it. The answer lies in a concept that Western scholarship has often misunderstood and Moroccan practice has never needed to explain: baraka. Not as metaphor, not as superstition, but as the operating principle that distinguishes between power that can be taken and authority that cannot.

O Dawud, what you have seen in me is what we have inherited from the baraka of our ancestor the Messenger ﷺ and from his prayers for us and blessings upon us. This baraka has passed on as a legacy to our father, the Imām Ali (ṣalawātu llāhi ʿalayhi).
— Mawlāy Idrīs II, as recorded by Dāwūd ibn al-Qāsim, in al-Tanāsī's Naẓm al-durr wa-l-ʿiqyān

When a companion of Mawlāy Idrīs II marveled at his master's qualities—his bravery, his strength, his firmness of resolve in battle against the Khārijites—the imām did not attribute these to personal talent or military training. He attributed them to baraka: the blessing inherited from the Prophet ﷺ, transmitted through ʿAlī ibn Abī Ṭālib, and manifesting in the Idrīsid line as a tangible, observable force.

Baraka, in Moroccan understanding, is not a quasi-physical force or spiritual electricity. It is personal presence, force of character, moral vividness—a quality some possess in greater measure than others, and which sharīfian saints possess in superlative degree. Like strength, courage, or intelligence, baraka is real, observable, and consequential. It shapes outcomes. It moves people. It endures across generations.

In the framework of Dabbagh’s Ibriz, it is more than this. Baraka is not merely a diffuse blessing; it is the continuity of Prophetic authority through blood, suffering, and guardianship. It is the branching of the Muḥammadan tree (shajara ṭayyiba) rooted in Abraham's supplication and Ismāʿīl's sacrifice, yet realized historically through the Ahl al-Bayt—the House that bore the weight of dispossession. It designates a Prophetic station accessible only to the Prophet ﷺ himself and to those of his bloodline. As such, baraka becomes the inner light of the Qurʾān in history, the sanctity of the ʿitra, the Fāṭimid ʿaṭfa (compassionate inheritance) shaped by loss, the ʿAlid imāma as moral sovereignty, and the Mahdian seal as deferred justice—an unbroken presence of the Prophet ﷺ with his lineage, not as memory, but as living guidance.

This is why the Idrīsids survived the fall of their state. Because what made them indispensable was never the state itself.

Jabal al-ʿAlam: The Sacred Mountain

If baraka is the continuity of Prophetic authority through blood and guardianship, then Jabal al-ʿAlam is where that authority took physical form in Morocco—not as palace or capital, but as mountain, sanctuary, and spiritual axis. Rising in the Ghomāra highlands of the western Rif, Jabal al-ʿAlam became the most sacred site in all of Morocco, more important than any city, more enduring than any throne. Pilgrims climbed its slopes not to petition a sultan but to seek the baraka of the sharīfs who dwelt there. Dynasties rose and fell in the plains below, but the mountain remained—constant, immovable, saturated with sanctity.

The supremacy of Jabal al-ʿAlam was not declared by decree. It was recognized through practice. By the 6th/12th century, the mountain had become the origin point of a new cultural phenomenon: Sabʿat Rijāl—the Seven Saints—a pilgrimage circuit that transformed sacred geography into ritual obligation. To visit the tombs of the seven ʿawliyāʾ scattered across northern Morocco was to trace a map of Idrīsī baraka made visible, a journey that embedded the memory of the sharīfs into the devotional life of ordinary Moroccans in ways no state could mandate or erase.

Mawlāy ʿAbd al-Salām ibn Mashīsh, Jabal al-ʿAlam (approx. 1,300 m), Chefchaouen Province, northern Morocco—located about 60 km southwest of Tétouan by road.

Mawlāy ʿAbd al-Salām ibn Mashīsh, Jabal al-ʿAlam (approx. 1,300 m), Chefchaouen Province, northern Morocco—located about 60 km southwest of Tétouan by road.

But Jabal al-ʿAlam was more than a pilgrimage site. It was an institution—a ribāṭ that functioned as school, court, refuge, and command center all at once. What made it supreme was not merely the sanctity of its shaykhs but the totality of its influence: it shaped how Moroccans spoke, how they learned the Qurʾān, how they understood Islam, how they celebrated the Prophet ﷺ, and how they resisted heresy.

Arabization flowed from Jabal al-ʿAlam. The mountain was a center of Qurʾānic learning, where young students came to memorize the Book under the tutelage of sharīfian masters. The Idrīsids, who had governed in Arabic, who had minted coins inscribed with Qurʾānic verses, who had delivered khuṭbas that fused prophetic lineage with Qurʾānic authority, did not abandon this mission when they lost political power. They continued it through teaching. The ribāṭ became the vehicle through which Arabic—not as the language of imperial administration but as the language of the Prophet ﷺ—spread into the Berber highlands. To learn the Qurʾān was to learn Arabic. To learn Arabic was to enter the Prophetic horizon. And to enter that horizon was to encounter the Idrīsids, who carried it in their blood and transmitted it through their teaching.

Jihād, both spiritual and physical, was declared from Jabal al-ʿAlam. The catastrophic defeat at Las Navas de Tolosa (Ḥiṣn al-ʿUqāb) in 609/1212 had shattered Almohad authority, and revolts erupted across Morocco as pretenders scrambled for power. In Ghomāra, Abū al-Ṭawājīn al-Kutāmī emerged as a false prophet wielding alchemical tricks. The Idrīsī master ʿAbd al-Salām ibn Mashīsh opposed him with argument and moral authority, not armies. According to Ibn al-Sakkāk's Nuṣḥ Mulūk al-Islām, Sultan al-Nāṣir (r. 595–610/1199–1213) saw the Idrīsī sharīfs as the real threat—legitimate descendants of the Prophet capable of rallying Morocco. In his final year, he imprisoned and executed Muḥammad ibn Yaʿqūb ibn ʿAbd Allāh, who had established an Idrīsī ribāṭ in Āyt ʿĪtāb. Al-Nāṣir died in 610/1213, but his anti-Idrīsī policy endured. In 625/1227, Abū al-Ṭawājīn ambushed and killed Ibn Mashīsh at dawn as he performed ablutions. The Almohads fell to the Marinids regardless.

The murder backfired. Martyrdom confirmed sanctity. Ibn Mashīsh's tomb on Jabal al-ʿAlam became one of the most important pilgrimage sites in Morocco, and his baraka—rather than dissipating—intensified. The mountain that had been a center of teaching became a center of pilgrimage. The shaykh who had opposed heresy through knowledge became, in death, the proof that baraka endures beyond the body. His presence on the mountain did not end. It multiplied, radiating outward through his descendants, his disciples, and the land itself, which absorbed his sanctity and returned it to those who climbed seeking blessing.

Healing and charity formed another pillar of Jabal al-ʿAlam’s authority. People ascended the mountain seeking release from illness, malignant spirits, infertility, chronic affliction, and cycles of misfortune believed to cling to bodies and households alike. Cure was not confined to technique or remedy but understood as a convergence of supplication, proximity, moral repair, and communal care. Acts of charity accompanied acts of healing: food was distributed, travelers sheltered, the poor sustained, and the vulnerable protected. In this integrated economy of mercy, baraka operated as a restorative force acting simultaneously upon body, soul, and society, rendering Jabal al-ʿAlam a refuge where physical suffering and unseen harm were addressed through presence, generosity, and the sanctity of place.

Mawāsim—seasonal gatherings—transformed Jabal al-ʿAlam into a living institution. These were not isolated pilgrimages but rhythmic convergences, annual or seasonal occasions when tribes, scholars, disciples, and seekers gathered at the mountain. A mawsim was market, assembly, school, and court all at once. Disputes were mediated. Marriages arranged. Knowledge transmitted. Baraka distributed. The mountain became a parliament without a state, a center of authority that required no palace, no army, no taxation—only the recognition that sanctity resided there and that those who carried it could adjudicate, teach, and bless in ways no sultan could replicate.

The Mawlid al-Nabawī—the celebration of the Prophet's ﷺ birthday—spread from the influence of Jabal al-ʿAlam. The fuqahāʾ of Sabta (Ceuta), the city across the strait that had long operated within the orbit of Idrīsī authority in northern Morocco, promoted the Mawlid as a means of centering Moroccan Islam on Prophetic love. The most influential proponent was Aḥmad al-ʿAzafī (d. 633/1236), who argued that the celebration would counter Christian influence on Muslims and new converts. Using the Mālikī principle of maṣlaḥa (public interest), he reframed the Mawlid—originally a Fatimid innovation—as a Sunni devotional practice that honored the Prophet ﷺ without doctrinal compromise.

By 691/1292, the Mawlid had spread from Sabta to Fez, Marrakesh, and across Morocco, becoming an official festival under Marinid patronage. But its origins lay in the spiritual atmosphere created by Jabal al-ʿAlam and the Idrīsī presence in the Rif. The celebration of the Prophet's ﷺ birth was inseparable from the presence of his descendants. To honor the Prophet ﷺ was to honor the sharīfs who lived among the people, who taught them, who mediated for them, and whose baraka made the Prophetic presence not a distant historical memory but a living reality.

The convergence of baraka, Mawlid devotion, and the sanctity of Mawlāy ʿAbd al-Salām reached its most condensed and enduring formulation in a prayer attributed to Ibn Mashīsh himself: the Ṣalāt al-Mashīshiyya, a blessing upon the Prophet ﷺ that would become one of the most widely recited litanies in the Islamic world. From its opening lines, the prayer articulates the Ḥaqīqa Muḥammadiyya not as an abstract metaphysical principle, but as a reality inseparable from the Prophet ﷺ and his ʿitra, through whom that reality remains present in history. It affirms that from the Prophet ﷺ “the secrets burst forth and the lights split open” (minhu inshaqqat al-asrār wa-infalaqa al-anwār), locating the source of all spiritual disclosure in a Prophetic essence that continues through lineage. The prayer’s concluding petition makes this architecture explicit: “O God, join me to his lineage (nasab) and verify me through his nobility (ḥasab).” This appeal is not metaphorical. It asks for grafting into the Prophetic genealogy itself—entry into the Muhammadan Reality through attachment to those who already bear it by birth. In this framework, the Idrīsids were not merely instructors of Islam; they presented themselves as custodians of an embodied Prophetic presence, offering access to the Ḥaqīqa Muḥammadiyya through their descent from the Prophet ﷺ.

Ibn Mashīsh's martyrdom in 625/1227 could have ended what he built. Instead, it multiplied. Two of his disciples would carry Jabal al-ʿAlam's teaching in opposite directions—one eastward through a Sufi order that would reshape the Islamic world, the other southward into the spiritual heart of Morocco's greatest capital.

The first was Abū al-Ḥasan al-Shādhilī (d. 656/1258), himself an Idrīsī sharīf, who studied under ʿAbd al-Salām ibn Mashīsh and founded the Shādhiliyya. The order spread from Morocco to Egypt, the Levant, sub-Saharan Africa, and beyond, its litanies (including the Ṣalāt al-Mashīshiyya) recited in zawāyā from Fez to Damascus to Jakarta, its silsila tracing back through Ibn Mashīsh to the Idrīsids and from them to the Prophet ﷺ. This was not the transmission of doctrine alone but the transmission of baraka through blood—an Idrīsī master teaching an Idrīsī disciple, who then carried Jabal al-ʿAlam's authority eastward and made it accessible to millions who would never see Morocco but would, through their recitation of prayers composed on the mountain, enter the orbit of Idrīsī mediation.

The second was Abū al-ʿAbbās Aḥmad ibn Jaʿfar al-Sabtī (d. 601/1204), from Sabta, who became the patron saint of Marrakesh—the city that would serve as capital for the Almoravids, Almohads, and Saʿdians. Al-Sabtī, who according to ʿAbd al-Raḥmān al-Fāsī studied under ʿAbd al-Salām ibn Mashīsh, brought to Marrakesh the social Sufism taught on Jabal al-ʿAlam—a practice rooted in charity (ṣadaqa) and good works (iḥsān). His method was not esoteric or exclusive but replicable and accessible, designed to be practiced by ordinary people in markets, homes, and streets. Even the Almohad ʿulamāʾ, who viewed him with suspicion, could not suppress him—his popularity was too great, his baraka too widely recognized.

That Marrakesh's spiritual protector was trained on Jabal al-ʿAlam by an Idrīsī master is not incidental. It means that every dynasty that ruled from Marrakesh governed a city whose sanctity was Idrīsī in origin. The Almohads, the Saʿdians, the ʿAlawīs—none could rule Marrakesh without operating within the spiritual geography al-Sabtī had shaped. The city's baraka was not theirs to grant. It had been given by a sharīf, transmitted from a mountain, and embedded so deeply in the urban fabric that no sultan could claim Marrakesh as truly his own.

In the 10th/16th century, another Idrīsī sharīf—ʿAbd Allāh al-Ghazwānī (d. 935/1528)—formalized and deepened this binding by establishing a chain of zawāyā linking Marrakesh to Jabal al-ʿAlam and promoting the annual pilgrimage to Mawlāy ʿAbd al-Salām's tomb as al-ḥajj al-aṣghar—a functional substitute for the pilgrimage to Mecca, which had become inaccessible due to Portuguese occupation of northern ports and Mediterranean instability. Al-Ghazwānī was restoring what al-Sabtī had established: the spiritual subordination of Marrakesh to the mountain, now rendered infrastructural through the road itself, which became a devotional corridor ensuring that every dynasty ruling the city remained dependent on an Idrīsī source of baraka they could never supplant.

Jabal al-ʿAlam was not a retreat. It was not a place where holy men withdrew from the world. It was the center from which the world was reorganized—through teaching, through pilgrimage, through the celebration of the Prophet ﷺ, through jihād against heresy, through the training of disciples who would carry Idrīsī baraka to the farthest reaches of the Islamic world, and through the infrastructure of zawāyā that bound distant cities like Marrakesh to the mountain's sanctity. It was the supreme ribāṭ because it performed every function a state performed—education, justice, mobilization, legitimation, and the construction of pilgrimage networks that could substitute for inaccessible sacred geography—without requiring armies, palaces, or taxes. It operated on baraka alone. And baraka, as Mawlāy Idrīs II had explained, was not a metaphor. It was the inheritance of Prophetic authority, transmitted through blood, recognized through devotion, and impossible to seize by force. The mountain could not be conquered. It could only be revered.

ʿAyn al-Fiṭr: The Institutional Proof

If Jabal al-ʿAlam represented the apex of sanctity, then ʿAyn al-Fiṭr, on the Atlantic coast near Mazaghan—the ancient Amazigh port known today as El Jadida—stood as the most unsettling proof that the Idrīsids had converted political defeat into spiritual permanence. The ribāṭ was established within the territorial boundaries of the Barghawāṭa emirate itself, the same power that had led the Battle of al-Ashrāf and remained ideologically and militarily hostile to any Qurashi authority for nearly three centuries. This was no marginal sanctuary. ʿAyn al-Fiṭr functioned as a contractual institution, operating under written charters repeatedly renewed across successive dynasties, from a position embedded in enemy space. Its endurance transformed rivalry into containment: while the Barghawāṭa ruled by force, the Idrīsids governed memory, discipline, and devotion. From this ribāṭ emerged the devotional literature and institutional continuity that carried Idrīsī influence far beyond Morocco, demonstrating that sanctity, once installed, could survive—and flourish—inside the borders of its adversaries.

The ribāṭ was founded by the Banū Amghār, descendants of ʿAbd Allāh ibn Idrīs II, who settled in the Dukkāla region after the collapse of the Idrīsid caliphate in 389/974. What the family could no longer maintain through governors and armies in Fez, they would now establish in Barghawāṭa territory—through teaching, arbitration, and baraka. The founder, Ismāʿīl Amghār, is said to have followed a "Ḥāshimite light" (al-nūr al-Hāshimī)—the Prophetic presence guiding him through the landscape—until it settled at ʿAyn al-Fiṭr, a site marked by a sacred spring. This was not merely hagiography. It was cosmology: baraka as ontological light, the Prophet ﷺ as the force that organizes geography, and the sharīf as the one who sees where that light settles and builds accordingly. Where Idrīsid armies had failed to penetrate, a single sharīf following Prophetic light succeeded.

When the Sanhāja Azammūr witnessed Ismāʿīl surrounded by Atlas lions during prayer, they recognized what they were seeing: baraka so concentrated it subdued nature itself. Their chief, ʿAbd al-ʿAzīz ibn Baṭṭār, immediately sought to bind the sharīf to his tribe. But when he tried to compel Ismāʿīl by force, the ground opened beneath his feet and held him until he apologized. The message was clear: baraka could not be coerced. It could only be recognized. Ibn Baṭṭār intermarried with the sharīf's family and appointed Ismāʿīl as imām and chief arbitrator of the Sanhāja Azammūr. This was governance by consent—not because the sharīf held a throne, but because the tribe understood that proximity to baraka was worth more than autonomy.

By 409/1018, this relationship had been formalized in writing. The Maghrāwī ruler of Fez, Tamīm ibn Zīrī ibn ʿAṭiyya, issued an edict authorizing the Banū Amghār to collect a share of the produce tax (kharāj) from the Sanhāja Azammūr as sustenance for the ribāṭ—so long as the sharīfs maintained their spiritual rank and did not relocate. This was not charity. It was a contract: the state recognized that the Banū Amghār performed a function the state could not—tribal arbitration, Qurʾānic education, and the maintenance of social order in a region no dynasty could govern directly. The Marinids renewed this zahīr in 696/1297, and then renewed it again in 743/1328, 833/1418, and 861/1446. Four renewals across two and a half centuries.

Abū Jaʿfar Isḥāq Amghār (d. 475/1060), son of the founder, formalized the physical complex of ʿAyn al-Fiṭr—building a congregational mosque, digging the well known as Tīn Gīdūt (Well of Abundance), and constructing a minaret of cut stone that still stands today. He also produced the earliest ʿaqīda (creed) written by a rural Moroccan religious figure, proving his mastery of Mālikī theology and his ability to respond to doctrinal challenges from as far as Sfax in Ifrīqiya.

But the most important innovation came under Abū ʿAbd Allāh Amghār (d. 563/1148), the third head of the ribāṭ. He founded the Ṭāʾifa Sanhājiyya—the earliest recorded example of an institutionalized Sufi order in Morocco and the Maghrib. The order was multiregional, claiming the allegiance of virtually every Sufi of Sanhāja origin between Dukkāla and the Moroccan Sahara. It operated on ten principles of companionship (shurūṭ al-ṣuḥba) that emphasized justice, generosity, forbearance, and the concealment of others' faults—a social Sufism designed not for esoteric elites but for pastoralists, farmers, and merchants who needed a spiritual framework that could function in markets, homes, and tribal assemblies.

Abū ʿAbd Allāh Amghār was recognized across Morocco as one of the most influential figures of his era. The Almoravid sultan ʿAlī ibn Yūsuf ibn Tāshfīn sought his blessing before constructing the defensive walls of Marrakesh—a project that cost seventy thousand gold dinars. An Almoravid zahīr from 527/1112 officially acknowledged him as a descendant of the Prophet ﷺ, the earliest formal state recognition of the Banū Amghār's sharīfian status. Yet when the sultan summoned all the ṣulaḥāʾ (righteous men) of Morocco to Marrakesh to confirm their oath of allegiance, Abū ʿAbd Allāh refused, citing "an extreme lack of care for the world." This was not defiance. It was a demonstration: the sharīf's authority did not flow from the sultan's recognition. The sultan's legitimacy flowed from the sharīf's blessing. And blessing could not be commanded.

From ʿAyn al-Fiṭr, disciples carried Idrīsī teaching across Morocco. Abū Shu’ayb al-Sāriya (d. 561/1156), trained by Abū ʿAbd Allāh Amghār, founded Ribāṭ Iliskāwīn and initiated Abū Yaʿzā Yalnūr (d. 572/1157), who in turn became the teacher of Abū Madyan (d. 594/1198)—the foundational figure of Maghribi Sufism. Every major Moroccan Sufi lineage traces back, through these chains, to ʿAyn al-Fiṭr. The ribāṭ was not a node in a network. It was the origin point of that network.

But the most consequential disciple was Muḥammad ibn Sulaymān al-Jazūlī (d. 869/1465), a sharīf from the Sanhāja Berber tribe of Sīmlāla in the Sūs. Between 843/1428 and 850/1435—seven years—al-Jazūlī studied at ʿAyn al-Fiṭr under Abū ʿAbd Allāh Muḥammad Amghār al-Ṣaghīr (d. 850/1435), who transmitted to him the Shādhiliyya ṭarīqa through the line of Abū ʿUthmān Saʿīd al-Hinṭārī of Ribāṭ Shīkar. What al-Jazūlī learned there was not merely Sufi doctrine. He learned the Idrīsī method: how to make devotion to the Prophet ﷺ accessible to ordinary Muslims, how to structure prayers that could be recited daily without requiring initiation into an order, and how to bind the believer to the Prophet ﷺ through love rather than law.

After leaving ʿAyn al-Fiṭr, al-Jazūlī composed the Dalāʾil al-Khayrāt (Proofs of Good Deeds)—a collection of prayers upon the Prophet ﷺ that would become the most widely circulated devotional text in Islamic history. Printed in Cairo, Istanbul, Fez, and beyond, recited from Morocco to Indonesia, memorized by millions, the Dalāʾil made Prophetic devotion a mass practice. And its author had been trained by the Idrīsids. The prayer book that shaped global Islamic piety in the early modern period was an Idrīsī product—not because al-Jazūlī was Idrīsī by blood, but because the pedagogy he absorbed at ʿAyn al-Fiṭr was Idrīsī in method, in theology, and in purpose.

ʿAyn al-Fiṭr was not peripheral. It was not a rural sanctuary disconnected from the centers of power. It was the place where the Idrīsids proved that authority could be contractual, that governance could operate without sovereignty, and that influence could be global without requiring an empire. The ribāṭ functioned for five centuries—longer than any Moroccan dynasty. It trained the disciples who founded Morocco's Sufi orders. It produced the devotional literature that millions would recite. And it did all of this not by claiming power but by demonstrating that baraka, when institutionalized, was more durable than any throne.

Aglū: The Ribāṭ That Built an Empire

Ribāṭ Aglū, near Tīznīt in the Sūs, was founded by Waggāg ibn Zallū (d. 445/1054), a descendant of Yaḥyā ibn Idrīs II. This was the second documented educational ribāṭ in Morocco, replicating the model established by the Banū Amghār at ʿAyn al-Fiṭr. What Kanza's dispersal of Idrīs II's sons in 221/836 had produced, by the 5th/11th century, was a network of Idrīsī institutions positioned across Morocco's periphery—institutions that would become the instrument through which distant imperial powers attempted to reshape the Maghrib.

The appearance of Mālikism in the Maghrib was not organic. It was orchestrated from Baghdad as part of the ʿAbbāsid effort to destroy the Fāṭimid state in its homeland. Mālikism had entered al-Andalus around 200/815, becoming the official madhhab of the Umayyad emirate. By the early 5th/11th century, Mālikī scholars operating between Kairouan, Fez, and Córdoba had become the vanguard of Sunni resistance to Fatimid Ismāʿīlism. To adopt Mālikism was to signal allegiance to Sunnī imperial orthodoxy—Umayyad in the west, ʿAbbāsid in the east—and to commit to the destruction of the Fāṭimids, who threatened both.

Abū ʿImrān al-Fāsī, a Mālikī jurist trained in Fez and exiled by the Zanāta Ifrānids (who rejected Mālikism and thus rejected Sunnī imperial alignment), relocated to Kairouan and became a key node in this network. But Kairouan, under Fāṭimid pressure, could not serve as the base for military action. The Maghrib itself—resistant to Umayyad conquest, resistant to ʿAbbāsid influence, resistant even to Fāṭimid control—proved once again ungovernable by eastern powers. The solution was not to conquer the Maghrib from outside. It was to activate forces within it—forces with local legitimacy, tribal alliances, and the infrastructure to mobilize populations that no eastern empire could reach. That force was the Idrīsids.

Waggāg ibn Zallū had been trained in the Mālikī network—studying under Abū ʿImrān in Kairouan, under Ibn Abī Zayd al-Qayrawānī, and in al-Andalus under Umayyad scholars. He returned to Morocco and established Ribāṭ Aglū in the Sūs, beyond the control of any dynasty, in Ṣanhāja tribal territory that had long recognized Idrīsī authority. When Abū ʿImrān needed to build a Mālikī counter-revolution—to destroy the Zanāta regimes in Fez, eliminate the Barghawāṭa heresy, and impose Mālikī orthodoxy across Morocco—he did not turn to Baghdad or Cordoba for armies. He turned to Waggāg.

In 427/1035, Yaḥyā ibn Ibrāhīm al-Gudālī, chief of the Lamtūna Ṣanhāja—a powerful confederation controlling the Adrar region in what is now the eastern Moroccan Sahara—was directed to Waggāg by Abū ʿImrān. Waggāg selected ʿAbd Allāh ibn Yāsīn al-Jazūlī (d. 451/1059), a student trained for seven years in al-Andalus—ideologically formed in Umayyad-Mālikī orthodoxy—and sent him to the eastern Sahara. Ibn Yāsīn built the Almoravid movement: a Ṣanhāja military force, Mālikī-aligned, trained to conquer Morocco and impose the madhhab that Baghdad and Cordoba required but could not install themselves.

The Almoravids entered Fez in 462/1070, destroyed the Ifrānids, and made al-Qarawiyyīn—founded by the Idrīsids—exclusively Mālikī for the first time. They conquered al-Andalus, unified the Maghrib, and ruled for a century. But they did not do this on their own initiative. They were the armed wing of a Mālikī network that stretched from Baghdad to Kairouan to the Sūs—a network that depended, at its critical operational node, on an Idrīsī ribāṭ.

The Almoravids also destroyed Barghawāṭa, the heretical confederation that had persisted on the Atlantic plains for centuries, whose doctrine had long been a thorn in the side of Moroccan orthodoxy. The Almoravid conquest was ruthless and total, erasing Barghawāṭa from history and re-Islamizing the region under Mālikī law.

Here is the paradox: the Maghrib had resisted the Umayyads, the ʿAbbāsids, and the Fāṭimids. No eastern power could govern it directly. Yet the Idrīsids—who had lost their caliphate in 389/974, who held no armies, who ruled no cities—could activate the forces necessary to impose the very orthodoxy those empires demanded. The ʿAbbāsids needed Mālikism to destroy the Fāṭimids. The Umayyads needed it to maintain ideological coherence. But neither could make it happen in Morocco. Only the Idrīsids could. Not through conquest, but through baraka—through the recognition, by Ṣanhāja tribes, that a sharīf's selection of a student, a sharīf's blessing of a movement, carried more weight than any imperial edict.

When Yūsuf ibn Tāshfīn (d. 500/1106), the greatest of the Almoravid sultans, crossed the strait into al-Andalus to fight the Christian kingdoms, he brought with him an Idrīsī sharīf—Abū al-Ḥasan ʿAlī ibn ʿAbd al-Raḥmān (fl. 479/1086), great-grandfather of the mystic ʿAbd al-ʿAzīz al-Dabbāgh. The sources are explicit: bi-qaṣd al-tabarruk bihi—for the purpose of seeking blessing through him. Ibn Tāshfīn commanded tens of thousands of soldiers and ruled an empire from Senegal to Zaragoza, yet he would not wage war without an Idrīsī at his side.

Empires needed the Idrīsids to accomplish what they could not. And when the empire faded—when the Almoravids fell, when the Umayyad collapsed, when the ʿAbbāsids ceased to matter—the Idrīsids remained. The ribāṭ at Aglū continued. Waggāg's descendants—Īdaw Samlāl, Āyt Ṣwāb, Īda Gnīḍīf, Hashtūka, Āyt Mzāl—governed the Sūs for centuries. And the annual mawsim at Waggāg's tomb is still held today.

Waggāg died in 445/1054. But he had demonstrated what the ribāṭ system could do: it could turn the Maghrib's resistance to eastern power into the instrument of eastern power—by making Idrīsī baraka the indispensable bridge between imperial ambition and Maghribi reality. The Idrīsids did not need a throne. They needed only to be recognized. And once recognized, they could build empires for others—and survive long after those empires fell.

Ribāṭ Ūrīqa and the Rise of the Almohads

The ribāṭ of Ūrīqa, in the foothills of the High Atlas south of Marrakesh, reveals what the other ribāṭs could not: that Idrīsī authority was inseparable from tribal geography, and that the location of a ribāṭ determined which revolts it could launch. Ūrīqa was in Maṣmūda territory—the same tribal confederation that had welcomed Mawlāy Idrīs I in 172/788, sheltered him among the Awraba, and provided the base from which the Idrīsid state was built. The Maṣmūda had been programmed, from the beginning, to recognize sharīfian authority. And when the Almoravids—a Ṣanhāja dynasty—made the fatal error of building their capital, Marrakesh, in Maṣmūda land, they created the conditions for their own destruction.

The man who destroyed them was Muḥammad ibn ʿAbd Allāh ibn Tūmart (d. 524/1130), an Idrīsī sharīf from the High Atlas. His genealogy, preserved by Ibn Khallīkān, traces through Idrīs II: Muḥammad ibn ʿAbd Allāh b. Wagallīd b. Yamsāl b. Ḥamza b. ʿĪsā b. ʿAbd Allāh b. Idrīs II b. Idrīs I. The contemporary historian ʿAbd al-Wāḥid al-Marrākushī confirms this, reporting that among the Hargha Berbers of the Sūs River valley, Ibn Tūmart's family were known as isargkinen—"the sharīfs"—in the Maṣmūda dialect. This was not a retrospective claim. It was local knowledge, transmitted orally, the kind of recognition that precedes genealogical texts and carries more weight.

Ibn Tūmart studied in Cordoba, Baghdad, and Cairo, absorbing al-Ghazālī's theology (Ashʿarī kalām, Sufi reform of jurisprudence), Fāṭimid messianism (the Mahdī as divinely guided restorer), and Idrīsī identity (sharīfian legitimacy rooted in the Prophet's ﷺ family). He returned to Morocco around 514/1120 and began preaching against the Almoravids, condemning their Mālikī jurists for rigidity, their sultan for moral corruption, and their rule for being un-Islamic. He proclaimed himself the Mahdī and called for a return to the Qurʾān and Sunna under the leadership of Ahl al-Bayt.

But the theology was secondary. What mattered was the geography. Ibn Tūmart established his base at Tīnmal, deep in the High Atlas, in the heart of Maṣmūda territory. The Maṣmūda, who had lived under Ṣanhāja rule since the Almoravids built Marrakesh in their land, recognized in Ibn Tūmart what their ancestors had recognized in Mawlāy Idrīs I: a sharīf who could organize them, who could transform tribal resentment into religious legitimacy, and who could promise liberation from external domination. Ibn Tūmart did not need to convince the Maṣmūda that sharīfian authority was real. That was already embedded in their collective memory. He needed only to present himself as the latest incarnation of it.

The Almohad revolt was tribal revenge dressed as theological reform. The Maṣmūda rose against the Ṣanhāja Almoravids, and they did so under the banner of an Idrīsī Mahdī. Ibn Tūmart died in 524/1130, before the conquest was complete. But his successor, ʿAbd al-Muʾmin al-Gūmī (d. 558/1163), was himself Idrīsī—descended through his mother from Ganūna bint Idrīs II, one of the daughters of the second imām. ʿAbd al-Muʾmin was Zanāta by paternal lineage (from Tlemcen), but his Idrīsī descent through Ganūna gave him the legitimacy to lead a Maṣmūda movement and transcend tribal divisions. He conquered Marrakesh in 541/1147, destroyed the Almoravids, and proclaimed himself caliph.

The Almohad Caliphate—stretching from Tripoli to the Atlantic, from the Sahara to the Ebro—was the largest empire ever built in the Maghrib. It was also an Idrīsī empire. ʿAbd al-Muʾmin built the Kutubiyya Mosque in Marrakesh and the Giralda in Seville. His court became one of the most intellectually vibrant in medieval Islam, where Ibn Rushd (Averroes) wrote his commentaries on Aristotle and Ibn Ṭufayl composed Ḥayy ibn Yaqẓān. And all of it began with an Idrīsī sharīf operating from a ribāṭ in Maṣmūda territory, exploiting the tribal geography the Almoravids had foolishly ignored.

The lesson of Ūrīqa was not that Idrīsī authority was universal. It was that Idrīsī authority was geographic—it worked where tribes had been conditioned, through centuries of interaction, to recognize it. The Maṣmūda had welcomed Mawlāy Idrīs I. They welcomed Ibn Tūmart. The Ṣanhāja had supported the Idrīsids at ʿAyn al-Fiṭr and built the Almoravids at Aglū. But when the Almoravids tried to rule Maṣmūda land without Maṣmūda consent, they created the space for an Idrīsī revolt. And the Idrīsids, operating from ribāṭs embedded in the right tribal territories, could always find the force to destroy any dynasty that forgot this.

The ribāṭ system established the infrastructure through which Idrīsī authority would endure: institutions embedded in tribal territories, operating beyond the reach of any capital, training the students and legitimizing the movements that would shape Moroccan history for centuries. What the Idrīsids built in the periphery would prove more durable than any throne.

8. From Patronage to Throne: The Sharīfian Takeover

After the Almohads came the Marinids (592/1196–869/1465), a Zanāta Berber dynasty that was not sharīfian in origin but understood that they could not govern Morocco without honoring those who were. The Marinids renovated the tomb of Mawlāy Idrīs II in Fez, transforming it into one of the most magnificent sanctuaries in the Islamic world, with a green-tiled roof, marble columns, carved stucco, and cedarwood screens. They did not do this out of piety alone. They did it because legitimacy in Morocco flowed through the Idrīsids, and a dynasty that neglected the sharīfs risked losing the allegiance of the population.

But patronage was not enough. In Ramaḍān 869/May 1465, the Marinid sultan ʿAbd al-Ḥaqq II—frustrated by the power of Fez's elite and their support for his former governors, the Waṭṭāsids—instructed his Jewish ministers to collect taxes from two previously exempt categories: the sharīfs and the ʿulamāʾ. This was not merely a fiscal decision. It was an assertion that the sultan's authority superseded sharīfian privilege. The response was immediate and total. A scholar from al-Qarawiyyīn, ʿAbd al-ʿAzīz al-Waryāghilī (d. 880/1475), incited the inhabitants of Fez to revolt. The sultan was killed, his throat cut. And in his place, al-Waryāghilī selected a new ruler: Muḥammad al-Ḥafīḍ al-Imrānī al-Jūṭī, an Idrīsī sharīf and leader of Fez's sharīfian community.

For the first time since the collapse of the Idrīsid caliphate in 389/974—nearly five centuries—a sharīf ruled Morocco. This time, however, he was not chosen by tribal confederations or installed by a ribāṭ network. He was chosen by an alliance of urban notables, scholars, and the sharīfian families of Fez itself. Though Muḥammad al-Ḥafīḍ's state lasted only six years, his assumption of power marked a turning point: it demonstrated that no non-sharīfian dynasty could rule Morocco without sharīfian consent, and that when consent was withdrawn, the sharīfs themselves could seize the throne.

The formalization of sharīfism as political ideology came through Muḥammad ibn Sulaymān al-Jazūlī (d. 869/1465), the sharīf who had studied for seven years at ʿAyn al-Fiṭr under the Idrīsī Banū Amghār. Al-Jazūlī did more than compose the Dalāʾil al-Khayrāt. He transformed what the ribāṭs had practiced for centuries—governance through baraka, teaching, and arbitration—into an explicit political theology: that sharīfian descent conferred authority over all temporal rulers, and that this authority could be mobilized, organized, and deployed to reshape Morocco.

In less than thirteen years, al-Jazūlī attracted more than 12,000 followers. This was not a contemplative circle. It was an organized movement with distinctive practices—shaving the head, wearing specific garments, practicing ziyāra (visitation of spiritual masters)—that marked the Jazūliyya as a corporate body with its own rituals, leadership, and command structure. What the Idrīsī ribāṭs had done informally—training students, mediating disputes, distributing baraka—the Jazūliyya now did systematically, at scale, under a unified sharīfian banner.

Al-Jazūlī's teaching rested on three revolutionary claims, each of which borrowed from—and weaponized—existing models of authority that had shaped the Islamic world.

  • First, he argued that sharīfian authority constituted a polity (dawla) separate from and superior to any temporal kingdom—a state of salvation rather than sovereignty. This was the Mahdist claim adapted: Ibn Tūmart had proclaimed himself the Mahdī and built the Almohad empire on the premise that his divine election superseded all temporal authority. Al-Jazūlī borrowed this eschatological framework but redirected it: instead of a single Mahdī whose death would end the claim, al-Jazūlī positioned the entire sharīfian class as permanent carriers of Mahdist authority. The polity of the sharīfs was eternal, not contingent on one man's life. This transformed the Almohad revolution from an event into a structure.

  • Second, he positioned the great awliyāʾ—especially those descended from the Prophet ﷺ—as occupying the station of prophethood (maqām al-nubuwwa). This was the Khatmiyya doctrine radicalized: the idea, articulated by Ibn ʿArabī and others, that after the "seal of prophethood" (khatm al-nubuwwa) there remained the "seal of sainthood" (khatm al-walāya)—that the awliyāʾ inherited the Prophet's ﷺ function without his legislative role. Al-Jazūlī weaponized this: if the saints inherit the Prophet's ﷺ function, and the saints are predominantly sharīfs, then the sharīfs are the living continuation of prophethood. They do not receive revelation, but they reveal divine secrets. They do not legislate, but they govern souls. Every created being, al-Jazūlī insisted, depends on these axial saints (aqṭāb). Without them, the world would collapse. This made sharīfian authority not merely useful but ontologically necessary.

  • Third, and most institutionally sophisticated, al-Jazūlī demanded exclusive devotion to sharīfian masters in terms that borrowed directly from the Niẓāmiyya model—the Baghdadi system of disciplined tarbiya designed to counter Fāṭimid Ismāʿīlī claims by creating a Sunnī pedagogy of total obedience to the shaykh. The Niẓāmiyya had taught that the disciple must surrender completely to his master, treating him as the sole source of spiritual guidance, never turning to other authorities. Al-Jazūlī adopted this exclusivist framework but redirected it: the shaykh worthy of such devotion was not merely any trained scholar but specifically a sharīf—one whose authority derived from Prophetic blood, not pedagogical credentials. This collapsed the distinction between charismatic and institutional authority: the sharīf was both. He carried the Niẓāmiyya's demand for obedience but rooted it in genealogy rather than curriculum. To his disciples, al-Jazūlī declared that they now held authority over the ʿulamāʾ—that those who had been grafted into the Prophetic lineage through spiritual initiation superseded the jurists entirely.

And to his disciples, al-Jazūlī declared that they—having received his teaching, having been grafted into the Prophetic lineage through spiritual initiation—now held authority over the ʿulamāʾ. The jurists, with all their expertise in fiqh and ḥadīth, were subordinate to those who carried baraka. This was the final inversion: sharīfian descent, or attachment to sharīfian masters, superseded scholarly credentials entirely.

In a manifesto that circulated widely among his followers, al-Jazūlī declared:

Reputation is not secured through wealth or children; it is measured by one’s standing before the Lord of Lords... A person is not great because of the greatness of his tribe or his desire for high rank; he is great because of the greatness of nobility (sharaf) and lineage (nasab).. anā sharīfun fī al-nasab—my lineage is noble. My ancestor is the Messenger of God ﷺ, and I am closer to him than all of God’s creation. My reputation is eternal, dyed in gold and silver. O you who seek gold and silver—follow us. For whoever walks in our path abides in the highest ranks of ʿIlliyyūn in this world and the next. The nations of old longed to be admitted into our polity, yet none may enter it unless he has already tasted salvation (saʿāda). Our polity is the realm of those who strive and contend in the path of God—those who stand against the enemies of God. The sultans of the earth are in my hands and beneath my feet.
— Al-Jazūlī in his Muhadathat

This was the Idrīsī claim perfected. What Mawlāy Idrīs II had articulated in the 3rd/9th century—that baraka was the inheritance of Prophetic authority, transmitted through blood—al-Jazūlī now weaponized as total political program. Sharīfian lineage was not one source of authority among many. It was the only source that mattered. Tribal greatness, wealth, scholarly expertise, even royal power—all were subordinate to nasab, to the bloodline that linked a man to the Prophet ﷺ. And those who possessed that lineage, or who attached themselves to it through discipleship, held dominion over "the sultans of the earth."

Al-Jazūlī proved the claim empirically: 12,000 followers in thirteen years, organized under sharīfian leadership, capable of challenging any dynasty. The ribāṭ system had shown that baraka could govern without sovereignty. The Jazūliyya showed that baraka could seize sovereignty—and that when it did, no non-sharīfian ruler could survive.

Al-Jazūlī's teaching was not diluted by his successors—it was sharpened. ʿAbd al-ʿAzīz al-Tabbāʿ (d. 914/1508), the second paramount shaykh (shaykh al-jāmiʿa) of the Jazūliyya, articulated what al-Jazūlī had implied: that the Sufi master who could claim lineal descent from the Prophet ﷺ exercised spiritual authority over his followers by virtue of divine right. This was not metaphor. It was constitutional doctrine. The sharīfian shaykh did not derive his authority from scholarly consensus, pedagogical credentials, or institutional appointment. He derived it from blood—from the fact that Prophetic light flowed in his veins, and this light conferred a right to obedience that no human institution could grant or revoke.

Al-Tabbāʿ's student, al-Ghazwānī—the Idrīsī sharīf who had established the pilgrimage infrastructure linking Marrakesh to Jabal al-ʿAlam—transformed this claim into a complete theological system. In a letter addressed to Morocco's ‘Alami sharifs, scholars, and fuqarāʾ, al-Ghazwānī articulated the Jazūlī silsila as the sole legitimate path to God. And critically, he anchored the entire chain in "the axial sainthood that is the legacy of your ancestor Mawlāy ʿAbd al-Salām ibn Mashīsh" (al-quṭbāniyya allatī hiya mīrāth jadikum)—the Idrīsī master of Jabal al-ʿAlam whose tomb al-Ghazwānī had just finished transforming into Morocco's answer to Mecca. This was a claim to monopoly. The letter was a manifesto: sharīfian authority was total, the Idrīsī-Jazūlī chain was supreme, and Morocco's spiritual geography flowed from Jabal al-ʿAlam through the masters who carried its baraka.

But al-Ghazwānī went further than establishing genealogical supremacy. He developed a theology of sainthood that solved the problem the Niẓāmiyya had created: how to generate devotion to a shaykh comparable to Shīʿī devotion to the Imām without conceding the Imām's metaphysical claims. Al-Ghazwānī's solution was audacious: he conceded the claims—but redirected them to sharīfian saints.

Al-Ghazwānī articulated a hierarchy of sainthood (wilāya) that culminated in a figure he called the Jaras (the Bell)—a saint whose authority was "comparable to that of the Prophet himself." The path to this station unfolded through stages. The saint begins with divine inspirations (walāyat al-ilhām), learns to interpret them (walāyat al-fahm), and eventually becomes imbued with the divine Logos itself (walāyat al-kalām)—speaking not his own words but the words of God. At the highest stage, the saint perceives Reality without needing to extinguish his sense of self (walāyat al-naẓar bilā fanāʾ), hears the "reverberation" of divine discourse at all times (walāyat al-samʿ bilā taḥdīd), and answers petitioners' needs with miracles bestowed as divine tokens of intimacy (walāyat al-istijāba wa-al-istiḥbāb).

Having reached this level, the saint is now empowered to exercise authority on earth (wilāya)—not merely spiritual guidance but political power. This authority manifests in three forms: the authority to interpret God's laws (wilāyat al-ḥukm), the authority to issue commands (wilāyat al-amr), and finally, the authority to dispose of the affairs of others (wilāyat al-taṣarruf)—the very claim the Fāṭimid Imāms had made, that they could govern creation through divine authorization.

But even this was not the summit. Al-Ghazwānī distinguished between saints whose authority remained "contingent" (wilāyat al-tamkīn)—limited by time and space, effective only in specific contexts—and the supreme saint whose authority was universal and unlimited (tamkīn munazzah). This was the Jaras, the Bell saint, and his defining characteristic was ʿiṣma—infallibility.

This was the forbidden claim. The Niẓāmiyya system had spent centuries constructing an architecture of Sunnī tarbiya designed to prevent precisely this: the return of a figure whose authority approached prophetic infallibility, whose commands could not be questioned, and whose taṣarruf (cosmic disposal) made him a rival to caliphs and sultans. Yet here was al-Ghazwānī, an Idrīsī sharīf operating from Marrakesh in the early 10th/16th century, calmly asserting that such a figure not only existed but was necessary—and that he was, inevitably, a sharīf.

The consequences were immediate and irreversible. Al-Ghazwānī's theology became state-building ideology. Within decades of his death in 935/1528, Morocco produced its first successful sharīfian dynasty since the Idrīsids—the Saʿdians, who rose to power through Jazūlī networks. When the Saʿdians fell, they were replaced by another sharīfian dynasty—the ʿAlawīs—who have ruled for over three and a half centuries. This was the fulfillment of the Idrīsī evolution: from ribāṭ (governance without sovereignty) to Jazūlī theology (sharīfism as ontological necessity) to sharīfian state (rule through Prophetic descent as the only legitimate form of power). The Idrīsids had built the system. The Jazūliyya had provided the doctrine. And Morocco, by the mid-10th/16th century, had made sharīfian rule permanent.

The consequences were immediate and irreversible. Al-Ghazwānī's theology became state-building ideology. Within decades of his death in 935/1528, Morocco produced its first successful sharīfian dynasty since the Idrīsids—the Saʿdians (910/1495–1069/1659), who rose to power not through tribal conquest or military superiority but through Idrīsī and Jazūlī networks. The Saʿdians were sharīfs from the Draa Valley, claiming descent from the Prophet ﷺ through al-Ḥasan ibn ʿAlī. But their legitimacy came not from genealogy alone—it came from the fact that the Jazūliyya mobilized Morocco on their behalf. Al-Jazūlī had declared that "the sultans of the earth are in my hands and under my feet." His disciples proved it. They convinced tribes, scholars, and urban populations that only sharīfs could rule, and that the Saʿdians—leading jihād against the Portuguese, carrying Prophetic blood, and aligned with Jazūlī ideology—were Morocco's rightful rulers.

The Saʿdians built an empire. From Tanga to Senegal, from the Atlantic to the Niger, they dominated the trans-Saharan gold routes and asserted Morocco as both a Mediterranean and African power. They halted Ottoman expansion at the Battle of Wādī al-Labān (965/1558), crushed Portuguese ambitions at the Battle of Wādī al-Makhāzin (986/1578), and projected Moroccan power deep into the Sahel with the invasion of Songhai, culminating in the victory at Tondibi (999/1591). For the first time since the Idrīsids, a sharīfian dynasty ruled Morocco not merely by force of arms but through ideological conviction, establishing Prophetic descent as the sole legitimate foundation of political authority.

Yet the Saʿdians collapsed within 150 years. Despite their sharīfian lineage, despite the Jazūlī networks that had brought them to power, despite their military victories and vast territories, the dynasty fragmented into civil war, rival claimants, and Sufi-led rebellions. Why? Because the very networks that had built the Saʿdian state now turned against it—and because sharīfian baraka, however potent, was not enough to hold Morocco together when crisis struck.

The crisis revealed a structural problem: saints and Sufi orders had never stopped interfering in Moroccan politics. They had made the Saʿdians; now they unmade them. When epidemics devastated cities, when civil war erupted between Saʿdian princes, when the central authority weakened, Sufi orders did not merely withdraw into prayer—they built rival states.

The Dilāʾiyya, founded by the Jazūlī-trained Abū Bakr al-Majjāṭī al-Dilāʾī (d. 1021/1620), controlled northern Morocco from the 1050s–1070s/1640s–1660s, including Fez itself. They collected taxes, administered justice, commanded armies, and governed as a Sufi state-within-a-state. Though not Idrīsī sharīfs themselves, they operated through the same ribāṭ model the Idrīsids had invented—governance through teaching, arbitration, and baraka—and they demonstrated that Sufi networks could replace dynastic authority entirely when the makhzan faltered.

Even more dramatically, Aḥmad Ibn Abī Maḥallī (967–1022/1560–1613), an ʿAbbāsid Hāshimite scholar and former military commander under Mawlāy Zaydān (r. 1012–1037/1603–1627), emerged from Figuig—the Idrīsī Saharan capital—and declared himself Mahdī in 1021/1612. Though his lineage traced to the ʿAbbāsids rather than the Idrīsids, his revolt was entirely shaped by Idrīsī infrastructure. Figuig had functioned for centuries as an Idrīsī outpost in the eastern Sahara, a node in the ribāṭ network that extended Morocco's spiritual authority deep into the desert. The city's zawāyā, its scholars, and its tribal alliances were all products of Idrīsī embedding—the same process that had turned Tīznīt, ʿAyn al-Fiṭr, and Jabal al-ʿAlam into centers of baraka and learning.

Within months, he had seized Marrakesh itself, proclaiming that the time had come for the true Hāshimite ruler—not the decadent, compromised Saʿdians—to restore Morocco to Prophetic governance. His movement collapsed within a year when Saʿdian forces killed him in battle, but the revolt proved something essential: Idrīsī infrastructure could mobilize ANY sharīf, regardless of lineage, as long as he operated within Idrīsī-controlled geography and adopted the sharīfian-Mahdist rhetoric the Idrīsids had normalized.

The pattern was clear: the Idrīsī-Jazūlī infrastructure that had made sharīfian rule inevitable could also fragment it. When multiple actors—dynastic princes, Sufi shaykhs, Mahdist claimants—possessed sharīfian descent or sharīfian backing, and when each could mobilize ribāṭs, zawāyā, and tribal networks, baraka became a source of civil war rather than unity. The Saʿdians had proven that Jazūlī ideology could build empires. The Dilāʾiyya and Ibn Maḥallī proved that it could also destroy them.

When the ʿAlawīs arrived in the mid-11th/17th century, they inherited the same advantages as the Saʿdians—and the same dangers. They were sharīfs, descended from the Prophet ﷺ through Muḥammad al-Nafs al-Zakiyya, whose revolt against the ʿAbbāsids in 145/762 had made him a martyr for ʿAlawī legitimacy. They commanded tribal support, carried Prophetic descent, and could invoke the same Jazūlī rhetoric that had elevated the Saʿdians. But they understood what the Saʿdians had not: that baraka and sharīfian ideology, however necessary, were insufficient. To rule Morocco was not merely to claim Prophetic descent—it was to negotiate with the Idrīsī saints and Sufi orders whose interference had become the permanent structure of Moroccan politics.

Mawlāy Rashīd (r. 1075–1082/1664–1672), the first ʿAlawī sultan to consolidate power, demonstrated this immediately. In 1078/1668, he destroyed the Sufi headquarters at Dilāʾ and Tāzarwalt, ending their autonomous Sufi state. But he did not attempt to suppress Idrīsī authority itself. Instead, he integrated it into the makhzan. He renovated the shrines of Mawlāy Idrīs I and Mawlāy Idrīs II. He granted Idrīsī families control over sanctuaries, revenues from pilgrimage sites, tax exemptions, and formal recognition through royal ẓahīrs. When he died in 1082/1672, he was buried not in a new ʿAlawī necropolis but at the shrine of ʿAlī ibn Ḥarazim (d. 559/1163) in Fez—a shrine administered by the Idrīsī Dabbāgh family. The message was unmistakable: ʿAlawī sovereignty required Idrīsī blessing.

This was the ʿAlawī strategy, refined over the following decades: make Idrīsī authority part of the state. The Idrīsids controlled Morocco's most sacred sites—Mawlāy Idrīs I in Zerhoun, Mawlāy Idrīs II in Fez, ʿAbd al-Salām ibn Mashīsh on Jabal al-ʿAlam, and countless smaller shrines embedded in every region. The ʿAlawīs did not attempt to replace this network. They absorbed it. They granted pensions to prominent Idrīsī families, exempted sharīfs from taxes, and ensured that every major mawsim (pilgrimage festival) was renewed, funded, and publicly honored by the makhzan. The sultan did not rule above the Idrīsids. He ruled alongside them, in a system where his baraka (political authority, Amīr al-Muʾminīn, military force) and their baraka (spiritual authority, wilāya, intercession) were mutually constitutive.

Baraka and sharīfism, as the ʿAlawī system demonstrated, are highly malleable concepts whose content and operation are negotiated among sultan, saint, and the historical conditions which offer a range of possibilities. The ʿAlawīs understood that negotiation, not suppression, was the key to durability. Where the Saʿdians had persecuted the Jazūliyya after gaining power—executing or exiling figures like ʿAbd al-Karīm al-Fallāḥ (d. 933/1527) on charges of heresy—the ʿAlawīs accommodated potential rivals before they became threats. They positioned the makhzan not as a replacement for Idrīsī spiritual infrastructure but as its guardian and patron.

Yet the Idrīsids never fully accepted subordination. On several occasions across the ʿAlawī centuries, Idrīsī saints tested whether sharīfian authority could be redirected away from the throne and back to them—whether the ribāṭ model could once again supersede the makhzan, whether baraka rooted in sanctuaries could override baraka seated on thrones.

Mawlāy al-Ṭuhāmī al-Wazzānī (d. 1127/1715), an Idrīsī sharīf leading the Wazzāniyya ṭarīqa from his base in the Rif mountains, built an independent network of zawāyā, commanded tribal loyalty, and operated as a parallel sovereignty that the ʿAlawī sultan Mawlāy Ismāʿīl (r. 1082/1672–1139/1727) could neither destroy nor ignore. The Wazzāniyya influence extended beyond northern Morocco into Tuwāt and Kanādisa in the eastern Sahara—performing all the functions of governance without requiring the sultan's permission. Mawlāy Ismāʿīl, ruthless as he was, negotiated rather than confronted. He honored al-Wazzānī, renewed his family's privileges, and allowed the Wazzāniyya to operate autonomously—because to suppress them would have alienated the very tribes and scholars whose support kept the makhzan stable.

A century later, al-ʿArabī al-Darqāwī (d. 1239/1823), an Idrīsī sharīf and founder of the Darqāwiyya ṭarīqa, mobilized mass movements across the Maghrib al-Aqṣā, encompassing roughly present-day Morocco and the western reaches of Algeria. His followers numbered in the tens of thousands, organized into disciplined cells that practiced intensive dhikr, moral reform, and political mobilization. The Darqāwiyya created networks that rivaled—and in some regions exceeded—the makhzan's administrative reach. Al-Darqāwī himself preached that Morocco's salvation lay not in sultanic decrees but in sharīfian spiritual renewal, and his movement carried the implicit threat that if the ʿAlawī sultan failed to embody justice, the Idrīsids could provide an alternative center of authority. Once again, the ʿAlawīs negotiated. They did not execute al-Darqāwī (though they exiled him temporarily). They absorbed his movement, honored his zawāyā, and allowed the Darqāwiyya to flourish—because suppressing it would have ignited rebellion across the countryside.

The most dramatic test came in 1330/1912, when Aḥmad al-Hība ibn Māʾ al-ʿAynayn (d. 1337/1919)—an Idrīsī sharīf leading jihād against Spanish colonialism from the Moroccan western Sahara, encompassing Sāqiyat al-Ḥamrāʾ and Wādī al-Dhahab—was proclaimed sultan by tribal and religious supporters. He entered Marrakesh, and the Friday khuṭba was read in his name. For a brief moment, at the very height of the French Protectorate when ʿAlawī authority had been shattered by colonial occupation, an Idrīsī sharīf ruled Morocco's southern capital. This was not merely resistance to foreign occupation—it was an Idrīsī restoration, demonstrating that even in the 20th century, even under European domination, the Idrīsids could still claim the throne when ʿAlawī legitimacy faltered.

Yet the ʿAlawīs endured. Aḥmad al-Hība's rule in Marrakesh lasted only months before French forces and ʿAlawī troops restored the sultan's authority. The ʿAlawī makhzan, even under colonial constraint, retained the allegiance of enough scholars, urban elites, and tribal leaders to demonstrate that their sharīfian authority remained constitutionally superior. The ʿAlawīs regained Marrakesh not because the French imposed them (though French arms helped), but because Morocco's established networks—ʿulamāʾ, zawāyā, prominent families—recognized that ʿAlawī rule, rooted in nearly 250 years of governance, offered more legitimate continuity than a new Idrīsī claimant, however righteous his jihād.

The ʿAlawīs succeeded where the Saʿdians had failed because they convinced Morocco that their rule was not the suppression of Idrīsī baraka but its continuation through another sharīfian line. They made their throne the embodiment of sharīfian Morocco itself—so that to fracture it was to fracture the whole empire. This was their genius: turning negotiation into stability, and stability into nearly four centuries of continuous rule.

9. Morocco as the Mahdī's Polity—The Permanent Eschaton

The Idrīsids solved a problem that had fractured the Islamic world since the death of the Prophet ﷺ: how to preserve Prophetic authority after prophethood ended. The Shīʿa claimed the Imām—infallible, divinely appointed, the locus of cosmic taṣarruf—but made him dependent on revolutionary seizure of power, which never came. The Sunnīs rejected infallibility, built the caliphate on consultation and conquest, and watched it collapse into dynastic warfare. Both models failed. The Imāmate became a theology of waiting. The caliphate became a rotating cast of warlords claiming a title they could not embody.

Morocco became the synthesis. The Idrīsids took the Shīʿī claim—that authority flows through Prophetic blood, that the ʿitra are ontologically necessary, that baraka is transmitted genealogically—and made it permanent rather than revolutionary. They took the Sunnī framework—Mālikī law, the finality of prophethood, the rejection of new revelation—and infused it with the very metaphysics Sunnism had spent centuries suppressing. The result was a system that did not require the Mahdī to appear because Morocco had already institutionalized what the Mahdī was supposed to accomplish: a polity (dawla) governed by the Prophet's ﷺ descendants, sustained by baraka, where spiritual and temporal authority were inseparable, and where sanctity—not force—was the foundation of legitimacy.

This is what al-Jazūlī meant when he declared: "Past nations have asked to be included in our polity (dawlatunā). Yet no one can be included in it unless he has already attained salvation." He was not speaking metaphorically. He was describing Morocco—a state where membership depended not on tribal allegiance or territorial residence but on attachment to the Prophet's ﷺ family, where the quṭb (not the sultan) was the true axis of governance, and where the sharīfs, as permanent carriers of Mahdist authority, had rendered the eschatological Mahdī unnecessary. The Mahdī was supposed to appear at the end of time to restore justice and unite the Muslims under Prophetic guidance. Morocco, through the Idrīsids, had already done this—not through a single messianic figure whose death would end the project, but through a class of sharīfs whose authority was eternal, whose baraka was self-renewing, and whose presence guaranteed that Morocco would never fall into the chaos that had consumed the Caliphate.

This is why Ibn al-ʿArabī's Khatmiyya doctrine found its fullest expression in Morocco. The "seal of sainthood" (khatm al-wilāya)—the idea that, after the closure of prophethood, a continuous class of saints inherits the Prophet’s ﷺ function in every generation—was not an abstract metaphysical principle. It was Idrīsī reality. The Idrīsids were the seal of sainthood made institutional. They did not receive revelation, but they revealed divine secrets. They did not legislate, but they governed souls. They did not claim infallibility in doctrine, but al-Ghazwānī's Jaras—the Bell saint with ʿiṣma—came close enough to make the distinction irrelevant in practice. The Idrīsids had created a Sunnī Imāmate: all the authority of the Shīʿī Imām, none of the revolutionary instability, and all of it rooted in a genealogy that no one—neither Sunnī nor Shīʿī—could dispute.

And critically, they had made it vernacular. The Shīʿī Imām spoke Arabic, lived in cities, addressed scholars. The Idrīsī sharīf spoke Tamazight, lived in ribāṭs, taught illiterate tribesmen. The Shīʿī Imām required theological specialists to interpret his authority. The Idrīsī sharīf was recognized by farmers, merchants, and shepherds who had never read a book but who knew—through mawāsim, through ziyāra, through stories transmitted orally—that the man who prayed at the mountain shrine carried the light of the Prophet ﷺ and that his blessing could heal the sick, mediate disputes, and make rain fall. This was baraka as popular sovereignty: authority recognized not by institutions but by the masses, sustained not by bureaucracy but by memory, and transmitted not through texts but through blood and land.

10. The Sole Survivor: Morocco's Unbroken Sovereignty

In the end, Morocco returns always to Zarhūn, to the moment when Mawlāy Idrīs I—survivor of Fakh, bearer of the sharīfian truth, and sole remaining standard-bearer of the Prophetic revolution—met the Awraba chieftains and fused Morocco's ancient sovereignty with the legitimacy of the Prophet's ﷺ House. What his son Mawlāy Idrīs II built in Fez was not merely a capital but a sanctuary—the first sharīfian city of the Islamic World, where he declared in his inaugural khuṭba that imāmat al-Ḥaqq, the true imamate, was attainable only through the descendants of the Prophet ﷺ.

For twelve centuries, this has been Morocco's constitutional truth. The Idrīsids did not rule Morocco for two centuries and then fade—they became Morocco, embedding themselves so deeply into its soil, its shrines, its tribes, and its memory that every dynasty since has governed only by recognizing them as Ahl Bayt al-Maghrib—the People of the House in the West, the family through whom Prophetic authority flows in this land.

The Idrīsids survived empires that consumed the rest of the Islamic world. They survived the ʿAbbāsids, whose caliphate collapsed into Persian and Turkish military control. They survived the Fāṭimids, whose Ismāʿīlī imamate crumbled under Ayyūbid conquest. They survived the Umayyads of al-Andalus, whose final sultan arrived in Fez as a refugee. And they survived the Ottomans—the final chapter in nine centuries of Turkish domination over the Arabs, who ruled the heartlands from the Seljuks through the Mamluks to the Ottomans, leaving them illiterate, backward, and incapable of self-governance. This was not luck. The ribāṭ system, the Idrīsī saints embedded in every region, the baraka that flowed through shrines rather than palaces—these made Morocco unconquerable by empires that relied on armies and bureaucracies alone.

Today, Morocco stands as the second-oldest continuous monarchy in the world after Japan, the oldest kingdom in the Muslim world, and the only kingdom in Africa. This is historical proof that the Idrīsī model endures. While the post-colonial Arab world has fractured into artificial states carved by Sykes-Picot, ruled by military coups or oil-dependent tribal monarchies, Morocco retained its coherence. The modern Arab states have spent a century trying to build nations. Morocco has spent a century governing the nation it already was.

The contrasts reveal Morocco's exceptionalism: The ʿAlawī King is not a military strongman or an oil shaykh—he is Amīr al-Muʾminīn, a title tracing through the ʿAlawīs, Saʿdians, and Idrīsids to their Ancestor ʿAlī ibn Abī Ṭālib himself. His legitimacy rests on twelve centuries of continuous sharīfian governance, not on elections, force, or petroleum.

When Morocco reformed its constitution in 1432/2011, it did not abandon the historic empire that once stretched from the Mediterranean to the Senegal River—it reaffirmed it, and crucially, it affirmed Morocco's authentic borders (al-ḥudūd al-ḥaqqa)—not the artificial lines imposed by colonial powers at Madrid (1297/1880), Algeciras (1324/1906), or the French-Spanish protectorates, but the territorial integrity established across centuries of Idrīsī, Almoravid, Almohad, Saʿdian, and ʿAlawī sovereignty.

Morocco entered modernity a century ago—through colonialism, independence, urbanization, mass education, and the forces that dismantled traditional authority across the postcolonial world. Yet the synthesis that Mawlāy Idrīs I established at Zarhūn, that his son institutionalized in Fez, and that his descendants have sustained for twelve centuries through ribāṭs, shrines, and baraka, endures.

Fez remains Idrīsī, its green-tiled roofs and narrow alleys still organized around the tomb of Mawlāy Idrīs II, still pilgrimed by millions who know that Morocco's heart beats in that shrine. The ʿAlawīs have ruled for nearly 400 years not by replacing the Idrīsids but by integrating their baraka into the makhzan—recognizing that to govern Morocco is to govern through the Idrīsids, not against them. This is why Morocco survived where others collapsed. This is why it remains a kingdom when republics became military regimes. This is why it knows its direction when the rest of the region searches for coherence.

Morocco has never stopped being Idrīsī. And as long as it remains Morocco, it never will.

Next
Next

The Ribaṭs of Morocco: An Idrisīd Phenomenon