The Africa with which the crusaders were familiar stretched from Egypt to the Atlantic Ocean, divided between the Nile Valley to the east and the bloc of the Atlas to the west by the Sahara, which reaches the sea at the base of the Gulf of Syr- tis. In the Middle Ages, Cyrenaica belonged as a rule to Egypt, while Tripolitania belonged to Ifriqiya. Ifriqiya, comprising Tripolitania, Tunisia, and eastern Algeria, was the former Byzantine province of Africa, which had become an independent state following the Arab conquest, with its capital at Qayrawân. By the middle of the eleventh century the former provinces of Mauretania in western Algeria and northern Morocco were occupied by a string of little Muslim capitals of which the most important were Fès and Tlemcen, in the midst of a tribal Berber countryside. Ifriqiya enjoyed close relations with Muslim Sicily, while to the west the main connections were with Muslim Spain.
Together these lands formed the Maghrib, the Muslim West. They were bound together by routes running east and west, by land and sea, from Muslim Spain to Egypt. At various points these routes branched away southward across the Sahara to the Bilād al-Sūdān (Land of the Blacks). Exploited by North African merchants and the nomads of the desert, these Saharan routes brought gold and slaves from this largely pagan region. Within a predominantly rural Berber population, a literate Arabic population was centered on the cities. Under the rule of Islam, the native Christian population had been reduced to a small minority in the main cities and the oases of southern Ifriqiya, its five Roman bishoprics about to disappear.
The middle of the eleventh century was a time of crisis. The dynastic state of the Zīrids in Ifriqiya disintegrated, while nomads from the Sahara captured both Fès and Tlemcen to found a new empire. The two events were not unconnected. The Zīrids at Kairouan owed their allegiance to the Shī‘ite Fātimid caliphate in Egypt, but switched in 1048 to the Sunnī ‘Abbāsid caliphate at Baghdad. This was done to turn the tables on the Sunnī jurists who governed public opinion, on rebellious tribes in the south, and on their cousins the Hammādids in the highlands of Ifriqiya to the west. The attempt to build a new empire failed at the battle of Haydarān in 1052, when the Zīrid army was ambushed by Arab Bedouin tribes of the Banû Hilāl, migrating into the country from the east. The Sultan Mu‘īzz ibn Bādīs was driven to take refuge in Mahdia on the Tunisian coast in 1057, and return to his Fātimid allegiance in 1058.
Over the next half century the Zīrid dominions were reduced to a collection of city-states and tribal lordships, while the Hammādids retreated from the highlands to their new city of Bejaïa(Bougie) on the coast. The countryside was occupied by the warrior tribes of the Banû Hilāl at the beginning of their expansion across North Africa to Morocco. Meanwhile the Sunnī jurists of Kairouan had inspired the mission of Ibn Yāsīn to the Berber tribes of the western Sahara, inciting them to form the Almoravids (Arab. al- Murābitūn), an army of believers “bound together” for an attack upon the enemies of Islam at home and abroad. Having conquered the western Sahara in the 1050s, and taken control of the trans-Saharan trade from Sijilmasa in the north to Awdaghust in the south, the Almoravids crossed the High Atlas to found Marrakesh in 1070, and capture Fès and Tlemcen by 1085.
The outcome was a historic reversal of roles. Since the time of Carthage, the center of power in North Africa had lain, along with the center of civilization, in the far northeast. Roman power had mapped that civilization on the ground, confining the tribal Berbers (literally “the barbarians”) to the mountains, or excluding them from the empire with the fortified line of the frontier. The Arabs had remained largely within this Roman boundary, simply substituting Kairouan for Carthage as their capital. But the Arabs’ identification of the Berbers as a Muslim nation had opened the way to their entry into the new civilization, until the point at which the tribesmen of the desert, far beyond the Roman frontier, declared themselves the champions of that civilization. As Ifriqiya disintegrated, the Almoravid capital of Marrakesh in southern Morocco transferred the center of power in North Africa from the far northeast to the far southwest. There it remained for the next two hundred years, in the hands of peoples who had hitherto been beyond the pale.
This destiny was assured, and its fate eventually determined, by confrontation with the Christian enemy in Spain and Sicily, where the second half of the eleventh century was equally critical. While the Normans slowly conquered Sicily between 1060 and 1095, the fall of Toledo to Castile in 1085 led to the invasion of Spain by the Almoravids; by the time of the death of their emir Yûsufibn Tāshfin (1105), Muslim Spain had been incorporated into his empire. The annexation of this highly civilized land in such a great cause gave that empire a grandeur and a substance that it otherwise lacked, and ensured the permanence of its achievement in North Africa. Under Yûsuf’s son ‘Alī, Marrakesh grew rich and cultivated in the Andalusian manner. But ‘Alī himself was a pious prince, no warrior like his ferocious father. His government was fettered by the legalism of the jurists on whom he relied, while the Almoravids themselves remained foreign and unpopular. On both counts the Almoravids were challenged by yet another Berber prophet, Ibn Tûmart, a man from the Atlas to the south of Marrakesh, who formed the Berbers of the mountains into yet another militant Muslim community and army for the conquest of empire: the Almohads (Arab. al-Muwahhidün), “Unitarians” who proclaimed the Oneness of God.
The message of Ibn Tûmart was the opposite of that of Ibn Yâsin, the prophet of the Almoravids. He brought to the Maghrib the doctrine of the great revivalist al-Ghazālī, to the effect that the ramifications of the law elaborated by the Almoravid jurists of the Malikī school obscured the truth of the Qur’ān. In bringing this doctrine to the Berbers of the High Atlas, Ibn Tûmart declared himself to be the Mahdī, that is, the one sent from God with the divine light to restore the world to perfection. Denouncing the Almoravids at Marrakesh, he took refuge in the mountains to the south, where his community of regimented tribesmen was inherited after his death in 1130 by his chosen caliph, or successor, ‘Abd al- Mu’min. At the death of ‘Alī in 1142, Abd al-Mu’min opened a campaign that culminated in 1147 with the capture of Marrakesh and the massacre of its rulers. He then inherited their empire, and went on not only to recover but to enlarge it.
Not all of Muslim Spain submitted, and it was 1172 before his son finally reunited the country. ‘Abd al-Mu’min’s great achievement in the 1150s was to add Ifriqiya to the empire, and thus to unite the whole of North Africa. He did so as a man of destiny, with the added provocation of the occupation of the Ifriqiyan coast by the Normans of Sicily. After the repulse of an attack upon Mahdia in 1123, the conquest of Ifriqiya took place between 1134-1135 and 1153-1154, beginning with the island of Jerba, going on to the Kerken- nah islands and Tripoli (mod. Tarābulus, Libya) in 1145-1146, and ending at Bone (Annāba) in 1153-1154. It centered, however, on the capitulation of Mahdia in 1148, and the flight of the last Zīrid sultan, Hasan, to Marrakesh. Only Tunis had escaped. After his conquest of the central Maghrib in 1152-1154, ‘Abd al-Mu’min came in 1159-1160 to take Tunis, drive the Normans from Mahdia, and annex the whole of Ifriqiya, which was reconstituted as a province of the empire with Tunis as its capital. What remained of native Christianity probably disappeared with the Normans. The unification of North Africa by the Islam of the Berbers was then complete, an achievement that survived the breakup of the empire in the middle of the thirteenth century.
Over such a distance from Marrakesh, Ifriqiya nevertheless remained a problem down to the eve of the empire’s decline and fall. For twenty years Almohad control was threatened by the last of the Almoravids, who invaded Ifriqiya from the Balearic islands in 1184, and by Qarâqush, one of Saladin’s mamlüks (slave soldiers) out to win a dominion for himself in the west. A major expedition of the caliph al-Nāsir was required to drive them down into the Sahara in 1205. Ifriqiya was then entrusted to one of the great Almohad princes, who finally defeated the Almoravids in 1209, and went on to found the Hafsid dynasty at Tunis. This achievement, however, was almost immediately followed by the defeat of the Almohad army in Spain by the Christians at Las Navas de Tolosa (1212), which fatally undermined the power and authority of ‘Abd al-Mu’min’s dynasty. Its rule finally broke down after 1229 in conflict between the caliphs and the Almohad shaykhs. Spain was lost, while the establishment of the Marīnids at Fès confined the last of the dynasty to Marrakesh, until it too fell to the Marīnids in 1269. In 1236, the Hafsid ruler of Tunis declared his independence, and in 1253 his successor claimed the caliphate, although neither was able to reconstitute its empire. Ifriqiya became a family dominion, with a second capital at Bejaïa. The Marīnids at Fès and the ‘Abd al- Wādids (Zayyānids) at Tlemcen divided Morocco and western Algeria between them.
The Marīnids and ‘Abd al-Wādids were both dynasties of nomadic Berber origin. From 1235, the latter turned Tlem- cen into a capital that flourished on the transit trade in West African gold to Europe. The Marīnids at Fès, on the other hand, aspired with greater determination than the Hafsids to re-create the old empire. At Fès they built a new citadel and a series of religious colleges to create an educated class of scholars in the tradition of the Mālikī school. Abroad, their imperialism dominated North Africa for the next hundred years. A series of expeditions to Spain between 1275 and 1285 was followed by a determined attempt to conquer Tlemcen between 1295 and 1307. The climax came in the middle of the fourteenth century, beginning with the capture of Tlemcen by the sultan Abu’l-Hasan in 1337, continuing with his defeat in Spain in 1340 and the loss of Algeciras in 1344, and culminating between 1347 and 1357 in successive invasions and retreats from Ifriqiya by Abu’l-Hasan and his son Abû ‘Inān. Disputed successions frustrated further adventures, and by the fifteenth century the Marīnid dominion had shrunk back to Fès. The power of the Hafsids, by contrast, revived between 1394 and 1488 under two long- lived sultans, with the ironic result that under these heirs of the Almohads, the center of political gravity in North Africa returned to its former location in the northeast.
The best testimony to the interrelationship of the post- Almohad rulers of North Africa is that of the historian Ibn Khaldûn in the second half of the fourteenth century. A scion of the Spanish Muslim diaspora prompted by the Christian conquest of the greater part of Muslim Spain in the middle of the thirteenth century, he served all three dynasties in turn. At the same time he is the prime witness to the irony that under these great Berber dynasties, North Africa was being steadily Arabized. Partly this was because Arabic was the language of literacy; partly because of the prestige of an Arab and especially Sharifian genealogy, claiming descent from the Prophet himself; but increasingly because of the spread of a Bedouin Arabic vernacular across the countryside from east to west. This phenomenon was a consequence of the establishment of the warrior Arab tribes of the Banū Hilāl as an estate of the Almohad realm, joining the government of a makhzan, “magazine,” state of tax and rent collectors. Under this fiscal regime, poor Bedouin were forced into cultivation together with displaced or newly subjected peasants, forming new semitribal communities, frequently under some Sufi saint. With the population in flux, the old Berber languages shrank back toward the mountains where the Romans had confined their speakers. The Sufi saints, meanwhile, were colonists bringing the land under cultivation. Patronized by government, their residences grew into monastery-like ensembles of tombs, mosques, colleges, and hostelries with important economic, social, and political functions. At the other extreme they were leaders of popular rebellions against fiscal oppression.
The commercial economy meanwhile profited from the growing markets of western Europe and the regions south of the Sahara. Manufactures, many from across the Mediterranean, were sent across the Sahara in exchange for slaves and gold, which then were largely exported to Europe, together with the produce of North Africa itself: wool (called Merino, from Marīnid), leather, and wax (fromBejaïa or Bougie, whence Fr. bougie, “wax candle”). Sea trade was in the hands of Italians and Catalans, as was sea power, except in the Strait of Gibraltar, kept by the Moroccan fleet until 1344. Commerce dictated generally good relations with Europe, governed by treaties that extended to churches for the Christian mercenaries employed at Tunis. North African piracy, however, was a major activity, and together with Christian piracy contributed to intermittent hostilities. Ifriqiya in particular was once again exposed to invasion, first of all by King Louis IX of France in his crusade to Tunis in 1270, then by the Aragonese in Sicily, who for fifty years (1284/1285-1335) occupied Jerba and the Kerkennah islands. Piracy was the provocation for the brief recapture of Jerba by the Genoese and Pisans in 1388, and the siege of Mahdia by the French and Genoese in 1390.
In the fifteenth century the Reconquista (the Christian reconquest of Iberia from the Muslims) extended across the Strait of Gibraltar with the Castilian sack of Tetuan in 1399, and the Portuguese capture of Ceuta in 1415. As the Moroccan state weakened, Tangier, Arzila, and Larache were taken by the Portuguese in 1471, and Agadir, Agouz, Safi, Maza- gan, and Azemmour further south on the Atlantic coast between 1505 and 1514; the motive was crusading zeal mixed with the commercial development of the route around Africa. Following the conquest of Granada in 1492, and the death of the last great Hafsid sultan in 1488, the Spaniards took Melilla in 1497, and Mers el Kebir, Oran, Bejaïa, and Tripoli between 1505 and 1510, together with the Penons, the offshore islets of Velez, Alhucemas, and Algiers; in their case, crusading zeal was specifically combined with defense against the piracy that their expulsion of the Moors from the peninsula had converted into a form of holy war. The outcome was the Ottoman conquest of the Hafsid and ‘Abd al- Wādid dominions, and the creation of the Sharifian Empire of the Sa‘dians in Morocco, two revolutions that established the modern states of North Africa.