Muslim rule in North Africa west of the Nile valley was commenced under conditions very different from those prevailing in Egypt and Syria. The Arabs found this land occupied by the Berbers or Libyans, the same race which from the time of the earliest Pharaohs had been a perpetual menace to Egypt, and which, on the Mediterranean seaboard, had offered a serious problem to Phœnician, Greek, Roman and Gothic colonists. For some thousands of years these Berbers had remained very much the same as when they had emerged from the neolithic stage, and were hardy desert men like the Arabs in pre-Islamic times. Their language was not Semitic, but shows very marked Semitic affinities, and, although language transmission is often quite distinct from racial descent, it seems probable that in this case there was a parallel, and this is best explained by supposing that both were derived from the neolithic race which at one time spread along the whole of the south coast of the Mediterranean and across into Arabia, but that some cause, perhaps the early development of civilization in the Nile valley, had cut off the eastern wing from the rest, and this segregated portion developed the peculiar characteristics which we describe as Semitic. The series of Greek, Punic, Roman, and Gothic settlements had left no permanent mark on the Berber population, on their language, or on their culture. At the time of the Arab invasion the country was theoretically under the Byzantine Empire, and the invading Arabs had to meet the resistance of a Greek army; but this was not a very serious obstacle, and the invaders were soon left face to face with the Berber tribes.

The Muslim invasion of North Africa followed immediately after the invasion of Egypt, but the internal disputes of the Muslim community prevented a regular conquest. It was not until a second invasion took place in A.H. 45 (= A.D. 665) that we can regard the Arabs as commencing the regular conquest and settlement of the country. For centuries afterwards the Arab control was precarious in the extreme, revolts were constantly taking place, and many Berber states were founded, some of which had an existence of considerable duration. As a rule there was a pronounced racial feeling between Berbers and Arabs, but there were also tribal feuds, and Arab policy generally aimed at playing off one powerful tribe against another. Gradually the Arabs spread all along North Africa and down to the desert edge, their tribes as a rule occupying the lower ground, whilst the older population had its chief centres in the mountainous districts. During the invasion of 45 the city of Kairawan was founded some distance south of Tunis. The site was badly chosen, and is now marked only by ruins and a scanty village, but for some centuries it served as the capital city of Ifrikiya, which was the name given to the province lying next to Egypt, embracing the modern states of Tripoli, Tunis, and the eastern part of Algeria up to the meridian of Bougie. West of this lay Maghrab, or the “western land,” which was divided into two districts, Central Maghrab extending from the borders of Ifrikiya across the greater part of Algeria and the eastern third of Morocco, and Further Maghrab, which spread beyond to the Atlantic coast. In these provinces Arabs and Berbers lived side by side, but in distinct tribes, the intercourse between the two varying in different localities and at different times. For the most part each race preserved its own language, the several Arabic dialects being distinguished by archaic forms and a phonology somewhat modified by Berber influences; but there are instances of Berber tribes which have adopted Arabic, and some of the Arab and mixed groups have preferred the Berber language.

The religion of Islam spread rapidly amongst the Berbers, but it took a particular development, which shows a survival of many pre-Islamic religious ideas. The worship of saints and the devotion paid at their tombs is a corruption which appears elsewhere, on lines quite distinct from the Asiatic beliefs as to incarnation or transmigration, and in the west this saint worship takes an extreme form, although here and there are tribes which reject it altogether, as is the case with the B. Messara, the Ida of South Morocco, etc. Pilgrimages (ziara) are made to saints’ tombs, commemorative banquets are held there (wa´da or ta´an), and acts of worship, often taking a revolting form, are paid to living saints, who are known as murabits or marabouts, a word which literally means “those who serve in frontier forts (ribat),” where the soldiers were accustomed to devote themselves to practices of piety. These saints are also known as sidi (lords), or mulaye (teachers), and in the Berber language of the Twaregs as aneslem, or “Islamic.” Very often they are insane persons, and are allowed to indulge every passion and to disregard the ordinary laws of morality. Even those living at the present day are credited with miraculous powers, not only with gifts of healing, but with exemption from the limitations of space and from the laws of gravity (cf. Trumelet: Les saints de l’islam, Paris, 1881); in many cases the same saint has two or more tombs, and is believed to be buried in each, for it is argued that, as he was able to be in two or more places at once during life, so his body can be in several tombs after death. All this, of course, is no normal development of Islam, to which it is plainly repugnant. How thin a veneer of Muslim usages covers over a mass of primitive animism may be seen from Dr. Westermarck’s essay on “Belief in spirits in Morocco,” the firstfruits of the newly established Academy at Abo in Finland (Humaniora. I. i. Abo, Finland, 1920), and from Dr. Montet’s Le culte des saints musulmans dans l’Afrique du nord (Geneva, 1905).

