It can be argued that Morocco has the purest human bloodline of any region in Africa. The natives, who inhabited the area more than 3,000 years ago, have been subjected to waves of foreign interference by everyone from the Phoenicians and Romans to colonial French and Spanish settlers. These immigrants never came in overwhelming numbers -- even the Bedouin Arabs of the 7th and 8th centuries who exerted such a profound influence on the region's culture -- and so the greater part of Morocco's present population can be regarded as descendants of the original inhabitants that occupied el Maghreb a millennia ago.
The migration of prehistoric peoples that led to the emergence of the current population of Morocco likely took place well before 5000 to 40,000 B.C., as writings from Greek scholars of the time refer to a substantial and formidable tribe (termed Libyans in reference to the tribe's name, Lebou) inhabiting the far western fringe of Egypt to the west of the Nile delta.
During the course of the 1st millennium B.C., the Punic-speaking Phoenicians and their predecessors, the Carthaginians from modern-day Tunisia, constructed a series of trading stations and other posts -- most notably in Morocco near the modern-day cities of Tangier, Larache, and Essaouira -- to jointly meet the needs of their seamen and to protect their monopoly of the coastal trade. The Carthaginians waged wars against the Greek city-states of Sicily and with Rome. They expanded their empire farther west along the coasts of both northwest Africa and southern Spain before they eventually capitulated to Rome. The far western outposts of Carthage initially remained largely unaffected from the change in power and even prospered for about another 100 years from waves of relocating Punic refugees. The Libyans of Morocco were treated harshly under Carthaginian rule, and many took refuge in the Rif and Atlas mountains, and beyond into the pre-Sahara where they began a seminomadic existence. From these inaccessible, harsh regions grew a largely ungovernable people who would ferociously guard their independence for centuries to come.
Rome's African colony -- called Ifrikiya in medieval Arabic times and from which the continent now takes its name -- was established in the Carthaginian homeland in northern modern-day Tunisia, and over the next 150 years, Roman influence spread over all the coastal districts of northwest Africa. The Romans termed all the native inhabitants who were not under their direct rule as barbari -- "barbarians," a term that passed into modern usage as "Berber" -- and by the time the Romans made their way to Morocco, a number of kingdoms had been created among the inland, independent Berbers of North Africa. In northern Morocco and western Algeria, these Berbers were known by the Romans as the Maures, and their kingdom became known as Mauretania. Rome initially tolerated the kingdom, which prospered first under the rule of Juba II, an Algerian Berber who was educated in Rome and married the daughter of Antony and Cleopatra, and then his son Ptolemy. By around A.D. 40, however, Rome eventually imposed a more centralized control and split its colony into Mauretania Caesarensis (Algeria) and Mauretania Tingitana (Morocco), with Tingis (Tangier) the latter's easily accessible capital. Mauretania Tingitana was to be the empire's westernmost province, but the empire was to crumble before any such feat could be considered.
Though it was considered a far-flung outpost by the cultured set in Rome, Roman urbanization flourished in Mauretania Tingitana, with estimates of more than 30 established cities scattered along the northern coast and adjoining plains. Volubilis, located squarely within the fertile farmlands, became a major seat of power and commerce as the province supplied the empire with more than half its requirement of agricultural produce such as olives and grain, as well as many of the African animals used in the barbaric gladiator games. It is estimated that within the 200-odd years of direct Roman rule in northwest Africa, the populations of Atlas bears, elephants, and lions were as good as wiped out.
The rule by the Romans was plagued by constant raids from the Berbers living beyond the Roman frontier boundary. With their empire starting to crumble, the Romans started retreating from Mauretania Tingitana around A.D. 250, and subsequent rule over the region (first by the Vandals and then the Byzantines) was largely restricted to the ports of Tingis (Tangier) and Ceuta. Consequently, tribal law reigned over most of Morocco over the ensuing centuries, and it was this isolated, largely clan-bound land that confronted the marauding Arabs from the east in the 7th century.
Between A.D. 639 and 700, Muslim Arab invaders, influenced by the new religion preached by the Prophet Mohammed, invaded Egypt and most of the Maghreb. Though they had conquered the richer lands of the Middle East in less than a decade with relative ease, Morocco was only occupied after 70 years of fighting against the Berbers. Although the reason for such determined fighting by the invading Muslims had been their mission to convert and rule the local Berbers, this may have been secondary to their determination to invade the Iberian Peninsula with an eye on eventual western European domination. In 711, they achieved both missions when an army composed largely of Muslim Berber troops set out from Tangier and successfully invaded the Spanish port of Tarifa, from where they proceeded over the next decade to push the Christians almost into France. Although this signified acquiescence to Islam by some Berbers, it did not constitute an acceptance of the presence of the Arabs.
The Arab invasions attracted Muslims from all over western Asia to settle in North Africa, and their presence greatly stimulated the commercial economy of the region. By the late 700s, regular trade was established across the Sahara between Morocco and the great gold, ivory, and slave kingdoms of West Africa. This wave of Islam had a far more profound impact on the Berber population than Rome and Christianity ever had; it transformed the cultural orientation of the Maghreb by turning its face from the Latin West to the Arab East.
Such was the quick expansion of the Islamic empire that it rapidly became too expansive to rule from the centralized seat of power in Damascus; the religion now reached from Persia across to the western Maghreb and from Ghana up to Spain. As Arab rule was transferred from Damascus to local leaders, the age of the Moroccan dynasties began.
Moulay Idriss arrived at Volubilis in 787. An Arab refugee of distinguished ancestry, he was immediately welcomed into the city and very quickly took on the role of both spiritual and political leader. Leaving Volubilis as the thriving commercial (and perhaps decadent) hub that it was, Idriss immediately set about transforming the nearby village of Fes into the principal city of western Morocco and a model for all the Moroccan dynasties to follow. A devout Shia Muslim, Idriss was proclaimed the Commander of the Faithful, a title that has continued throughout the ages and is still the spiritual crown worn by the current king, Mohammed VI. Astonishingly, Idriss accomplished all this in only 4 years before the Baghdadi Shia powers had him poisoned. Moulay Idriss II was born after his father's death, and over his 20-year reign, he elevated the Idrissid state into Morocco's first true dynasty, establishing a certain measure of government and law. Fes developed into one of the major intellectual centers in the Islamic world and was a vital link in the trade routes between Andalusia and the Middle East as well as Morocco and the Sahara. The Idrissid's power began to wane by the 10th century, but Fes has retained its level of importance up to the present day.
As the Idrissid state reverted back to a more localized rule, a group of nomadic Berber tribesmen, the Sanhaja, established a massive empire in the south. This movement originated from the preaching of Ibn Yasin, who settled in the camps of the Sanhaja to preach the Islamic gospel. But upon finding their faith and diligence lacking, he withdrew to the western Saharan coast (modern-day Mauritania), where he established a ribat, a fortified monastery of sorts. As the number of his devotees increased, he was able to launch his strictly disciplined el-Murabitoun, or Almoravids, in a jihad, or holy war. He took revenge on those Sanhaja who had rebuked his teachings and extended his power southward to the ancient kingdom of Ghana and northward to Morocco.
Within 30 years (1050-80), the Almoravids overran all of the by-now fractured states of the western Maghreb (Morocco and western Algeria) and by 1107 were also rulers of southern Spain. For the first time in Maghrebi history, the Berber tribes had been forced to obey a single ruler, and within this relatively short space of time, the concept of Moroccan unity was born. The very name Morocco was derived from the Almoravids' new capital, Marrakech.
The Almoravid empire, however, collapsed as rapidly as it had grown, and in 1147 they were eventually overthrown by a movement not altogether dissimilar from their own. Ibn Toumert, an Atlas Berber who preached a very strict, deeply spiritual form of Islam, saw the Almoravids as blasphemous and immoral. Provoking the Almoravid court in Marrakech until he was eventually banished to the mountains, Ibn Toumert gathered a small band of disciples around him, known as Almohads, and succeeded, before his death in 1130, in creating a political structure strong enough to hold together many of the mountain tribes who harbored a natural animosity to the desert-originating Almoravids. A disciplined military force was established and swept down onto the fertile plains to conquer the Almoravids, firstly in Fes and then Marrakech, this only 25 years after their banishment from the city. Over the next century, the Almohads extended their power northward into Andalusia and eastward over present-day Morocco, Algeria, and Tunisia. The latter half of the 12th century was possibly the Maghreb's finest hour, and Andalusian culture reached its peak under their reign. The Almohad leaders were behind the building of the new capital in Rabat as well as Marrakech's Koutoubia Mosque and Seville's Giralda tower.
Barely 100 years after sweeping to power, the Almohad empire collapsed under the weight of internal divisions, and within Morocco many Berber tribes reverted back to local rule.
The Merenids, a Sahara Berber tribe that had fought alongside the Almohads in Spain, turned on their former masters, and by 1250 regarded themselves as rulers of Morocco, although they lacked any great military base. It was during these turbulent times that Morocco came to acquire certain contradicting, localized religious characteristics. Most of the country's urban Arabized centers began to practice a strict observance of the orthodox Islamic faith. Meanwhile, a vigorous brotherhood of Muslim saints, or marabouts, developed in the countryside where their strong mystical appeal attracted the illiterate, rural Berbers.
Also witnessed during the Merenid reign was a strengthening of the Bedouin Arab influence on the Moroccan northern plains. During this time, the Merenids embarked on a considerable construction spree, largely financed by the Makhzen system. The Makhzen was Morocco's first real centralized government system of administration and taxation, but was only enforceable in the urban centers under Merenid control and only then by an army of Arab and Christian mercenaries. The Merenids ruled from Fes el Jdid, an extension of the original city, Fes el Bali, and to perhaps appease the popular orthodox faith of the time, constructed many of the mosques and medersas, or Islamic colleges, that still dominate the Fes medina today.
However, the Merenids and their successors, the Wattasids, were quite unable to deal with their external problems. Their Spanish territories, including the last great Moorish city of Granada, were lost during their reign, and in 1415, the Portuguese occupied the port of Ceuta on the Moroccan side of the Straits of Gibraltar. This marked not only an important shift of power between Muslims and Christians in the western Mediterranean, but also the beginning of western European expansion into the wider world.
Between 1460 and 1520, the Portuguese occupied the greater part of the Moroccan coast, including modern-day Tangier, Asilah, Essaouira, and Agadir. The Portuguese set up trading posts along a great deal of Africa's northern Atlantic coastline, and this greatly affected Morocco's Saharan trade routes. Although the caravans from West Africa through the central and eastern Maghreb to the Middle East continued to flourish, Morocco's position as the middle man between Africa's west and Europe became increasingly redundant.
The Saâdians used the widespread revolt against the Merenids and Wattasids to make their move. They were the first Arabic dynasty to rule over Morocco since the Idrissids back in the 8th century, although they suffered the same dramatic rise and fall from power as the previous Berber dynasties. The Saâdians lacked any tribal allegiances from the Moroccan Berbers and gained a lot of their power from their claim of being direct descendants of the Prophet Mohammed and their leading role in driving the Portuguese from most of their strongholds. They built themselves a capital in Taroudannt before claiming Marrakech in 1520. At this stage, the Wattasids were still governing some parts of northern Morocco from their stronghold in Fes, but there was widespread revolt in protest to the addition of Ottoman Turks to their Arab and Christian tax-collecting armies. Unpopular and bankrupt, they eventually succumbed to the rising Saâdian power from the south.
Ahmed el Mansour (the Victorious) was the greatest of the Saâdian sultans and reigned for 25 years. The sultan had eyes for a larger stage than most previous rulers, and established close commercial and diplomatic ties with Elizabeth of England, who realized his value as an ally against Spain. He also sent an army across the desert and overpowered the mighty West African empire of Songhai, founding a Moroccan protectorate on the banks of the Niger River in the process that sent back so much gold that "the Victorious" was bestowed another title, el Dhabi, "the Golden," by his thankful subjects.
Upon el Mansour's death in 1603, none of his three sons could deliver the same leadership as their father, and Morocco plunged into familiar chaos and anarchy. The Saâdians retreated to their strongholds of Marrakech and the Souss, where they continued to reign over the south for another 60 years. The Saâdian Tombs in Marrakech lay witness to the obvious wealth that the dynasty still enjoyed after the death of el Mansour. At the same time, Catholic Spain was pursuing a vigorous purge of all non-Catholics, and waves of Jewish and Muslim refugees arrived on Morocco's shores, only adding to the general lawlessness sweeping the country. One group of refugees was a band of pirates called the Sallee Rovers, who lay claim to their own Republic of the Bou Regreg at the mouth of the Bou Regreg River in the twin cities of Rabat and Salé. Their pirate state added a distinct Andalusian touch to the medina and kasbah of Rabat that is still evident today.
Law and order was restored to Morocco in the 1660s by the Alaouites, who came from the Tafilalt town of Rissani, near the Saharan dunes of Merzouga. It was their second sultan, Moulay Ismail, who was to become Morocco's longest-serving ruler -- and one of its most notorious. Sultan from 1672 to 1727, Moulay Ismail was a ruthless leader who demanded loyalty and service from his subjects and kept a tight hold on the country via a standing army of some 140,000 black troops, many of whom were enslaved from military expeditions that took the Moroccans as far south as Senegal. He is remembered today as one of the country's preeminent leaders whose imperial city of Meknes was intended to be the equal of Versailles. His reign also saw the construction of roads and schools, and such was his reputation in Europe that even though the country spiraled into anarchy after his death, it wasn't until 150 years later that the European colonial powers considered invading Morocco again.
Up until 1850, Morocco had been relatively successful in keeping the West at bay. At the time, there were fewer than 500 Europeans in Morocco compared with 12,000 in Tunis and more than 100,000 in Algeria. Moulay Slimane, Alaouite sultan of Morocco from 1792 to 1822, was a devout orthodox Muslim and extolled a particularly xenophobic style of rule that forbade his subjects from leaving the country, confined all Europeans to Tangier and Mogador (Essaouira), and generally imposed stringent restrictions on all commercial relations with the Western (Christian) world. All of this only served to leave Morocco ill placed to deal with a European presence that was starting to be felt throughout Africa. European, particularly British, French, and Spanish, businessmen were beginning to show an interest in the potential Moroccan market, and the Moroccans themselves were acquiring a taste for foreign products; imports of tea, for example, rose by 20% between 1830 and 1840. At the same time, the French invasion of Algeria in 1830 handed Morocco a powerful and dangerous neighbor, and in 1845 the Moroccans found themselves fighting the French in a brief war. In 1859, the Spanish army invaded Morocco in response to constant raids on its garrison ports of Ceuta and Melilla and inflicted a series of defeats over Moroccan forces before the Alaouite sultan, Abd er Rahman, signed the Treaty of Tetouan. Under the treaty, Morocco promised to pay Spain a huge indemnity for the raids. To pay this, the sultan had to raise a loan in London on the security of the Moroccan Customs revenue and hand over control of this to foreign commissioners. Consequently, from the 1860s there was a rapid expansion of European influence in Morocco.
Moulay al Hassan was the last great Moroccan sultan (1873-94) before the French occupation. His reign was virtually a continual campaign to satisfy those in the bled el makhzen and extend his power into the bled el siba, "the unfriendly country." It also witnessed more European, especially French, involvement in the country's civil administration and commercial dealings. Al Hassan's determination to govern the bled el siba -- something that had not been achieved since the 17th century -- arose from trying to make certain that no ungoverned groups existed that could cause frontier incidents such as the previous disastrous confrontations with the French and Spanish. The fact that Morocco was able to keep its independence until 1912 -- considering France had occupied Algeria since 1830 and declared Tunisia a French protectorate in 1882 -- is a tribute to his enterprise and skill.
By 1906, with the vast majority of Africa under European rule, the still technically independent nation of Morocco was the subject of intense negotiations among a number of European players. In the Conference of Algeciras and with Morocco on the verge of bankruptcy, France and Spain became the designated European interests in the country.
In 1911, with his capital Fes surrounded by rebellious tribes and his country bankrupt, Sultan Moulay Hafidh (great-uncle of the present king) requested French military intervention and ceded control of Morocco. This agreement was ratified the following year on March 30, 1912, with the Treaty of Fes, which formally proclaimed the Sultanate of Morocco as a French protectorate, with its new capital in Rabat. A separate agreement between France and Spain then divided the country into a vast central French zone with Spanish zones to both its north and south.
Morocco by this time was exceptionally poor, having suffered from perennial droughts, outdated agricultural methods, and, above all, difficulties of communication and transport caused by the mountainous interior. Over the next 40 years, the French zone witnessed more than 43,000km (26,660 miles) of road construction, compared to just 500km (310 miles) in the Spanish zone. The French also successfully promoted the new colony to potential settlers, whereas the immigration of Spanish settlers was decidedly less. The relative success in the French zone was largely due to the character of its first resident-general, Louis Lyautey, who held office for 13 years until 1925. Lyautey had already served in Indochina and Madagascar as well as Algeria, and he was determined to preserve the traditional institutions of Maghrebi Islam. At the same time he had a sure grasp of economic affairs, and the rapid modernization of the Moroccan economy was largely his work. In particular, he set to task on the pacification of the tribes of the bled el siba, and perhaps his greatest achievement was bringing law and order to areas that had never been controlled by a central government. Today his legacy is most visible in the retention of the medinas around the country. In Algeria he had witnessed the random destruction of medinas in the name of progress, so in Morocco he, along with urban planner Léon-Henri Prost, designed elegant, gridlike new cities, or ville nouveaux, which were carefully separated from the ancient cities.
Around this time, Lyautey's pacification was rudely interrupted by the Rif War. The Berbers of the Rif mountains in the northern zone of Morocco had risen as one against the Spanish military government. They defeated a Spanish force in 1921 and proclaimed a Republic of the Rif. The uprising in the Rif was the eventual downfall of Lyautey, who was seen as too pro-Moroccan.
In 1927, after the death of the old sultan Moulay Hafidh, the French arranged for a young prince, Sidi Mohammed V, to accede to the throne. The French imagined that they could educate the young sultan to rule entirely according to their wishes, but during World War II, Mohammed V became the leader of the Moroccan nationalist movement, even welcoming Churchill and Roosevelt to Casablanca for the Allies Conference in 1943. Toward the end of the war, after many years of secret meetings and political organization and with the support of both the sultan and the majority of the Moroccan people, the major resistance movements in Morocco combined to publicly form the Istiqlal, the "Party of Independence." The sultan made himself the central figure of the nationalist movement. He refused to give his consent to French laws to ban the Istiqlal and other nationalist parties. In a desperate effort to overcome the resistance to their rule in Morocco, the French sided with the nomadic groups in the Atlas mountains, who were traditionally hostile to the sultan. However, this attempt to "divide and rule" by playing the Berbers against the Arabs only resulted in uniting them in opposition to French rule. In 1953 the French deposed Mohammed V, and exiled him first to Corsica and then to Madagascar. In his place, the southern tribal caid Thami el-Glaoui, who had enjoyed virtual rule of southern Morocco under the French, was made sultan. Unrest broke out with the formation of an Army of Liberation by the nationalist groups, and eventually the French were forced to acknowledge defeat and agree to the principle of independence. In November 1955, Mohammed V returned to his country and was reinstated as sultan; Morocco became independent in March 1956. Upon independence, the government instigated a sweeping range of reforms, built more schools and universities, and dealt with the excesses of colonial rule, most notably by cleaning up the seedy port city of Tangier. The sultan changed his title to king while retaining his spiritual position as Commander of the Faithful.
Mohammed V died somewhat unexpectedly in 1961, and power moved smoothly to his son, Hassan II. Although initially intent on introducing a new constitution -- as promised by his father even before independence -- Hassan II, faced with ever-present social and political unrest, delayed its introduction and proceeded to dismantle the opposition. The king reverted back to rule similar to the patrimonial mode of the precolonial sultans.
The 1970s and 1980s saw Hassan II play a leading neutralist role in the affairs of both the Middle East and North Africa, and over time this served to instill within Moroccans a sense of national pride. The last few years of his 38-year reign saw some democratization within the government plus some changes to the country's constitution. Hassan II died in 1999 after a relatively short struggle with cancer, and his 36-year-old son, Mohammed Ben al Hassan, was immediately enthroned as Mohammed VI, the 18th king of the Alaouite dynasty.