Sidi Muhammad ibn Harazim: The Son Who Became the Compass of Moroccan Sufism

Every Moroccan knows the name Sīdī Ḥarazem. It is printed on millions of water bottles — one of the kingdom's most recognizable mineral water brands, drawn from the thermal spring fifteen kilometers southeast of Fez that has been flowing since before Islam arrived in Morocco. The spring is a national resort, a pilgrimage site, a destination where families from across the country come to bathe in carbonated waters that surface at thirty-five degrees, seeking healing for ailments that modern medicine has not resolved. The Marinid Sultan Abū al-Ḥasan built the bathing complex in solid stone; Sultan Muḥammad V built a royal residence behind it; King Ḥasan II expanded it. The name is everywhere. The man behind it is almost entirely unknown.

Sīdī Muḥammad ibn ʿAlī ibn Ḥirzihim (d. c. 633/1235) — the saint whose burial at Ḥammat Khawlān gave the spring its name — appears in the scholarly literature as a line between two greater figures: his father Sīdī ʿAlī ibn Ḥirzihim (d. 559/1163), whom al-Tamīmī al-Fāsī placed first in al-Mustafād, and his student Abū al-Ḥasan al-Shādhilī (d. 656/1258), who would carry what he received at the Ḥarāzimī rābiṭa from Fez to Tunis to Alexandria and from there to the entire Islamic world. The father has an extensive biography. The student has libraries. The man between them — the man whose name is on the water, whose spring draws the nation, whose shrine stands beside the oldest thermal source in the Maghrib — has almost no published study dedicated to him.

This article is written from within the custodianship. The Dabbāgh family has held the guardianship of the shrine of Sīdī Ḥarazem — together with the shrine of his father Sīdī ʿAlī ibn Ḥirzihim at Bāb al-Futūḥ and that of Sīdī ʿAbd al-ʿAzīz al-Dabbāgh — since the early ʿAlawī period, confirmed by the ẓahīr of Mawlāy al-Rashīd for the father's shrine and the ẓahīr of Sultan Muḥammad V, issued in Muḥarram 1354 AH, granting the Shurafāʾ al-Dabbāghīyīn the rights to the revenues, futūḥāt, and properties of the son's shrine at Ḥammat Khawlān. The saint whose name Morocco drinks deserves more than a line between two names.

His full name, as preserved in al-Kattānī's Salwat al-Anfās at 3/113, was Abū ʿAbd Allāh Muḥammad ibn ʿAlī ibn Ismāʿīl ibn Muḥammad ibn ʿAbd Allāh ibn Ḥirzihim, al-Andalusī, al-Umawī al-ʿUthmānī, al-Fāsī — the same Umayyad-Qurayshī lineage, the same Andalusian origin, the same Fāsī settlement that his father had carried. The family was not sharīfian — not descended from the Prophet ﷺ through ʿAlī and Fāṭima (peace be upon them) — but ʿUthmānī, tracing their blood through the house of the third caliph. Their authority was earned through ʿilm and walāya, not inherited through Prophetic genealogy. This was as true for the son as it had been for the father.

Makhlūf, in Shajarat al-Nūr al-Zakiyya, records him with a chain of titles that maps every register of spiritual authority the tradition recognized: al-Shaykh al-Kabīr, al-Walī al-Shahīr, al-ʿĀrif, al-Baraka, al-Ṣāliḥ, al-Qudwa, al-Murabbī, al-Nāṣiḥ, al-ʿĀlim, al-ʿĀmil, al-Ustādh, al-Wāṣil. Then Makhlūf adds the fact that defines everything: tarakahu wāliduhu ṣaghīran wa-intafaʿa bi-aṣḥābihi ka-Abī Madyan wa-Abī Muḥammad Ṣāliḥ — "his father left him young, and he benefited from his father's companions, namely Abū Madyan and Abū Muḥammad Ṣāliḥ."

He was an orphan of the rābiṭa, raised by the network his father had built. And everything that follows — the Almohad century that shaped his world, the school of Abū Madyan that formed him, the pilgrimage network of al-Mājirī that parented him, the spring at Ḥammat Khawlān where he chose to rest, and the arrival of al-Shādhilī at his door — must be read through this single biographical fact: the man who became the compass of Moroccan Sufism was a child who lost his father to the prison of one dynasty and grew to manhood under the surveillance of the next, inheriting not a teaching but an institution, and not a master but a network of men who had been mastered by the man he could not remember.

1. The Almohad Century: Co-optation, Jihād, and the Rābiṭa Under Watch

The rābiṭa Sīdī Muḥammad ibn Ḥarāzim inherited was not the rābiṭa his father had built. His father's rābiṭa had operated as the freest institution in Fez — the node where Baghdad's Suhrawardian methods, the Qarawiyyīn's Mālikī curriculum, the rural ribāṭ networks of Dukkāla and the Atlas, the Andalusian Sufi current, and the Ghazālian crisis all converged under the authority of a single shaykh who answered to no sultan. The rābiṭa Muḥammad inherited was an institution under watch — its founder dead, its public function curtailed, its capacity to operate as an open crossroads suspended for the duration of a regime that could tolerate no spiritual authority it did not own.

ʿAbd al-Muʾmin's caliphate (541–558/1146–1163) had imprisoned Sīdī ʿAlī ibn Ḥirzihim in Fez, killed Abū ʿAbd Allāh ibn al-Aṣamm in the year of conquest, chained Abū Ibrāhīm al-Khazrajī for delivering a khuṭba without authorization, summoned the greatest scholars of the age to Marrakesh — al-Qāḍī ʿIyāḍ (d. 544/1149) to die in exile, Abū Bakr ibn al-ʿArabī (d. 543/1148) to recant the ʿAwāṣim in disgrace, Abū Yaʿazzā (d. 572/1177) to be tested on tawḥīd and released under surveillance. The policy was blunt: murāqaba ṣārima, strict surveillance on anyone suspected of taṣawwuf. The Ḥarāzimī rābiṭa survived this period — but it survived diminished, its shaykh a child, its network scattered across Bijāya and Dukkāla and the Atlas.

