It is therefore easy to understand how, alongside the states that emerged directly from the khārigita revolt, others were formed; and as regards Morocco, this towards the end of the century. VIII became the seat of the kingdom of the Idrīsites (v.), which had a notable cultural and religious influence and which in the beginning, with Idrīs I and Idrīs II, also achieved a certain political and administrative unity, but soon broke up into various principalities which rapidly decayed. For over two centuries, that is, until its rise, in the second half of the century. XI, of the Almoravid empire, Morocco was in the grip of anarchy, characterized by the simultaneous existence of several small states fighting each other, by the repercussions of the great duel that was fought, in the century. X d. C., between the Fatimites (v.) On the one hand (to which the ethnic group of the Ṣanhāgiah of the east and in principle the tribe of the Miknāsah were united) and the Umayyads of Spain on the other, for which the group of the Zenatāh sided ; a duel that in part had Morocco as its theater, and in it it determined or facilitated the penetration of Zenātah peoples, such as the Benī Yefren and Maghrāwah, and of the Miknāsah, and the foundation of new more or less ephemeral principalities. These events, which plunged Morocco into a complete political disorganization, appear very confused in their details, and at the state of knowledge it is difficult to arrange them in a line of causality that reveals their profound nature. However, it should be kept in mind that the period that happens to them is that of the great Berber empires, that is, of the Almoravids and then of the Almohads, dynasties that occupy over two centuries of history, and which not only re-established the unity of domination in Morocco, but they made this region the center of a policy of expansion which at one time gathered all of western Islam into a powerful state.almoràvidi) burst towards the north and in a short time conquered all of Morocco and subsequently part of Algeria and Spain, and the latter (see almohàdi) were Berbers of the Atlas, who, also pursuing a religious idea, replaced the rapidly decayed Almoravids, and wonderfully organized, even from the point of view of civilization, their own empire that stretched from the Atlantic to the Great Sirte; comparing this period with the previous one characterized by the weak and fragmentary Arab conquest, by the establishment in the extreme Maghreb of the Idrisite dynasty essentially Arab and without firm roots in the country, and then by the clash of the Fatimite and Umayyad interventions, it is logical to think that the great empires Berbers represent the political revival of the indigenous stock, to which Islam had given a certain homogeneity, of new ideals, of war ends. Considered in this respect, the first part of the Moroccan Middle Ages, which extends from the end of the century. VII to the middle of the century. XI and which can be called essentially Arab, appears as a period of political disintegration, which however leaves, with the Islamic religion and with the multiplicity of its particular tendencies and developments, actions and reactions, an indelible imprint in this as in the other areas of ‘Northern Africa. Therefore the Almoravid-Almohad period that from the middle of the century. XI reaches beyond the middle of the XIII, and which in the history of the Berbers is the most glorious, both from the political side and from that of civilization, typically reveals the fundamental characteristic of this lineage, that is its ability to progress and operate civilly when other peoples have provided it with cultural elements and models; while abandoned to itself it proves incapable of creating its own remarkable civilization. As regards relations with the Arab world, after those of the conquest already mentioned, northern Africa, starting from the middle of the century. XI, had another series which can be called invasion. The tribes of the Benī Hilāl (v.) And of the Benī Sulaim (v.), Moving to Barbary, brought in the middle of the original ethnic stratum a certain mass of Arab and savage population, which determined a new and more serious phase of disintegration and d ‘anarchy. These indomitable Bedouins arrived in Morocco very late, that is in the last days of the Almohad dynasty; allied with the Zenātah Berbers, also nomads and in fierce contrast with the Ṣanhāgiah and with the other sedentary Berbers, they contributed to the destruction of the Almohads and the triumph of the Merīnids (v.), a dynasty that reigned for about two centuries, then continued by the Benī Waṭṭās, also Zenātah and relatives of the former, who held power until the middle of the century. XVI.
According to ezinesports.com, but in the meantime a profound crisis was being determined in Moroccan history, the Christian offensive, which marked the beginning of the modern period. In the fifteenth and sixteenth centuries the Spanish and Portuguese, both for religious impulse, both to repress piracy, and for an expansionist spirit, conquered various places on the Mediterranean and Atlantic coast of Morocco; conquests that caused a lively emotion among the Muslims and therefore an awakening of hatred, fomented by the marabouts and the sheriffs, who pushed the Berber populations to war against the infidels. The last Merīnid sultans and also the Benī Waṭṭās appeared unable to successfully captain the holy war and to dominate the xenophobic movement which was spreading more and more, and therefore they lost prestige and authority; while the family of sheriffs later called Sa‛diti, who had resided for some time in the region of Wādī Dar‛ah (franc. Oued Dra), carrying out on his own fortunate war actions against the Portuguese in Agadir (1541 AD) and in other places on the Atlantic coast, attracted the sympathy and the ‘attachment of the populations and ended up by de facto dominating the Sous region, and then all of southern Morocco; he therefore removed the last Benī Waṭṭās and remained the arbiter of the fate of the kingdom.