This article is also available in:
Italiano
The history of Islam in Morocco from its origins to the present day
At the origins of Islam
Islam reaches Morocco for the first time following the Umayyad invasion of 680 and is very well received by the local Amazigh/Berber tribes, who will convert particularly quickly compared, for example, to countries such as Egypt; precisely this rapid conversion will be at the basis of the Great Amazigh revolt.

The latter will in fact originate from the indignation of the locals at being treated as “second class” citizens even once they have embraced the new faith and will lead to the defeat of the caliphal army in Tangier in 740 and to the definitive defeat in 741 near Fez. From this destruction, 3 potentates will emerge: the Emirate of Nekor (710–1019) in Northern Morocco, the Confederation of Barghrawata (744–1058) in the Central-West and the Emirate of Sijilmassa (757–976) in the South-East .
The 3 potentates
To understand the spiritual evolution of the country it is important to dwell above all on the last two, as the Emirate of Nekor remained predominantly Sunni, while the others followed much more particular trajectories. The Emirate of Sijilmassa, in fact, became one of the main Sufrite centers in the world; these were a particular current of moderate Kharijism, established first in Basra and then, following heavy persecutions, precisely in Sijilmassa.

The Barghawata Confederation, on the other hand, had a more complex religiosity as it was made up of 29 tribes, 17 of which were Khairjite (probably of the Sufrite type), while the remaining 12 followed their own religion which brought together the creeds of all the main Islamic currents (Sunnism , Shiism and Kharijism) to the Amazigh religion. To these 3 powers was added a dynasty destined to change the history of Morocco forever: the Idrisids.
The Idrisids
Their name derives from Idris I, a key figure for fully understanding the history of Morocco and, in general, the evolution of local Islamic thought. In fact, he was not an ordinary local clan chief, but the great-grandson of Hassan ibn Ali, the grandson of the Prophet (pbuh). This dynasty was the protagonist of deep internal struggles first against the Umayyads and then against the Abbasids, which will lead de facto to the birth of the Shiite movement; it is no coincidence that Idris I fled from Arabia following the Battle of Fakhkh in 786, finding refuge in Morocco in 789 at Walili, the ancient Volubilis, territory under the Amazigh tribe of the Awrata.

Their alliance, which culminated in their marriage to Kenza al-Awrabiya, led them in a short time to establish themselves as the major power on Moroccan soil, as well as to found the city of Fez, the first capital. Under a mere religious profile, the Idrisids are particularly interesting since it is not known with certainty to which confession they belonged. They were certainly Muslims, but even today there are many doubts whether they were Sunnis or Zaydi Shiites; the doubt derives above all from the origins of Idris I and from the fact that his subjects repeatedly addressed him with the title of “imam”, a typical characteristic of the Shiite world. With the definitive fall of the Idrisids at the hands of the Maghrawa confederation, the vacuum of power was soon picked up by the Almoravids, the first to conquer all of Morocco and to introduce Maliki Sunnism in a stable and systematic way.
The Almoravids and the exploits of the Malikites
Originally the Almoravids were an Amazigh tribal confederation called Sanhaja which populated the region of the same name (roughly located between the westernmost part of the Sahara desert and the southeasternmost part of the Maghreb) and which starting from the 9th century had converted to ‘Sunni Islam. Exploiting religious zeal, the confederation had expanded more and more in the region, but, due to internal disagreements and external rivals, it had de facto crumbled, causing in them a great desire for revenge; it was at this point that one of the most decisive figures ever for Moroccan religiosity peeped into history: Abdallah ibn Yasin.