Then al-Manṣūr came.

Abū Yūsuf Yaʿqūb al-Manṣūr (r. 580–595/1184–1199) understood what his predecessors had not: that the Sufi current had become inseparable from Moroccan society itself, and that destroying it would mean destroying the social fabric the Almohad state needed to govern. His policy was not repression but absorption — a siyāsat al-istiqqṭāb that drew the Sufis into the state's orbit through three simultaneous instruments.

The first was ethical performance. Al-Manṣūr inaugurated his reign with reformist measures that deliberately mirrored the Sufi vocabulary of zuhd and waraʿ: cutting silk garments, prohibiting elaborate dress, enforcing austerity by caliphal decree. The state was performing the very asceticism the Sufis practiced — competing with them on their own terrain, claiming the moral authority they had exercised independently. Ibn ʿAdhārī preserves the language: the caliph "cut off the reprehensible, established justice, and undertook the direct supervision of legal rulings." This was the caliphate performing sainthood.

The second was jihād — and here al-Manṣūr found the cause that could unite the state and the Sufis in common purpose for the first time since the Almohad conquest. His campaigns in al-Andalus culminated in the victory at Alarcos in 591/1195, a triumph that mobilized Sufi networks as participants in the Almohad project rather than its victims. The Muʿjib records al-Manṣūr's personal attention to the ṣāliḥīn: he visited them, honored them, spent from the bayt al-māl on them, attended their funerals. The jihād gave the Sufis a stake in Almohad success — and al-Manṣūr used it to bind them to his regime through shared devotion rather than shared fear.

This was the decade of Ḥiṭṭīn. In 583/1187, Ṣalāḥ al-Dīn al-Ayyūbī shattered the Crusader armies and recovered Jerusalem. The Almohads were rivals of the Ayyūbids in doctrinal terms — the Mahdist theology of Ibn Tūmart and the Sunni restoration of Ṣalāḥ al-Dīn rested on incompatible foundations — but the recovery of al-Quds released a wave of devotional energy across the Muslim world that no dynasty could ignore. The establishment of Ḥayy al-Maghāriba — the Moroccan Quarter adjacent to the Ḥaram al-Sharīf, endowed by Ṣalāḥ al-Dīn for Maghribī pilgrims and residents — created a permanent institutional link between Morocco and Jerusalem. The buyūt al-Maghāriba and funduqs that al-Mājirī's sons would later establish in Cairo, Alexandria, Mecca, Medina, and al-Quds were the physical infrastructure of this link — the road east that the man who raised Sīdī Muḥammad ibn Ḥarāzim built with his own hands.

The third instrument was the most consequential for the rābiṭa: the tarsīm — the formalization of Sufi teaching within the state educational apparatus. Al-Manṣūr did not merely tolerate taṣawwuf; he built schools for it, allocated budgets, dedicated at least one madrasa to a Sufi figure. The intent was to transform Sufism from an autonomous practice into a managed discipline — subject to state oversight, funded by state resources, contained within a system the caliph controlled. The Sufi who taught in a state-built madrasa, on a state-funded salary, under state surveillance, was a Sufi whose authority had been redirected to serve the regime that employed him.

The case of Abū al-ʿAbbās al-Sabtī (d. 601/1204) in Marrakesh demonstrates the method at its most refined. Housed in a funduq in the new ḥawma of Agādīr, given a school and a zāwiya, al-Sabtī maintained what amounted to an implicit contract with the Almohad authorities: his teaching was permitted, his movements watched, his institutional function channeled from autonomous spiritual authority to state-managed public piety. He was not persecuted — he was employed. And employment, for a saint, is a subtler form of containment than any prison.

This was the world Sīdī Muḥammad ibn Ḥarāzim grew into: a world in which the Almohad state had learned to absorb Sufi authority rather than crush it, and in which absorption meant the surrender of exactly the institutional independence his father had exercised and for which his father had been imprisoned. The rābiṭa at Bāb al-Futūḥ still stood. The network still functioned — through Abū Madyan in Bijāya, through al-Mājirī on the Atlantic coast, through the rural ribāṭs that fed students into Fez. But it functioned under a canopy the state had erected over it, and the orphan who inherited it had to navigate between the legacy of a father who had defied two dynasties and the reality of a regime that had learned to make defiance unnecessary by making compliance attractive.

2. The School of Abū Madyan: The Men Who Raised the Orphan of Bāb al-Futūḥ

The man who should have raised Sīdī Muḥammad ibn Ḥarāzim was his father. The men who did raise him were his father's greatest students — and in this fact lies the deepest testimony to what the Ḥarāzimī rābiṭa had accomplished. An institution that can produce disciples capable of parenting its founder's orphan son is an institution that has succeeded at the most fundamental level: it has reproduced itself. The rābiṭa did not need Sīdī ʿAlī ibn Ḥirzihim to survive his own death. It needed only the men he had formed — and those men were Abū Madyan Shuʿayb al-Ghawth (d. 594/1198) and Abū Muḥammad Ṣāliḥ al-Mājirī (d. 631/1234).

Abū Madyan — the orphan from Cantillana who had arrived in Fez with nothing, who had sat in the Qarawiyyīn study circles and retained nothing until he sat at the feet of Sīdī ʿAlī ibn Ḥirzihim and heard words that "came from the heart and entered the heart" — had become, by the time of his master's death, the most complete Sufi the Maghrib had ever produced. His formation at the Ḥarāzimī rābiṭa had given him everything the institution held: the Ghazālian tradition through Sīdī ʿAlī, the Andalusian methods through Abū Ghālib via Ibn al-ʿArrīf (d. 536/1141), the ecstatic Malāmatiyya through al-Daqqāq, and the rural baraka of the ribāṭ tradition through Abū Yaʿazzā Yalannūr (d. 572/1177), whom he had visited in the Atlas and from whom he had received the decisive spiritual imprint. One orphan from Cantillana had absorbed, through a single rābiṭa in Fez, every major current of Moroccan and Andalusian Sufism. And now he was called upon to transmit what he had received — not to a student but to his master's son.

