One of the most dramatic and sudden movements of any people in history is the expansion, by conquest, of the Arabs in the 7th century (only the example of the Mongols in the 13th century can match it). The desert tribesmen of Arabia form the bulk of the Muslim armies. Their natural ferocity and love of warfare, together with the sense of moral rectitude provided by their new religion, form an irresistible combination.

When Muhammad dies in 632, the western half of Arabia is Muslim. Two years later the entire peninsula has been brought to the faith, and Muslim armies have moved up into the desert between Syria and Mesopotamia.

Muslim North Africa: from642

The Arab conquest of Egypt and North Africa begins with the arrival of an army in640 in front of the Byzantine fortified town of Babylon (in the area which is now Old Cairo). The Arabs capture it after a siege and establish their own garrison town just to the east, calling it Al Fustat.

The army then moves on to Alexandria, but here the defences are sufficient to keep them at bay for fourteen months. At the end of that time a surprising treaty is signed. The Greeks of Alexandria agree to leave peacefully; the Arabs give them a year in which to do so. In the autumn of 642, the handover duly occurs. One of the richest of Byzantine provinces has been lost to the Arabs without a fight.

The Arabs continue rapidly westwards along the coast of North Africa, capturing Cyrenaica in 642 and Tripoli in 643. But these remain largely ineffective outposts. For nearly three decades the Arabs make little progress in subduing the indigenous Berber inhabitants of this coastal strip.

The turning point comes in 670 with the founding of a new Arab garrison town at Kairouan, about sixty miles south of the Byzantine city of Carthage. From this secure base military control becomes possible. Carthage is destroyed (yet again) in 698. By the early 8th century northwest Africa is firmly in Arab hands. In 711 an Arab general takes the next expansionist step. With a Berber army he crosses the straits of Gibraltar and enters Spain.

The north African coast remains from now on in Muslim hands, but it proves impossible to exercise effective control over it from the centre of the caliphate - whether in Damascus or Baghdad. Instead various local Berber dynasties win power.

These include the Idrisids (established from 790 in Fez) and the Aghlabids (ruling from 800 in Kairouan). But by far the most powerful are the Fatimids, of the Ismaili sect. Early in the 10th century they organize an uprising against the Aghlabid dynasty in Kairouan.

The Fatimid dynasty: 909-1171

An Ismaili leader, Ubaydulla, conquers in 909 a stretch of north Africa, displacing the Aghlabids in Kairouan. He founds there a dynasty known as Fatimid - for he claims to be a caliph in the Shi'a line of descent from Ali and Fatima his wife, the daughter of Muhammad (see The Shi'as).

Sixty years later, in 969, a Fatimid army conquers Egypt, which now becomes the centre of a kingdom stretching the length of the north African coast. A new capital city is founded, adjoining a Muslim garrison town on the Nile. It is called Al Kahira ('the victorious'), known in its western form as Cairo. In the following year, 970, the Fatimids establish in Cairo the university mosque of Al Azhar which has remained ever since a centre of Islamic learning.

At the height of Fatimid power, in the early 11th century, Cairo is the capital of an empire which includes Sicily, the western part of the Arabian peninsula (with the holy places of Mecca and Medina) and the Mediterranean coast up to Syria.

A century later the authority of the Ismaili caliphs has crumbled. There is little opposition in 1171 when Saladin, subsequently leader of the Islamic world against the intruding crusaders, deposes the last of the Fatimid line. And there is no protest when Saladin has the name of the Abbasid caliph in Baghdad included in the Friday prayers in Cairo's mosques. After a Shi'a interlude, Egypt is back in the Sunni fold.

The Almoravids: 1062-1147

From the mid-11th century Berbers are moving north, from the western Sahara up past the Atlas mountains. Known as the Almoravids, they are fired by a new zeal for Islam, the result of a pilgrimage to Mecca by their chieftain in 1040. In 1062 they establish a base at Marrakech, from which during the next twenty years they conquer the whole of northwest Africa.

The Almoravid territory in north Africa stretches along the coast as far as Algiers. Spain, across the narrow Straits of Gibraltar, is a natural extension. And in 1085 the Almoravids receive a request for help from the Spanish Muslims, who have recently suffered a series of defeats at Christian hands.

The Almoravids - with armies of their own Berber tribesmen - arrive in Spain in 1086 and rapidly overrun the territories recently gained by the Christians. Only on the east coast do they meet their match in the buccaneering El Cid, who captures Valencia in 1094.

Though stricter in religion than the Umayyads, the Almoravid sultans continue the traditions of Muslim Spain; indeed they introduce its architecture to the other half of their empire, in north Africa. But they soon begin to lose control in both regions. The Christian reconquest in Spain begins anew with the capture of Saragossa in 1118. Meanwhile Marrakech, the Almoravid capital in Africa, falls in 1147 to a more puritanical dynasty of Berbers, the Almohads.

The Almohads: 1147-1248

The Almohads, like the Almoravids, are a Berber tribe practising a strict version of Islam. They come from the Atlas mountains and are first inspired by an enthusiast who in the early 12th century declares himself to be the Mahdi. In 1147 his followers capture the Almoravid capital, Marrakech.