Around 1040 Yahya ibn Ibrahim, one of the chieftains of the Sanhaja, went on a pilgrimage and on his return made a stop in Kairouan, in present-day Tunisia, where he met the great Malikite Abu Imran al Fasi, to whom he asked how to best Islamize his country full of “pagan customs”. The great jurist then named him Abdallah ibn Yasin, a theologian of his own school of thought, known for his rigorous positions regarding the Koran and the Sunnah and his rejection of all tribal customs. His zeal proved to be fundamental for the conquest of the Almoravids, who soon succeeded in conquering the territories of today’s Mauritania, Western Sahara, Morocco and even Andalusia, giving the empire a new capital, Marrakech, and linking it forever to the malikism. In 1146 the Almoravids will fall and the Almohads will arrive in their place.
Ibn Tumart and the Almohads
These were initially a religious movement founded by Ibn Tumart, an Amazigh scholar who had studied extensively in Andalusia, then traveling to Baghdad, where, according to tradition, he even met al Ghazali. It was precisely here that Ibn Tumart elaborated his own creed, combining different elements from each other belonging to multiple religious currents often and willingly opposed to each other. Ibn Tumart’s religious thought was even more rigorous than that of Yahya ibn Ibrahim and he blamed the Almoravids and the Malikites for having anthropized God, placing the human being at the center of their thoughts not so much the Absolute but the human being. It is precisely from this contrast that their name in Arabic “al-Muwwahidun” derives, or “those who affirm the uniqueness of God”, only later Latinized into “Almohads”.

After having had some misadventures on the return journey, Ibn Tumart settled just outside Bejaia, in Algeria, and began to preach his Islam to those who would later become the key men of his political-spiritual revolution. In 1120, after a harsh verbal confrontation with the Almoravids, he found refuge in the Masmouta tribal confederation, declaring himself the new Mahdi in 1121 and starting a real holy war against the sovereigns of Morocco. With the death of Ibn Tumart in 1130, the command will pass to Abd al Mu’min, who in 1147 will conquer Marrakech, also occupying a large part of today’s Algeria, Tunisia and Andalusia. Under their potentate Islamic thought will enjoy one of its highest points, with figures such as Ibn Tufayl and Ibn Rushd (Averroes) as the main representatives. With the political decline of the Almohads, however, Malikite Sunnism once again became by far the predominant denomination in present-day Morocco, as it is today.
Sufism
Among the most important Sufi orders in Morocco we must undoubtedly mention that of the Shadhiliyya, whose reference figure is Al-Shadhili, born right near today’s Ceuta. This order will acquire more and more importance starting from the 15th century, a period in which it will take the side of Marrakech in an era of increasing tension between the latter and the then capital Fez. It is no coincidence that Sheikh al Jazuli dates back to that historical period, absolutely one of the greatest exponents of this order and today considered among the major saints of the city.

In the centre-north of the country, however, the Jilala brotherhood developed which traces its origins back to Abdul Qadir Gilani and which, unlike the Shadhiliyya, will tend to support Fez in the power struggles against Marrakech. Characteristic of the Jilala is the celebration of moments of maximum mysticism with music and singing, which, in addition to praising saints and remembering God, also serves to get in touch with the jinn, the spirits of Islam.
Gnawa and popular beliefs
This type of ceremony, called “lila”, is also central to the Gnawa. The latter are mostly the descendants of sub-Saharan ex-slaves who, with the abolition of slavery, dedicated themselves to such celebrations, placing the maximum focus on contact with the jinn, going to strengthen this cultural phenomenon also widespread in Algeria. It should be emphasized that, unlike the Jilala, the Gnawa are not so much a Sufi order, but rather an ethnic group which, over time, has mostly transformed itself into a specific musical genre. Also for this reason, their “lila” seem to have an animist substratum which later merged with Sufi practices.
Before closing the topic “Islam in Morocco” it is necessary to underline that here they are particularly developed Magic and the beliefs associated with it, elements that have always been present within the Amazigh world and which, also given the distance of the country from the traditional centers of Islamic power, have found fertile ground to penetrate deep into the Moroccan cultural substrate.
Follow me on facebook, Spotify, YouTube and Instagram, or on the Telegram channel; find all the links in one place: here. Every like, share or support is welcome and helps me to devote myself more and more to my passion: telling the story of the Middle East and the “Islamic world”. Support the Medio Oriente e Dintorni project by financing the Crowdfunding active from 12 January 2023, for you many exclusive and preview contents to discover the Middle East and the “Islamic world” at 360 degrees; if crowdfunding goes well it will turn into a Patreon