After his formation in Fez, Abū Madyan Shuʿayb moved eastward to Bijāya, at the heart of Ifrīqiya, within a Maghrib that, under the expansive authority of the Almohad Caliphate, had achieved an unprecedented degree of political and doctrinal integration across North Africa and al-Andalus. It was precisely within this vast imperial horizon—where administrative cohesion and theological oversight were tightly interwoven—that Abū Madyan’s spiritual project took root in a more discreet, interior register. At Bijāya he founded Rābiṭat al-Zayyāt, replicating the Ḥarāzimī model on another soil: a rābiṭa that combined juridical training with Sufi formation, the madrasa with the khalwa. And it was from Bijāya that he made the journey that would connect the Ḥarāzimī chain to the greatest Sufi master of the Arab East — Mawlānā ʿAbd al-Qādir al-Jīlānī (d. 561/1166), the man who would be called the Quṭb of the East as Mawlāy ʿAbd al-Salām ibn Mashīsh (d. 625/1228) would later be called the Quṭb of the West. The encounter was late — al-Jīlānī was in his final years — but through it the Ḥarāzimī network acquired a direct connection to the Qādiriyya ṭarīqa. The west and the east met in the person of the Ghawth — the man the rābiṭa at Bāb al-Futūḥ had formed.

Abū Madyan's end came in 594/1198. ʿAbd al-Muʾmin summoned the aged saint to Marrakesh from Bijāya. The summons was itself the old Almohad method: a siyāsa iḥtirāziyya, a policy of precautionary containment. Abū Madyan never arrived. He died en route at al-ʿUbbād near Tlemcen — a city that had long functioned as a western counterpart to Fez—often described in Moroccan memory as a “second Idrīsī capital,” shaped by Idrīsī echoes, Almoravid-Almohad consolidation, and Marinid patronage into one of the great intellectual and spiritual centres of the far Maghrib. Al-Manṣūr ordered the construction of a shrine, transforming a potential confrontation into a pilgrimage center. The Marinid Sultan Abū al-Ḥasan would later build the magnificent mosque beside it — one of the finest examples of Moroccan architecture in the far Maghrib, standing today as monument to a man who had once arrived in Fez with nothing but hunger and a desire for God.

But Abū Madyan's contribution to the orphan of Bāb al-Futūḥ was not only personal — it was structural. Through his school in Bijāya, through his disciples scattered across the Maghrib and Egypt, through the institutional model he had replicated from the Ḥarāzimī original, he had ensured that the network Sīdī ʿAlī ibn Ḥirzihim had created would not die with its founder. When Sīdī Muḥammad ibn Ḥarāzim came of age, he inherited not merely a rābiṭa in Fez but a network that stretched from Sabta to Tlemcen to Bijāya — a network whose every node had been planted by a man his father had trained.

The second surrogate parent was more consequential still — because Abū Muḥammad Ṣāliḥ al-Mājirī was not merely a disciple who remembered the father. He was the man who physically raised the son.

The Sanctuary and Catafalque of Abū Muḥammad Ṣāliḥ al-Mājirī in Asafi, Morocco

Figure 1. The Burial Sanctuary of Abū Muḥammad Ṣāliḥ al-Mājirī inside the Ribāṭ of Āsafī. Located on the Atlantic coast, this site marks the spiritual fortress of Abū Muḥammad Ṣāliḥ. As the influential head of the Ṭāʾifa al-Ḥujjājiyya, al-Mājirī established a vital network that secured and facilitated the pilgrimage routes to Mecca for Jerusalem. Beyond his institutional legacy, he acted as the primary surrogate father and spiritual guide to Sīdī Muḥammad ibn Ḥarāzim, physically and intellectually raising the son of his master.

Al-Mājirī (d. 631/1234) — a Maṣmūda shaykh from the hill country of southern Dukkāla — had followed the full circuit of the Ḥarāzimī network before returning to Morocco to build something no one in the Maghrib had built before. He had trained at Ribāṭ ʿAyn al-Fiṭr in Dukkāla under the Amghārī methods — the Idrīsid ribāṭ tradition that had structured Moroccan Islam for four centuries. He had studied in Alexandria under ʿAbd al-Razzāq al-Jazūlī (d. 592/1177), a prominent disciple of Abū Madyan and one of the first Moroccan Sufis to build a following in Egypt — al-Jazūlī is buried in Alexandria, a Moroccan saint resting in Egyptian soil, marking the point where the western Sufi current first established a permanent eastern base.

Then Abū Madyan himself directed al-Mājirī to Baghdad — to Shaykh ʿAbd al-Qādir al-Jīlānī. The account preserved in the letters of the Tijanite faqīh al-Kanṣūsī records what happened with the economy of a parable. Al-Jīlānī put al-Mājirī through three consecutive forty-day retreats — thalāthat arbaʿīnāt, one hundred and twenty days of khalwa. Nothing opened. No fatḥ came. Al-Jīlānī sent him back to Abū Madyan. Al-Mājirī returned and stayed — lāzamahu mudda madīda — until the appointed time arrived and the opening came. The east could prepare, could discipline, could test. But the fatḥ came through the Maghribī chain — through the connection that ran back to the rābiṭa at Bāb al-Futūḥ.

Upon returning to Morocco, al-Mājirī founded his ribāṭ at Āsafī on the Atlantic coast and created the Ṭāʾifa al-Ḥujjājiyya — the Pilgrimage Society — the most consequential institutional innovation in Moroccan Sufism since the Banū Amghār's establishment of the Ṣanhājiyya at Ribāṭ Tīṭ al-Fiṭr. Under this system, al-Mājirī and his sons organized yearly caravans — al-Rakb al-Ṣāliḥī — that linked Morocco to Mecca and Medina through a network of funduqs and buyūt al-Maghāriba across the Maghreb, Egypt, the Ḥijāz, and Jerusalem. His son Sīdī Aḥmad (d. 660/1262) made eleven journeys to the east, establishing the funduq al-Maghāriba in Alexandria and appointing administrators whose descendants managed the Egyptian terminus for generations. By the testimony of the sources, the Ḥujjājiyya was the best-organized Sufi network in Morocco during the first half of the seventh/thirteenth century — its activities extending far beyond the Almohad perimeter, its members wearing distinctive signs of solidarity, its organizational reach stretching from the Atlantic to the Ḥaram al-Sharīf.