Amongst the Berber tribes in perpetual conflict with the Arab garrisons there was always a refuge and a welcome for the lost causes of Islam, and so almost every heretical sect and every defeated dynasty made its last stand there, so that even now those parts show the strangest survivals of otherwise forgotten movements. No doubt this was mainly due to a perennial tone of disaffection towards the Arab rulers, and anyone in revolt against the Khalif was welcomed for that very fact.

The conquest of Spain towards the end of the 1st cent. A.H. (early 8th cent. A.D.) was jointly an Arab and Berber undertaking, the Berbers being in the great majority in the invading army, and most of the leaders being Berber. Thus in Andalusia the old rivalries between Arab and Berber figure largely in the next few centuries. At first Andalusia was regarded merely as a district attached to the province of North Africa, and was ruled from Ifrikiya.

In A.H. 138, after the fall of the Umayyads in Asia, a fugitive member of the fallen dynasty, `Abdu r-Rahman, failing in an attempt to restore his family in Africa, crossed over to Spain, and there established a new and independent power, with its seat of government at Cordova, and in A.H. 317 one of his descendants formally assumed the title of “Commander of the Faithful.” The Umayyads of Spain very closely reproduced the general characteristics of their rule in Syria. They were tolerant, and made free use of Christian and Jewish officials; they encouraged the older literary arts, and especially poetry, and employed Greek artists and architects; but though doing much for the more material elements of culture, there is no evidence under their rule of any interest in Greek learning or philosophy. Yet, though in a sense old-fashioned, the country was by no means isolated, and we find frequent intercourse between Spain and the east. The religious duty of the pilgrimage has always been an important factor in promoting the common life of Islam, and there is abundant evidence that the Spanish Muslims looked steadily eastwards for religious guidance, accepting the hadith, the canon law, and the development of a scientific jurisprudence as it took shape in the east. Both Muslims and Jews travelled to Mesopotamia in order to complete their education, and thus kept in contact with the more cultured life of Asia. But Spanish Islam had no feeling of sympathy with the philosophical speculation popular in the east, and certainly disapproved the latitudinarian developments which were taking place under the `Abbasids of the third century: its tendency was to a rigid orthodoxy and strict conservatism, its interests were confined to the canon law, Qur´anic exegesis, and the study of tradition.