By 1159 the Almohads have conquered the entire north African coast as far east as Benghazi, bringing all Berbers within a single empire. Meanwhile their rule extends over the water to the other half of the Berber realm, in Spain.

The Almohads move rapidly into southern Spain after their defeat of the Almoravids in Morocco. Seville falls to them in 1147, the same year as Marrakech. They make it their Spanish capital, building the Alcázar Palace and the lower part of the Giralda, now the famous belfry of Seville cathedral; in origin it is the minaret of the main Almohad mosque.

The decline of Almohad power, and the decisive phase of the Christian reconquest, begins with the defeat of the Muslims at Las Navas de Tolosa, in 1212, by the combined armies of Castile, Aragon, Navarre and Portugal. Cordoba falls to the Christians in 1236 and Seville in 1248. Meanwhile, in 1238, Aragon recovers Valencia (held by the Muslims since the death of El Cid).

In north Africa the collapse of this greatest of Berber kingdoms takes a little longer, with the Almohads only gradually losing control. In about 1229 their governor in Tunis declares himself independent and establishes a dynasty of his own, the Hafsids. In 1248 another Berber tribe, the Marinids, capture Fès, which they make their capital and develop into an impressive city; in 1269 they take Marrakech and bring to an end Almohad rule in Morocco.

The Marinid dynasty lasts until the 15th century, and the Hafsid rulers survive a century longer. By then northwest Africa and the Barbary coast is disputed between the adventurers and pirates of Portugal, Spain and Turkey.

The Barbary coast: 16th - 20th century

With the decline of the local Berber dynasties in the 15th and 16th centuries, the valuable coastal strip of north Africa (known because of the Berbers as the Barbary coast) attracts the attention of the two most powerful Mediterranean states of the time - Spain in the west, Turkey in the east.

The Spanish-Turkish rivalry lasts for much of the 16th century, but it is gradually won - in a somewhat unorthodox manner - by the Turks. Their successful device is to allow Turkish pirates, or corsairs, to establish themselves along the coast. The territories seized by the corsairs are then given a formal status as protectorates of the Ottoman empire.

The first such pirate establishes himself on the coast of Algeria in 1512. Two others are firmly based in Libya by 1551. Tunisia is briefly taken in 1534 by the most famous corsair of them all, Khair ed-Din (known to the Europeans as Barbarossa). Recovered for Spain in 1535, Tunisia is finally brought under Ottoman control in 1574.

Piracy remains the chief purpose and main source of income of all these Turkish settlements along the Barbary coast. And the depredations of piracy, after three centuries, at last prompt French intervention in Algeria. This, at any rate, is stated by the French at the time to be the cause of their intervention. The reality is somewhat less glorious.

Algiers is occupied by the French in 1830, but it is not until 1847 that the French conquest of Algeria is complete - after prolonged resistance from the Berber hinterland, which has never been effectively controlled by the Turks on the coast.

It is in the European interest to police this entire troublesome Barbary region. Tunisia becomes a French protectorate in 1881, and Morocco (which has maintained a shaky independence, under its own local sultans, since the end of the Marinid dynasty) follows in 1912. Italy takes Libya from the Turks in 1912. The regions of the Barbary coast thus enter their last colonial phase before independence.

Egypt: 1517-1956

The eastern section of north Africa, site of the continent's earliest civilization, passes through three relatively insignificant centuries after it is brought (in 1517) within the Ottoman empire. As a remote and semi-independent province, Egypt lapses into periods of anarchy. Not until the rule of Mohammed Ali, in the 19th century, does it recover its natural cohesion.

Mohammed Ali's descendants introduce into Egypt western customs and finance. The result is increasingly close involvement with the British, eager to protect the shortest route to India after the opening of the Suez canal in 1869.

Riots in Egypt in 1882 prompt the British to move in troops, in effect occupying the country. But unlike the majority of African regions in the late 19th century, Egypt does not become a colony. It remains ostensibly a province of the Ottoman empire, still governed by descendants of Mohammed Ali but with a strong British military presence.

More genuine independence is achieved in 1922 when Egypt becomes a kingdom, through British troops remain to protect the Suez canal. The final steps to full Egyptian independence are in the 1950s, culminating in the Suez crisis of 1956. This is also the decade in which the rest of north Africa wins or fights for freedom.

Independence: 1951-1962

Among the north African nations on the Mediterranean coast west of Egypt only one achieves independence without a struggle. This exception is Libya, and the reason is the defeat of Italy in World War II. After the war the future of Italy's main African colony is referred to the United Nations. The result is a referendum, followed by the independence of Libya (as a kingdom) in 1951.

The three French colonies to the west all engage in a prolonged fight for their freedom. But two of them, Tunisia and Morocco, benefit from the greater determination of the French to retain Algeria.

When the Algerian situation erupts in terrorist violence in 1954, the French reaction is to concede the issue elsewhere so as to concentrate on this more crucial struggle. The result is that Tunisia and Morocco are both granted independence in 1956.

The Algerian crisis escalates over the next few years (incidentally bringing de Gaulle back into power), but finally - in 1962 - France recognizes Algeria as an independent nation. After several millennia of shifting patterns of power, dating back to the Egypt of the pharaohs in the east and to Carthage in the west, the north African coastline emerges in its present form as five modern nations.