This was the man who raised the Umayyad orphan of Bāb al-Futūḥ. Sīdī Muḥammad ibn Ḥarāzim's formation was not a schoolroom education but an immersion in the most extensive Sufi network Morocco had ever produced. Through al-Mājirī, he inherited not merely the rābiṭa's local function — the Fāsī node that connected streams — but a network that stretched from the Atlantic coast to Jerusalem, from Āsafī to Mecca, from the rural ribāṭs of Dukkāla to the funduqs of Cairo. The man who built the road east raised the man who would never walk it.

And here the silence of the sources becomes eloquent. Every major figure in the Ḥarāzimī chain had traveled east: the uncle Ṣāliḥ had met al-Ghazālī near Jerusalem; Abū Bakr ibn al-ʿArabī had led the embassy to Baghdad; Abū Madyan had met al-Jīlānī; al-Mājirī had endured one hundred and twenty days of khalwa in Baghdad before being sent back to his Maghribī master. The man who raised Sīdī Muḥammad had built the road — the funduqs, the buyūt, the caravans, the entire infrastructure linking Morocco to the mashriq. And Sīdī Muḥammad never walked it.

He stayed. He stayed in Fez, at the rābiṭa, and then withdrew to Ḥammat Khawlān — fifteen kilometers from the city walls. The farthest he went was a thermal spring within sight of the hills of Fez. In an age when authority was built through the riḥla — when the journey east was the credential that legitimated every Moroccan shaykh from Darrās ibn Ismāʿīl to al-Mājirī himself — Sīdī Muḥammad did not travel. He did not need to. The east had already arrived at Bāb al-Futūḥ — carried home by his uncle, transmitted through his father, consolidated by Abū Madyan, organized into a permanent infrastructure by al-Mājirī. Every generation of the network had extended itself eastward to retrieve what Morocco needed. By the time of Sīdī Muḥammad ibn Ḥarāzim, the retrieval was complete.

The mashriq would come to him — in the person of a young Idrīsid sharīf from Ghumāra who had already been to Baghdad and found it insufficient.

3. Ḥammat Khawlān: Where Fez Was First Conceived and Where the Rābiṭa Found Its Rest

The spring at Ḥammat Khawlān had been flowing long before Islam reached Morocco. Carbonated waters surfacing at thirty-five degrees from the earth beside Wādī Sabū — rich in minerals, hot enough to heal, cool enough to bathe in — had drawn human settlement to this site since antiquity. But the spring's deepest claim on Moroccan history is not geological. It is civilizational.

When Mawlāy Idrīs I, peace be upon him, resolved to build the capital of his new kingdom, he chose Ḥammat Khawlān first. The site had everything a city required: proximity to abundant water, the thermal spring for health, the great river Sabū for irrigation and commerce. He ordered the ground surveyed, the foundations dug, the lime prepared, the timber cut. Construction began. Then Mawlāy Idrīs looked at the Sabū — at the mudūd al-ʿaẓīma, the great floods that roared down the valley in winter — and feared for the lives of the people he meant to settle there. He raised his hand from the project, abandoned the site, and returned to Walīlī. It was his wazīr, ʿUmayr ibn Muṣʿab, who proposed the alternative: a grassy site on a smaller river, sheltered from the Sabū's violence. The choice fell on Wādī al-Jawāhir — and Fez was born.

Ḥammat Khawlān was the city that was never built — the first intention of the Idrīsid project, the origin-point that nature rejected. For four and a half centuries, it remained what it had always been: a thermal spring, visited for healing, remembered as the place where Fez almost was. Then Sīdī Muḥammad ibn Ḥarāzim withdrew there — and the abandoned origin-point became a shrine.

Shrine of Sīdī Ḥarazem at Ḥammat Khawlān near Fes – Saint of Moroccan Sufism and Student of Abū Madyan

Figure 2: Colonial-era view of the shrine of Sīdī Ḥarazem near the thermal waters of Ḥammat Khawlān, southeast of Fez, surrounded by palm groves and oasis vegetation. The image evokes the sacred landscape connected to Sīdī Muḥammad ibn ʿAlī ibn Ḥirzihim, student of Abū Madyan and teacher of Abū al-Ḥasan al-Shādhilī, whose memory became inseparable from the spring that still bears his name.

The sources do not explain why he chose it. They do not record a vision, a command, a dramatic event that drove him from Fez to the spring. What they record is the result: the man who held the Ḥarāzimī rābiṭa — the institution his father had built at Bāb al-Futūḥ, the node that had connected every current of Moroccan Sufism — left the city and settled at a thermal spring in the foothills, fifteen kilometers from the walls of Fez, and there he remained until his death in approximately 633/1235.

The choice, whatever its inner motivation, produced a sacred geography of extraordinary resonance. The father holds Bāb al-Futūḥ — the eastern gate of the city that was built, the gate through which caravans departed for Taza and Wajda, the gate beside which Mawlāy al-Rashīd would later choose to be buried. The son holds Ḥammat Khawlān — the site of the city that was never built, the place where the Idrīsid project was first conceived and then abandoned, the spring that preceded Fez itself. Between them — father at one pole, son at the other — the Ḥarāzimī house brackets the entire sacred landscape of Fez and its surroundings: the city and its origin, the gate and the spring, the institution and its retreat.