The reactionary character of Spanish Islam is well illustrated by Ibn Hazm (d. 456 A.H.), the first important theologian which it produced. Rejecting the four recognised and orthodox schools of canon law, and discarding even the rigid system of Ibn Hanbal as not strict enough, he became an adherent of the school founded by Da´ud az-Zahiri (d. 270), which has never been admitted as on the same footing as the other four, and now is totally extinct. In the teaching of that school Qur´an and tradition were taken in their strictest and most literal sense; any sort of deduction by analogy was forbidden; “it is evident that here we have to do with an impossible man and school, and so the Muslim world found. Most said roundly that it was illegal to appoint a Zahirite to act as judge, on much the same grounds that objection to circumstantial evidence will throw out a man now as juror. If they had been using modern language, they would have said that it was because he was a hopeless crank.” (Macdonald: Muslim Theology, p. 110). This was the system which Ibn Hazm now introduced into Spain, and it was one calculated to appeal to the stern puritan strain which undoubtedly exists in the Iberian character. The novel point was that Ibn Hazm applied the principles and methods of jurisprudence to theology proper. Like Da´ud he entirely rejected the principles of analogy and taqlid, that is, the following of authority in the sense of accepting the dictum of a known teacher. As this undermined all existing systems, and required every man to study Qur´an and tradition for himself, it did not receive the approval of the canonists, who, in Spain as elsewhere, were the followers of recognised schools, such as that of Abu Hanifa and the other orthodox systems, and it was not until a full century afterwards that he gained any number of adherents. In theology he admitted the Ash`arite doctrine of mukhalafa, the difference of God from all created beings, so that human attributes could not be applied to him in the same sense as they were used of men; but he carried this a stage further, and opposed the Ash`arites, who, though admitting the difference, had then argued about the attributes of God as though they described God’s nature, when the very fact of difference deprives them of any meaning intelligible to us. As in the Qur´an ninety-nine descriptive titles are applied to God we may lawfully employ them, but we neither know what they imply nor can we argue anything from them. The same method is applied to the treatment of the anthropomorphical expressions which are applied to God in the Qur´an; we may use those expressions, but we have not the slightest idea of what they may indicate, save that we know they do not mean what they would mean as used of men. In ethics the only distinction between good and evil is based on God’s will, and our only knowledge of that distinction is obtained from revelation. If God forbids theft it is wrong only because God forbids it; there is no standard other than the arbitrary approval or disapproval of God.

Although it took a century for these views to obtain any number of adherents, Ibn Hazm was no obscure figure during his lifetime. He became prominent as a violent and abusive controversialist, an opponent of the Ash`arite party and of the Mu`tazilites, curiously enough treating the latter more gently as having limited God’s qualities.

Ibn Hazm lived at a time when the Umayyads of Cordova were already in their decay, and in 422 the dynasty fell. Very soon the whole of Andalusia was split into a number of independent principalities, and this was followed by a period of anarchy, during which the country was exposed more and more to Christian attacks, until at length Mu`tamid, King of Seville, fearing that the Muslim states would disappear altogether under the tide of Christian conquest, advised his co-religionists to appeal for help to the Murabit power in Morocco, which, with much misgiving, they did.

The Murabits, the name is that commonly applied to saints in Morocco, were the product of a religious revival led by Yahya b. Ibrahim of the clan of the Jidala, a branch of the great Berber tribe of Latuna, one of those light-complexioned Berber races such as can still be seen in Algeria, and are apparently nearest akin to the Lebu as they are represented in ancient Egyptian paintings. In 428 (= 1036 A.D.) Yahya performed the pilgrimage to Mecca, and was astonished and delighted at the evidences of culture and prosperity which he saw in the lands through which he travelled, so far exceeding anything which had previously entered his experience. On his return journey he stopped at Kairawan and became a hearer at the lectures given there by Abu Amran. The lecturer was greatly struck by the diligence and attention of his pupil, and greatly surprised when he discovered that he was a product of one of the wild and barbarous tribes of the far west. But when Yahya asked that one of the alumni of Kairawan might be sent home with him to teach his fellow-tribesmen no one was found willing to venture amongst a people who were generally regarded as fierce and savage, until at last the task was undertaken by Abdullah ibn Jahsim. Helped by his companion Yahya commenced a religious revival amongst the Berbers of the West, and seems to have modelled his work on the example of the Prophet, by force of arms urging his reforms upon the neighbouring tribes and laying the foundation of a united kingdom, a work which was continued by his successor, Yusuf b. Tashfin, and so at length a powerful kingdom was established, which extended from the Mediterranean to the Senegal. Many such Berber states were established at various times, but, as a rule, they fell into decay after a couple of generations.