The Arab Conquest
The first Arab invasion of Morocco is said to have reached the Atlantic coast, but it left no lasting traces, and the real Islamisation of Barbary did not happen till near the end of the eighth century, when a descendant of Ali, driven from Mesopotamia by the Caliphate, reached the mountains above Volubilis and there founded an empire. The Berbers, though indifferent in religious matters, had always, from a spirit of independence, tended to heresy and schism. Under the rule of Christian Rome they had been Donatists, as M. Bernard puts it, "out of opposition to the Empire"; and so, out of opposition to the Caliphate, they took up the cause of one Moslem schismatic after another. Their great popular movements have always had a religious basis, or perhaps it would be truer to say, a religious pretext, for they have been in reality the partly moral, partly envious revolt of hungry and ascetic warrior tribes against the fatness and corruption of the "cities of the plain."
Idriss I became the first national saint and ruler of Morocco. His rule extended throughout northern Morocco, and his son, Idriss II, attacking a Berber tribe on the banks of the Oued Fez, routed them, took possession of their oasis and founded the city of Fez. Thither came schismatic refugees from Kairouan and Moors from Andalusia. The Islamite Empire of Morocco was founded, and Idriss II has become the legendary ancestor of all its subsequent rulers.
The Idrissite rule is a welter of obscure struggles between rapidly melting groups of adherents. Its chief features are: the founding of Moulay Idriss and Fez, and the building of the mosques of El Andalous and Kairouiyin at Fez for the two groups of refugees from Tunisia and Spain. Meanwhile the Caliphate of Cordova had reached the height of its power, while that of the Fatimites extended from the Nile to western Morocco, and the little Idrissite empire, pulverized under the weight of these expanding powers, became once more a dust of disintegrated tribes.
It was only in the eleventh century that the dust again conglomerated. Two Arab tribes from the desert of the Hedjaz, suddenly driven westward by the Fatimites, entered Morocco, not with a small military expedition, as the Arabs had hitherto done, but with a horde of emigrants reckoned as high as 200,000 families; and this first colonizing expedition was doubtless succeeded by others.
To strengthen their hold in Morocco the Arab colonists embraced the dynastic feuds of the Berbers. They inaugurated a period of general havoc which destroyed what little prosperity had survived the break-up of the Idrissite rule, and many Berber tribes took refuge in the mountains; but others remained and were merged with the invaders, reforming into new tribes of mixed Berber and Arab blood. This invasion was almost purely destructive, it marks one of the most desolate periods in the progress of the "wasteful Empire" of Moghreb.