The withdrawal itself carries the signature of the Malāmatī inheritance Sīdī Muḥammad had received through his father's line. Sīdī ʿAlī ibn Ḥirzihim had practiced the Malāmatiyya — the path of deliberate self-concealment — before anyone in Morocco knew its name. He had introduced it to the Maghrib, and the people of Fez had criticized him for it: yankurūna ʿalayhi baʿḍ aḥwālihi. The criticism was built into the method. His son's withdrawal to a thermal spring — away from the Qarawiyyīn, away from the political tensions of a city under Almohad surveillance, away from the visibility that had brought his father imprisonment — is the Malāmatī logic carried to its conclusion. The father had hidden his states in plain sight, in the middle of Fez. The son hid himself entirely — at a spring outside the city, in a place whose very name the people would eventually forget, replacing Ḥammat Khawlān with Sīdī Ḥarazem, the saint's name overwriting the toponym, the walī absorbing the landscape.

The Marinid Sultan Abū al-Ḥasan — the same dynasty that rebuilt the father's qubba at Bāb al-Futūḥ through the governor al-Ṣaqqār and turned his attention to the memory of Abū Madyan in Tlemcen— invested in the son's site as well. Al-Jaznāʾī, in Janā al-Ās, records that Abū al-Ḥasan "built upon Ḥammat Khawlān in a solid manner — ʿalā wajh muḥkam — so that the benefits and welfare of the people would be fulfilled." The Marinid construction survives to this day: a vaulted stone qabbū separating the men's bath from the women's, built to last, built to serve — the practical architecture of a dynasty that understood what the Almohads had not, that the saints were not rivals to be contained but foundations to be honored. The Almoravids had burned the books. The Almohads had imprisoned the saints. The Marinids built the shrines — for the father at Bāb al-Futūḥ, for the son at Ḥammat Khawlān — completing in stone what the Ḥarāzimī rābiṭa had built in spirit.

And the site continued to accumulate royal attention across the centuries, as though each dynasty that governed Morocco recognized in Ḥammat Khawlān something that required not merely preservation but investment. Sultan Muḥammad ibn Yūsuf al-ʿAlawī — built a royal residence behind the Marinid structures, choosing this spring as a place of personal retreat and bathing. King Ḥasan II expanded the complex further. The thermal waters that Mawlāy Idrīs I had chosen for his capital and that Sīdī Muḥammad ibn Ḥarāzim had chosen for his burial continued to draw the rulers of Morocco — not as an act of piety alone but as an acknowledgment that the spring's authority was older than any throne.

4. Al-Shādhilī and the Compass: Why Ibn Ḥarāzim First, Before ʿAbd al-Salām

Sayyidī Abū al-Ḥasan ʿAlī ibn ʿAbd al-Jabbār al-Shādhilī al-Idrīsī al-Ḥasanī (d. 656/1258) was born in Banī Yafraḥ in the region of Ghumāra, near Tiṭwān, in 593/1196 — an drīsid sharīf, a Mālikī of immense early learning, a young man torn between the life of the wilderness ascetic and the company of urban scholars. He had already traveled east — to Egypt, where he studied under Abū al-Fatḥ al-Wāsiṭī, the master connected to the Rifāʿiyya — and al-Wāsiṭī had told him to return home: the master he sought was not in Egypt but in Morocco. Al-Shādhilī came back. He came back from the mashriq — from the heartland of Sufi authority, from the institutions that had produced the Iḥyāʾ and the Niẓāmiyya — and he came to Fez.

In Fez, he heard of a saintly man teaching at the Qarawiyyīn. He hastened to meet him. This man was Sīdī Muḥammad ibn Ḥarāzim.

Makhlūf's entry is precise: wa-mimman akhadha ʿanhu wa-intafaʿa bihi al-Imām Abū al-Ḥasan al-Shādhilī, akhadha ʿanhu tabarrukan wa-intifāʿan wa-istifāda, wa-ṣaḥibahu wa-labisa al-khirqa, wa-huwa awwal ashyākhihi — "Among those who took from him and benefited by him was the Imām Abū al-Ḥasan al-Shādhilī — he took from him seeking blessing, benefit, and instruction, accompanied him, and received the khirqa. He was the first of his shaykhs."

The first. Not the last — Makhlūf is careful to distinguish: wa-ākhiruhum alladhī huwa ʿumda tuhu fī al-ṭarīq wa-ilayhi yantasibu ʿalā al-taḥqīq, al-Shaykh ʿAbd al-Salām ibn Mashīsh — "and the last of them, who is his true authority on the path and to whom he truly belongs, is the Shaykh ʿAbd al-Salām ibn Mashīsh." The architecture of al-Shādhilī's formation is clear: Sīdī Muḥammad ibn Ḥarāzim was the gate; Ibn Mashīsh was the destination. The rābiṭa received the seeker, invested him with the khirqa, and then directed him onward — to Jabal al-ʿAlam, to the mountain where the Quṭb of the West waited.

The question the sources raise without answering is: why did al-Shādhilī need the gate at all? He was an Idrīsid sharīf — descended from the Prophet ﷺ through Imām al-Ḥasan, possessing the genealogical authority the Ḥarāzimī family lacked. He had been to Egypt. He had studied under a master of the Rifāʿiyya. He knew where Jabal al-ʿAlam was — it was in his own tribal territory of Ghumāra, close to where he had been born. Why did he not go directly to Ibn Mashīsh?

The answer lies in what the Ḥarāzimī rābiṭa was — and what no other institution in Morocco could replicate. The rābiṭa was not merely a school or a zāwiya. It was the compass of Moroccan Sufism — the institution that held the map of the entire landscape of spiritual formation across the Maghrib and knew where each seeker should go. When al-Shādhilī arrived in Fez, he was a man of vast learning and genuine spiritual aspiration who had already been told by an eastern master to return home. But "home" was not a place — it was a path, and the path required orientation. The rābiṭa provided what Alexandria could not: the knowledge of Morocco's accumulated pedagogical geography — who was teaching where, which ribāṭ served which function, which shaykh could complete which formation. Sīdī Muḥammad ibn Ḥarāzim did not merely give al-Shādhilī the khirqa. He read him — as his father had read Abū Madyan, as his uncle had been read by al-Ghazālī near Jerusalem — and directed him to the precise master who could complete what the rābiṭa had begun.

