Barbary coast: 16th - 20th century AD
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.
A European carve-up: AD 1900-1912
The process by which Morocco drifts into the colonial care of France (and of Spain, in the northern regions) provides a notable example of how the European powers jockey for position in Africa.
In 1900 France and Italy make a secret agreement assigning Morocco to France and Libya to Italy. In 1902 a similar arrangement between France and Spain provides for the proposed division between them of Moroccan territory. In 1904 France and Britain make a pact: Britain will allow France freedom of action in Morocco (provided that the coast opposite Gibraltar is not fortified) in return for France's acceptance of Britain's role in Egypt.
Meanwhile, as these arrangements are being made round polished tables, Morocco is still ostensibly an independent country ruled, albeit inefficiently, by its own Alaouite dynasty of sultans (on the throne since capturing Fès in 1666).
The colonial consensus, amicably agreed between France, Italy, Spain and Britain, is rudely interrupted in 1905 when the German emperor William II makes a flamboyant and provocative visit to Tangier, Morocco's most international city. Ostensibly visiting the local community of German merchants, he uses the occasion to emphasize that Morocco's independence must be maintained.
The diplomatic flurry caused by this intervention results in a conference held in Algeciras in 1906. With the active encouragement of the internationally minded US president, Theodore Roosevelt, representatives of the European powers and the USA gather to discuss France's relationship with Morocco.
All the powers except Austria-Hungary side with France rather than Germany. The conference affirms the independence of the sultan of Morocco, but at the same time puts in place international supervision of his affairs with the leading role taken by France. This is tantamount, in the long run, to accepting the region as a French colony.
Outbreaks of unrest in Morocco soon make necessary the posting of more French troops, thus increasing the degree of French control. There is a brief international crisis in 1911 when the Germans send a gunboat to Agadir, but the situation is defused in the fashion of the time. France cedes some territory in central Africa to Germany's colony of Cameroon. In return Germany accepts France's role in Morocco.
By 1912 the sultan is powerless to resist this gradual encroachment on his sovereignty. He signs the treaty of Fès, accepting a French protectorate over his entire country - except such regions as the French may themselves decide to allocate to Spain, in recognition of Spanish interests on the Mediterranean coast.
In a separate agreement, later in 1912, France and Spain settle this issue. Spain becomes the colonial power for approximately the northern tenth of the country, including its own historic enclaves of Melilla and Ceuta (in Spanish hands since 1497 and 1580 respectively). It is proposed that Tangier should become a neutral port with an international administration, but the onset of World War I delays the implementation of this.
The effect of the agreements of 1912 is that Morocco becomes, for four decades, a region divided into two very different colonies, French and Spanish, each in many ways more closely linked to the colonial power than to each other.
The colonial decades: AD 1912-1956
The French and Spanish colonial administrations, reinforced by an influx of about half a million Europeans (many with useful specialist skills), make considerable material progress in fields such as transport, education and health. But there is constant resistance to foreign rule - most notably, in the early stages, in the five-year rebellion of Abd-el-Krim.
Abd-el-Krim wins a sensational victory at Anual, in 1921, over a Spanish army of 20,000. Thereafter he wins control of the Rif (the mountainous coastal area from Tetouan to Melilla) until his final defeat in 1926 by a massive joint French and Spanish force, numbering some 250,000 men.
Thereafter the pressure for change is maintained by groups of young educated Moroccans demanding political liberties and even independence. World War II provides a welcome boost to such demands, with the Vichy French administration overwhelmed by the American forces which land on the Moroccan coast in November 1942. When President Roosevelt comes to the Casablanca Conference in 1943, he expresses opposition to continuing French colonial rule.
In 1944 the Istiqlal (Independence) party is formed, with the sultan of Morocco (now Muhammad V) giving tacit support. In 1952 France finally attempts decisive action against the independence movement. The Istiqlal leaders are arrested. In 1953 the sultan is deposed and sent into exile.
The result is an immediate increase in terrorism, followed by an armed uprising in 1955. This happens to coincide with the onset of France's greater crisis in Algeria, a colony with a much higher population of French settlers.
In the circumstances the French government caves in rapidly. Muhammad V is brought back from exile, and in November 1955 the French government accepts the principle of independence for Morocco. It comes into effect in March 1956, to be followed a month later by the same status for Spanish Morocco. In November agreement is reached to end the international status of Tangier, which by 1960 is fully integrated with the rest of the nation. Morocco is back to its pre-colonial borders, and is ruled still by its pre-colonial dynasty.
An African kingdom: from AD 1957
The sultan Muhammad V, ruling his newly independent nation, proclaims his intention of turning it into a constitutional monarchy. His first act in this direction is to transform himself into a monarch. He assumes in 1957 the title of king.
Government elections eventually take place in 1960, but in their wake the king himself takes the role of prime minister with his heir, crown prince Hassan, as his deputy. The promised constitution is postponed until 1962, but by then Muhammad V has died. He is succeeded in 1961 by his son, as King Hassan II.
For nearly forty years Hassan rules Morocco, often with disregard for the civil rights of political opponents but in broad terms successfully - surviving attempted coups (the most serious in 1971) and periodic riots (particularly in Casablanca in 1981). There are several attempts at constitutional reform, and elections to parliament become a regular feature of Moroccan life. But real power remains with the king until his death in 1999, when he is succeeded by his son as Muhammad VI.
Internationally the main feature of Hassan's reign is territorial disputes with Morocco's immediate neighbours, Algeria and Mauritania.
The border with Algeria has been redrawn, to Morocco's disadvantage, during the French colonial period. Hassan's rejection of the existing border is of economic importance, since the disputed region is rich in iron ore. In 1970 a compromise is reached whereby the ore is exploited by both nations in partnership.
The other dispute, in the south, is of greater significance and longer duration. It concerns Mauriania and the Western Sahara. In the 1960s Hassan claims that Morocco has a historic right to Mauritania itself. But from 1969 he changes tack and concentrates his energies on winning the Western Sahara.
The Western Sahara: from AD 1976
The Western Sahara, colonized by Spain from 1884 and subsequently known as the Spanish Sahara, is a desert region between Mauritania and the ocean. Occupied only by a few nomadic tribes, it seems of little value until phosphate deposits are discovered in 1963.
y the 1970s it is an area disputed between Spain and the region's two neighbours, Morocco and Mauritania. In 1975 a United Nations mission reports that the scattered inhabitants of the region want independence and should be allowed to decide their own future. This prompts a dramatic response from the king of Morocco. He organizes a Green March (the colour of Islam), sending 350,000 unarmed Moroccans across the border. Their votes on the area's future can be relied upon.
Faced with this degree of determination, the Spanish withdraw their claim. The Western Sahara, as it now becomes, is entrusted by the UN in 1976 to joint Moroccan-Mauritanian adminstration.
It is never discovered whether this arrangement might have a chance of working, because since 1973 there has been a new element. In that year a local group of activists form the Polisario (Popular Front for the Liberation of Saguia el Hamra and Río de Oro). As guerrillas, supported by Algeria and Libya, they harass the Moroccans and Mauritanians. As politicians they declare, in 1976, that they are the government-in-exile of a new independent state, the Saharan Arab Democratic Republic. Their provisional government, based in Algeria, wins recognition from some seventy nations.
In the division of the Western Sahara after the departure of the Spanish, Morocco wins the northern two thirds (the region which includes the phosphates). Perhaps as a result of this, Mauritania opts out of the fighting and in 1979 makes peace with the Polisario. Morocco's response is to annexe the Mauritanian part of the territory.
The struggle therefore becomes a straight fight between the Moroccan forces and the Polisario. The Moroccans fortify the valuable areas against guerrilla intrusion. Eventually a peace is brokered in 1988 by the United Nations, leading to a ceasefire in 1991.
The UN proposal, accepted by both sides, is for a referendum to be held on whether the people of the region want independence under the Polisario or union with Morocco.
Eleven years later the referendum has still not taken place, because of the inability of the two sides to agree on who shall be eligible to vote. The issue is a crucial one, with Morocco continuing to move thousands of settlers into the region. Clearly the indigenous Saharawi nomads would come up with one answer, and the entire present-day population with another.