This function — receiving, assessing, directing — is what makes Sīdī Muḥammad ibn Ḥarāzim irreplaceable in the Shādhilī silsila, despite the brevity of his biographical entry. Without him, al-Shādhilī might have wandered Morocco for years looking for the Quṭb he had been told to seek. Without the rābiṭa's institutional memory — its knowledge of the landscape, its connections to every ribāṭ and every shaykh across the country — the encounter at Jabal al-ʿAlam might never have occurred. The compass does not replace the pole. But without the compass, the pole cannot be found.

And there is a deeper structural fact that the sources encode without commentary. Al-Shādhilī came from the east. He had been to Egypt. He had been formed — partially, insufficiently, but genuinely — by mashriq institutions. And he came to a man who had never left Morocco, who had never walked the road his surrogate father al-Mājirī had built, who had never seen Baghdad or Alexandria or Mecca. The mashriq came to the man who stayed. The current that had flowed eastward for four generations of the Ḥarāzimī chain — the uncle going to Jerusalem, Abū Madyan going to Bijāya and Mecca, al-Mājirī going to Alexandria and Baghdad and Mecca — reversed direction. Al-Shādhilī brought the east to Sīdī Muḥammad ibn Ḥarāzim's door, and Sīdī Muḥammad sent him not east but further into Morocco — deeper into the Maghrib, up the mountain, to the Quṭb who waited at Jabal al-ʿAlam.

What al-Shādhilī took from that mountain — and carried back east, to Tunis, to Alexandria, to the entire Shādhilī world that stretches today from Fez to Jakarta — passed through the Ḥarāzimī rābiṭa first. The gate opened before the destination was reached. And the gatekeeper was a quiet man at a thermal spring who knew where everyone else should go.

5. The Unraveling: The Empire That Imprisoned His Father Destroys Itself

Al-Manṣūr died in 595/1199 — and with him died the only Almohad caliph who had understood how to govern the Sufis without breaking them. What followed was sixty-nine years of disintegration so complete that by the time the Marinids entered Marrakesh in 668/1269, the Almohad doctrinal system had been repudiated by its own caliphs, its empire had fractured into three successor states, and the Mahdist theology that had justified two centuries of absolute rule had been declared a bidʿa by the dynasty's own heir.

Sīdī Muḥammad ibn Ḥarāzim lived through the entirety of this collapse. Born during the caliphate of ʿAbd al-Muʾmin's successors, formed under the co-optive regime of al-Manṣūr, he reached maturity and exercised his function at the rābiṭa during the decades when the Almohad order was tearing itself apart. His life — from orphaned childhood to quiet death at Ḥammat Khawlān around 633/1235 — maps almost exactly onto the arc from Almohad zenith to irreversible decline.

The first blow was al-ʿUqāb.

The defeat at Las Navas de Tolosa in 609/1212 shattered the theological narrative that had sustained Almohad rule. If the Mahdī's tawḥīd guaranteed divine favor, and divine favor manifested in victory, then catastrophic defeat on the field announced either doctrinal failure or leadership corruption. No third interpretation existed within the Mahdist framework. The regime could not respond by acknowledging that battlefield outcomes reflect contingent factors — logistics, terrain, numbers — because doing so would admit that God's support operates through mundane causation rather than direct intervention. Al-ʿUqāb did not merely lose territory in al-Andalus. It exposed the fatal circularity at the heart of Almohad legitimacy: a system that derived authority from divine mandate could not survive the withdrawal of the signs that proved the mandate was real.

The caliphs who followed al-Manṣūr's son al-Nāṣir (d. 610/1213) averaged less than eight years each — succession resolved through violence rather than transmission governed by recognized principle. Into this vacuum, every suppressed current of Moroccan Islam resurfaced. The Idrīsid sharīfian networks that the Almohads had marginalized — viewing them as competitors to Mahdist authority — reasserted themselves. The ribāṭ networks that ʿAbd al-Muʾmin had placed under murāqaba ṣārima tested the limits of weakened surveillance. The Mālikī fuqahāʾ whose juridical independence the Almohads had curtailed began reclaiming institutional space. And the Sufi ṭawāʾif that al-Manṣūr had tried to formalize under state control discovered that the state no longer possessed the coherence to control anything.

The Almohad response to this resurgence was erratic — oscillating between co-optation and assassination, between alliance and murder, without the strategic consistency that al-Manṣūr had maintained. The pattern is legible in the sources across multiple theaters simultaneously.

In the Rif, the state moved against the most dangerous form of autonomous authority it faced: Idrīsid sharīfian sanctity operating through ribāṭ networks beyond caliphal reach. Mawlāy ʿAbd al-Salām ibn Mashīsh (d. c. 625/1228) — the Idrīsid sharīf of Jabal al-ʿAlam, the master to whom Sīdī Muḥammad ibn Ḥarāzim would later direct al-Shādhilī — was assassinated. Ibn al-Sakkāk's Nush establishes that the killing was carried out by Abū al-Ṭawājīn on Almohad orders — the state using a local agent to eliminate a sharīf whose spiritual authority it could not tolerate. The assassination was not an isolated act of sectarian violence but a state operation: the Almohad regime, in its terminal phase, was still hunting down the sources of autonomous baraka that its Mahdist theology could not accommodate. Near Marrakesh, another Idrīsid sharīf — Muḥammad ibn Yaʿqūb ibn ʿAbd Allāh, who had established a ribāṭ in Āyt ʿĪtāb — was killed by the caliph al-Rashīd (r. 630–640/1232–1242). The repression revealed fatal misrecognition: Idrīsid baraka operated through kinship, zāwiya networks, and local devotion — structures that violence could not dislodge because they were embedded in social fabric rather than dependent on individual leaders. Killing sharīfs did not eliminate sharīfian authority; it demonstrated that the regime possessed no framework for coexisting with forms of legitimacy it had not created.

In Sabta and al-Andalus, the Almohad authorities continued to pursue Sufi figures whose autonomous authority threatened the state's doctrinal perimeter. The summoning of scholars and saints to Marrakesh — the technique ʿAbd al-Muʾmin had pioneered and al-Manṣūr had refined — continued under the later caliphs, but without the strategic coherence that had made it effective. The case of Ibn al-Ḥājj al-Balafīqī (d. 616/1219) — the Sufi shaykh whose following had grown so large that the fuqahāʾ judged him a danger to the state — illustrates the mechanics of late Almohad repression. Al-Balafīqī relied on his mashāyikh and murīdīn, who had become so numerous that they constituted, in the fuqahāʾ's assessment, a potential threat to the regime. When the caliph learned of the situation, he ordered the governor to summon al-Balafīqī to Marrakesh for istinṭāq — interrogation. Al-Balafīqī's murīdīn attempted to prevent his departure, trying to derail the situation by blocking the governor's order, and al-Balafīqī himself sought to avoid the summons — recognizing that the co-optive embrace of Marrakesh was a cage. But he was taken. And the Almohad state, having summoned him, could neither absorb him nor release him without consequence.

On the Atlantic coast, al-Mājirī's ṭāʾifa — the network that had raised Sīdī Muḥammad ibn Ḥarāzim, the best-organized Sufi institution in Morocco — found itself caught between Almohad containment and its own expansionary logic. The Ḥujjājiyya's activities extended far beyond the Almohad perimeter: its caravans linked Morocco to Mecca through territories the caliphate did not control; its funduqs in Alexandria and Cairo operated under Ayyūbid and then Mamlūk sovereignty; its members wore distinctive signs of solidarity that announced their identity across borders. The Almohad authorities could not suppress a society whose primary function was facilitating the ḥajj — the one act no caliph could forbid — but they could harass it, tax it, and attempt to subordinate its leadership. Al-Mājirī's conflicts with the Almohad administration in Marrakesh were compounded by his struggles with the Banū Amghār at Ribāṭ Tīṭ al-Fiṭr — the oldest ribāṭ-based Sufi institution in Morocco, whose Ṣanhājiyya had predated the Ḥarāzimī rābiṭa by over a century. The competition between the Mājiriyya and the Amghāriyya was not merely institutional rivalry but a contest over which network would organize the Sufi landscape of post-Almohad Morocco. Al-Mājirī's son ʿAbd Allāh (d. 651/1253) was imprisoned by the Almohad authorities in Marrakesh — the state deploying against the son of Sīdī Muḥammad's surrogate father the same instrument it had deployed against Sīdī Muḥammad's own father a century earlier.

The Almohad attempts to contain Ribāṭ Tīṭ itself reveal the regime's increasingly desperate efforts to manage ribāṭ-based authority during its own disintegration. The caliph al-Rashīd attempted to impose taxes on the Ṣanhājiyya community — farḍ ḍarība ʿalā al-jamāʿa al-ṣūfiyya li-ribāṭ Tīṭ — a direct violation of the privileges the ribāṭ had enjoyed since the Almoravid period. The Banū Amghār resisted. The Almohad walī Abū Fāris revolted against the caliph from within the ribāṭ's territory. The imposition of taxes on a Sufi community that had sustained itself through voluntary gifts and endowments for over a century was an act of desperation — the state reaching for revenue from institutions it could no longer control through ideological authority alone.

The ideological collapse culminated in the crisis of al-Maʾmūn. Idrīs al-Maʾmūn (r. 626–630/1229–1232), having conquered Marrakesh with fifteen thousand Christian cavalry provided by Fernando III of Castile — surrendering fortresses, building a church for Spanish troops, stipulating that Christian conversions to Islam be rejected — confronted the Mahdist problem directly. He removed Ibn Tūmart's name from the sikka and the khuṭba. He eliminated the Amazigh liturgical innovations. He declared: "There is no Mahdī except ʿĪsā ibn Maryam... This was a bidʿa which we have removed." He called Ibn Tūmart and his followers kuffār — while retaining for himself the title Amīr al-Muʾminīn.

The logic appeared straightforward: Mahdism had become an obstacle to governance. By declaring the doctrine fraudulent, al-Maʾmūn hoped to gain administrative freedom while preserving dynastic claim. The calculation was catastrophically wrong. Legitimacy that had been unified and indivisible under Mahdist doctrine became infinitely divisible once the doctrine was withdrawn. Abū Zakariyyāʾ Yaḥyā in Ifrīqiya proclaimed independence and founded the Ḥafṣid dynasty: if Ibn Tūmart's claim was false, what bound Ifrīqiya to Marrakesh? The ʿAbd al-Wādids took Tlemcen. The Marinids consolidated the north. The empire that had imprisoned Sīdī ʿAlī ibn Ḥirzihim and assassinated Mawlāy ʿAbd al-Salām ibn Mashīsh was dissolving — not conquered from without but collapsing from the evacuation of its own founding premise.

It was during this disintegration — not during stability, not during the managed co-optation of al-Manṣūr, but during the unraveling of everything — that Sīdī Muḥammad ibn Ḥarāzim withdrew to Ḥammat Khawlān. The compass retreated to the spring while the empire that had tried to contain the rābiṭa was destroying itself. And it was during this same period — with Ibn Mashīsh freshly martyred on Almohad orders, with the Mahdī declared a fraud by his own descendant, with the ṭāʾifa of al-Mājirī under pressure from Marrakesh and the Banū Amghār simultaneously — that a young Idrīsid sharīf from Ghumāra arrived in Fez, heard of a saintly man teaching at the Qarawiyyīn, and found his way to the rābiṭa at Bāb al-Futūḥ.

6. Legacy: The Custodians of Both Shrines

Sīdī Muḥammad ibn Ḥarāzim died in approximately 633/1235 — two years after the death of his surrogate father al-Mājirī, in the final decades of the Almohad century, before the Marinids had consolidated their rule over Fez. He was buried at Ḥammat Khawlān — the spring that had been Mawlāy Idrīs I's first choice for a capital, the site his own retreat had consecrated, the place that would bear his family's name forever after.

With his burial, the sacred geography of the Ḥarāzimī house was complete. The father at Bāb al-Futūḥ — the gate of victories, the eastern threshold of the Idrīsid city, the shrine where Mawlāy al-Rashīd would choose to rest and where al-Khiḍr had appeared twice across six centuries. The son at Ḥammat Khawlān — the abandoned origin-point of Fez itself, the spring that Mawlāy Idrīs had chosen first and that nature had redirected, now permanently sealed with the baraka of the man who had directed al-Shādhilī to Jabal al-ʿAlam. Two shrines, two poles, two gates — one opening onto the city, the other onto the landscape that preceded it.

Both were built by Marinid hands. The father's qubba at Bāb al-Futūḥ was rebuilt by the governor al-Ṣaqqār — "a great qubba, spacious in courtyard, beautiful in form and construction." The son's site at Ḥammat Khawlān was invested by the Sultan Abū al-Ḥasan with the solid stone bathing complex that stands to this day. The dynasty that finally brought the Niẓāmī triplex to Morocco — that introduced the madrasa system, that formalized the ṭarīqa structure the Ḥarāzimī rābiṭa had prepared the ground for — honored in stone the family whose institutional work it was completing. The Almoravids burned the books. The Almohads imprisoned the saints. The Marinids built the shrines.

And the ʿAlawīs entrusted them.

Modern view of the white-domed shrine of Sīdī Ḥarazem at Ḥammat Khawlān near Fes, Morocco.

Figure 3. The shrine of Sīdī Ḥarazem today: restored, enclosed, and integrated into the modern pilgrimage landscape, yet still marking the resting place of Sīdī Muḥammad ibn ʿAlī ibn Ḥirzihim. Beyond its religious significance, the sanctuary remains part of Morocco’s living cultural memory—where pilgrimage, healing waters, family visits, and the enduring attachment to awliya continue to shape the social landscape of the Fāsī countryside and the wider Maghrib.

Since the early ʿAlawī period, the custodianship of both shrines — together with the shrine of Sīdī ʿAbd al-ʿAzīz al-Dabbāgh (d. 1131/1719) — has been held by the Dabbāgh family, the sharīfian lineage whose ancestors the Almoravid sultan Yūsuf ibn Tāshfīn once invited across the Strait of Gibraltar bi-qaṣd al-tabarruk bihi. Mawlāy al-Rashīd — the founder of the ʿAlawī dynasty, the man who unified Morocco after decades of fragmentation — granted the Shurafāʾ al-Dabbāghīyīn the futūḥāt of the father's shrine at Bāb al-Futūḥ. And Sultan Muḥammad V, in a ẓahīr sharīf issued in Muḥarram 1354/ May 4, 1935, extended the same grant to the son's shrine — confirming the Dabbāgh family's rights to the revenues, futūḥāt, and properties of the shrine of Sīdī Ḥarazem at Ḥammat Khawlān. Two ẓahīrs, two shrines, one family — binding the institutional Sufism that the Ḥarāzimī house had built to the sharīfian custodianship that would maintain it across the centuries.

The connection between the Ḥarāzimī rābiṭa and the Dabbāgh custodianship is not merely administrative. It is spiritual — and it operates across the same site. It was at the shrine of Sīdī ʿAlī ibn Ḥirzihim, outside Bāb al-Futūḥ — the shrine the Dabbāgh family maintains — that Sīdī ʿAbd al-ʿAzīz al-Dabbāgh, the unlettered sharīf of Ḥūmat al-ʿUyūn, received his fatḥ through al-Khiḍr. The same al-Khiḍr who had appeared to Sīdī ʿAlī ibn Ḥirzihim in his majlis six centuries earlier, restoring the knowledge that self-regard had blocked. The institutional saint of the sixth/twelfth century and the eruptive walī of the twelfth/eighteenth century received their openings at the same maqām, through the same figure, under opposite conditions: one within the institutional framework, the other outside all institutional channels entirely. The shrine connects what the institutional model treats as separate: the shaykh who trained through silsila and the walī who received through fatḥ; the tarbiya of the Niẓāmī system and the kashf of the barzakh; the authority that is transmitted and the authority that arrives.

Sīdī Muḥammad ibn Ḥarāzim lived between these two modes — inheriting the institution his father built, raising no spectacle of his own, performing the quiet function of the compass that reads and directs. He was the Quṭb. He was the man who knew where another Quṭb could be found — and who sent the founder of the Shādhiliyya to find him. His father gave Moroccan Sufism its institutional form. His student gave it its global reach. He gave it the connection between the two — the link without which the chain from Bāb al-Futūḥ to Jabal al-ʿAlam to Alexandria to Jakarta would never have been forged.

The spring still flows at Sīdī Ḥarazem. The waters still surface at thirty-five degrees. The Marinid stones still stand. The families still come — for healing, for bathing, for the baraka of a saint whose name is on the water and whose story, until now, has been told only in the silence between two greater names. He was not between them. He was the hinge — and without the hinge, the door does not open.

May God be satisfied with him and benefit us through his baraka.

El Hassane Debbarh

Founder and editorial director of DAR.SIRR. Naqīb al-Ashrāf of the Dabbāgh family and custodian of the shrines of Sīdī ʿAbd al-ʿAzīz al-Dabbāgh, Sīdī ʿAlī ibn Ḥirzihim, and Sīdī Ḥarazim in Fez. Writing between Helsinki and the Qarawiyyīn quarter, he leads the ongoing work of shrine restoration, manuscript preservation, and the publication of DAR.SIRR — the family's contribution to the living tradition of Moroccan Sufism and Islamic intellectual history.

Previous
Previous

Abu Muhammad Salih al-Majiri: The Ghawth of Asafi and the Saint Who Linked Morocco to Mecca

Next
Next

Sidi Ali ibn Hirzihim: Morocco's First Sufi Shaykh and the Rābiṭa That Built Moroccan Sufism