Morocco History: From Ancient Kingdoms to Modern Morocco
A journey through Amazigh kingdoms, Roman North Africa, the arrival of Islam, Morocco’s great dynasties, European protectorates, independence and the kingdom travelers know today.
The history of Morocco stretches back far beyond the modern kingdom. Long before Marrakech, Fes or Rabat became political centers, the region was home to Amazigh communities, Mediterranean trading settlements and North African kingdoms. Roman rule reached part of northern Morocco, Islam transformed the political landscape from the seventh century onward, and a succession of Moroccan dynasties built states whose influence extended across North Africa, the Sahara and, at times, Al-Andalus.
What Was Morocco Before It Became Morocco?
There was no single ancient kingdom that matched the exact borders of modern Morocco. The territory developed through a series of Amazigh societies, kingdoms, trading zones and later imperial provinces.
In classical antiquity, northern parts of present-day Morocco belonged to the wider world of ancient Mauretania. Rome later organized territory in the north as Mauretania Tingitana, named after Tingis, the city now known as Tangier.
The name used by Europeans today came much later. “Morocco” is historically linked to the name of Marrakech, while the Arabic name for the country is al-Maghrib, “the west.”
Ancient Morocco: Phoenicians, Carthaginians and Roman Rule
Morocco’s Mediterranean and Atlantic position connected it to long-distance trade well before the rise of the Moroccan dynasties. Phoenician merchants established trading points along the North African coast, and Carthaginian influence later extended through parts of the western Mediterranean.
Local Amazigh kingdoms remained central to the region. Roman power eventually reached northern Morocco, where cities such as Volubilis became important provincial centers.
Volubilis and Mauretania Tingitana
The archaeological site of Volubilis preserves one of the clearest physical reminders of Roman-era Morocco. Its mosaics, columns, houses and public buildings show the wealth of a city connected to the Roman economy while standing within a landscape that had much older North African roots.
Roman control never meant that all of modern Morocco became fully Romanized. Power was strongest in the north, and Amazigh communities beyond the main urban and military zones retained substantial autonomy.
The Arrival of Islam in Morocco
Islam spread into the Maghreb during the seventh and early eighth centuries. The process was gradual, involving conquest, political alliances, local resistance and the conversion of Amazigh communities.
By the late eighth century, Morocco was developing an independent Muslim political tradition distinct from direct rule by the great eastern caliphates.
This turning point leads directly to the dynasty that Moroccan official histories commonly identify as the first royal dynasty of the Moroccan state: the Idrisids.
Morocco: A Melting Pot of Dynasties and Cultures
Morocco’s official tourism history highlights six major dynasties that shaped the country’s political and cultural development: the Idrisids, Almoravids, Almohads, Marinids, Saadians and Alaouites.
Late 8th to 10th centuries. Closely associated with the beginnings of the Moroccan Muslim state and the rise of Fes.
11th-12th centuries. A Saharan Amazigh movement that founded Marrakech and built an empire spanning Morocco and Al-Andalus.
12th-13th centuries. A High Atlas Amazigh dynasty whose empire stretched across much of North Africa and Iberia.
13th-15th centuries. Based strongly in Fes and remembered for madrasas, architecture and religious institutions.
16th-17th centuries. A dynasty associated especially with Marrakech, the Saadian Tombs and El Badi Palace.
From the 17th century to the present. The dynasty of Moulay Ismail, Mohammed V, Hassan II and Mohammed VI.
The Idrisid Dynasty: The Beginning of the Moroccan State
Moroccan official histories date the beginning of the first Muslim dynasty to 788 and the formation of the Moroccan state to 791. Idris I, a descendant of Ali, settled in the area around Volubilis after fleeing political persecution in the east.
His son Idris II strengthened the dynasty and developed Fes into a major political and urban center. The city grew into one of Morocco’s defining centers of religion, trade and scholarship.
The Idrisid period occupies a special place in Moroccan historical memory because it linked local political authority with an independent Islamic monarchy.
The Almoravid Dynasty: The Founding of Marrakech
The Almoravids emerged from Saharan Amazigh groups in the eleventh century. Under Yusuf ibn Tashfin, they unified large areas of Morocco and expanded into Muslim Iberia.
Their most visible legacy for travelers is Marrakech. Moroccan official sources date the city’s foundation to the Almoravid period in the eleventh century, after which Marrakech became a political capital and a major link between the Maghreb and trans-Saharan trade routes.
The Almoravid empire helped deepen connections between Morocco and Al-Andalus, with lasting influence on architecture, learning and urban culture.
The Almohad Dynasty: Morocco at the Center of a Vast Empire
The Almohads began as a religious reform movement rooted in the High Atlas. Under Abd al-Mu’min and his successors they displaced the Almoravids and built an empire stretching across much of North Africa and into Al-Andalus.
Marrakech remained a major capital. The Almohad age left some of Morocco’s best-known architectural landmarks, including the Koutoubia Mosque, while related monumental styles appeared across the western Islamic world.
The empire weakened during the thirteenth century, opening the way for the Marinids.
The Marinid Dynasty and the Golden Age of Fes
The Marinids were an Amazigh dynasty that made Fes their principal center. Their period is particularly visible in the city’s architecture.
Madrasas, mosques, decorative woodwork, carved stucco and glazed tile became hallmarks of the age. Sites associated with the Marinid period remain among the reasons the medina of Fes is so rewarding for travelers interested in Moroccan history.
The Marinids also ruled during a period when Portuguese expansion was beginning to put pressure on Morocco’s Atlantic and northern coasts.
The Saadian Dynasty: Marrakech, Trade and Imperial Wealth
The Saadians rose during the sixteenth century and fought to push Portuguese power back from important parts of Morocco’s coastline.
Marrakech became the dynasty’s great architectural showcase. The Saadian Tombs and the remains of El Badi Palace are still among the clearest surviving monuments of the period.
Saadian power also extended southward. The conquest of the Songhai Empire at the end of the sixteenth century connected the dynasty to wealth and trade across the Sahara, although maintaining long-distance control proved difficult.
The Alaouite Dynasty: From Moulay Ismail to the Present
The Alaouite dynasty rose from Tafilalt in southeastern Morocco during the seventeenth century and has ruled the country ever since.
Moulay Ismail and Meknes
Sultan Moulay Ismail, who came to power in the seventeenth century, made Meknes a royal capital. Massive walls, gates, granaries and royal complexes turned the city into one of Morocco’s four imperial capitals.
Diplomacy with the United States
Morocco’s relationship with the United States dates back to the eighteenth century. Sultan Sidi Mohammed opened Moroccan ports to American vessels in 1777. A formal Treaty of Peace and Friendship was signed in 1786, beginning one of the longest-running diplomatic relationships involving the United States.
The Alaouite Line Continues
The same dynasty later produced Mohammed V, the monarch closely associated with the independence movement; Hassan II, who reigned from 1961 to 1999; and Mohammed VI, who became king in 1999 and remains Morocco’s monarch in 2026.
Morocco’s Colonial History: France, Spain and the Protectorates
European pressure on Morocco intensified during the nineteenth and early twentieth centuries as France, Spain, Britain and Germany competed for influence in North Africa.
In 1912, the Treaty of Fez established the French protectorate. France controlled the largest central zone, while Spain administered protectorate areas in the north and south. Tangier later acquired a separate international status.
The protectorate preserved the institution of the sultan while transferring major powers to European administrations. New roads, ports, railways and European-style districts appeared, but colonial rule also reshaped land ownership, economic control and political authority in ways that fueled Moroccan nationalism.
The Rif War
Northern Morocco became the center of major resistance in the 1920s under Abd el-Krim. The Rif conflict challenged Spanish control and later drew in large French forces before the resistance was defeated.
The Moroccan Flag and 1915
The red flag had older associations with the Alaouite state, but the green five-pointed pentagram familiar today was added in 1915. The symbol was later embraced by the nationalist movement and became the flag of independent Morocco.
Independence of Morocco: From Mohammed V to 1956
Moroccan nationalism became increasingly organized during the first half of the twentieth century. The Independence Manifesto of January 1944 became a major political milestone, openly demanding independence and national unity.
Sultan Mohammed V increasingly identified himself with the nationalist cause. His Tangier speech of 1947 expressed Morocco’s desire for unity and independence more openly.
In 1953, the French authorities deposed the sultan and sent him and the royal family into exile. The move intensified opposition to the protectorate rather than ending it.
Mohammed V returned from exile in November 1955. France recognized Moroccan independence on March 2, 1956. Spain ended its protectorate in northern Morocco later that year, and Tangier’s international status was also brought to an end.
Jewish History in Morocco
Jewish communities have lived in Morocco for many centuries and became part of the country’s urban and rural history. In some cities, Jewish quarters were known as mellahs, while in rural and mountain regions Jewish and Muslim communities often lived alongside one another.
Moroccan Jewish culture developed in Arabic, Amazigh and, in parts of northern Morocco, Judeo-Spanish environments. Jewish craftspeople, merchants, scholars and communities contributed to the social and economic life of cities including Fes, Marrakech, Essaouira, Meknes and Casablanca.
Moroccan Jews During the Second World War
During the Vichy period, anti-Jewish laws were introduced in Morocco under the protectorate. These imposed professional, educational and administrative restrictions, although implementation varied.
Why Did Many Jews Leave Morocco?
The great demographic change came in the mid-twentieth century. After the establishment of Israel in 1948 and during the decades around Moroccan independence, many Moroccan Jews emigrated to Israel, France, Canada and elsewhere.
The reasons were not identical for every family. Political uncertainty, Zionism, economic opportunities, family networks and changing regional relations all played a role. Morocco still preserves important Jewish heritage sites, synagogues, cemeteries and mellah districts.
Morocco After Independence
Mohammed V
Mohammed V became the central symbol of independence and the post-protectorate state. He died in 1961 and was succeeded by his son Hassan II.
Hassan II: 1961-1999
Hassan II’s long reign shaped much of modern Morocco’s political system. A constitution was approved in 1962 and amended several times during his rule. His era also included the Green March of 1975, major infrastructure projects and periods of significant political tension.
Mohammed VI: 1999-Present
Mohammed VI became king in July 1999 following the death of Hassan II. His reign has included major infrastructure investment, social and legal reforms, large tourism developments and a continued emphasis on Morocco’s African, Arab, Mediterranean and Atlantic connections.
To understand the country beyond its political history, continue to our About Morocco guide, which connects history with culture, geography, food and travel.
Morocco History Timeline
Amazigh societies and kingdoms develop across the region; Phoenician and Carthaginian trade reaches the coast.
Northern Morocco becomes connected to the Roman world, including the province of Mauretania Tingitana.
Islam spreads into the Maghreb and becomes the dominant religious and political framework.
The first Muslim royal dynasty associated with the Moroccan state; Fes rises in importance.
Marrakech is founded and an empire stretches into Al-Andalus.
A High Atlas dynasty rules a vast western Islamic empire.
Fes flourishes as a political, religious and architectural center.
Marrakech becomes an imperial showcase and Morocco resists Portuguese expansion.
The dynasty consolidates rule and continues as Morocco’s royal house.
European protectorate rule reshapes Moroccan political and economic life.
France and Spain end the protectorate system and independent Morocco emerges.
The current phase of Alaouite rule begins.
10 Interesting Historical Facts About Morocco
- Morocco has one of North Africa’s longest continuous monarchical traditions.The Alaouite dynasty has ruled since the seventeenth century, following several earlier Moroccan dynasties.
- Fes became important very early in Morocco’s Muslim history.The Idrisid period helped establish the city as a political and religious center.
- Marrakech gave the country its European name.The English name Morocco is historically connected with Marrakech, while Arabic uses al-Maghrib.
- Morocco once ruled an empire extending into Iberia.The Almoravid and Almohad dynasties both controlled territory in North Africa and Al-Andalus.
- Ibn Battuta came from Tangier.The fourteenth-century traveler became one of history’s most famous long-distance explorers.
- Morocco and the United States established ties in the eighteenth century.Moroccan ports were opened to American ships in 1777 and a formal treaty followed in 1786.
- The green star on Morocco’s red flag dates to 1915.The pentagram was added to distinguish Morocco’s flag and later became a symbol of the independent state.
- Morocco gained independence in 1956.France recognized independence in March, followed by the end of Spanish protectorate rule in northern Morocco later that year.
- Moroccan Jewish history stretches back centuries.Jewish communities formed an important part of the social history of cities and rural regions across the country.
- Morocco has four imperial cities.Fes, Marrakech, Meknes and Rabat each served as a royal capital in different periods.
Where Travelers Can See Morocco’s History Today
Much of Moroccan history remains visible rather than confined to museums. Medina walls, Roman ruins, madrasas, palaces, tombs and royal cities allow travelers to move through different historical periods in a single journey.
Frequently Asked Questions About Morocco’s History
What was Morocco before it became Morocco?
The region passed through Amazigh kingdoms, ancient Mauretania, Roman control in the north and later Islamic states. The development of the Moroccan Muslim monarchy is usually associated with the Idrisid dynasty from the late eighth century.
What was Morocco originally called?
There was no single ancient name covering the modern country. Classical names included Mauretania for kingdoms and Roman provinces in parts of northwest Africa. Morocco is called al-Maghrib in Arabic, while the European name is historically connected with Marrakech.
What was Morocco called in biblical times?
The modern state of Morocco did not exist under that name in biblical antiquity. The area belonged to the wider western North African world and was inhabited by ancient Amazigh peoples. Later classical sources used names connected with Mauretania.
What religion was Morocco before Islam?
Before Islam, religious life varied by time and place. Indigenous North African beliefs existed alongside Phoenician and Roman religious traditions, and Christianity and Judaism were both present in parts of the region during late antiquity.
Are Moroccan people African or Arab?
Moroccans are African. The country’s population and culture are shaped strongly by both Amazigh and Arab heritage, with additional African, Andalusian, Mediterranean and Jewish influences. Treating those identities as mutually exclusive oversimplifies Morocco’s history.
When did Morocco become Muslim?
Islam reached the Maghreb during the seventh and early eighth centuries. The process of Islamization developed over generations rather than through one single date.
When did Morocco gain independence?
France recognized Morocco’s independence on March 2, 1956. Spain ended its protectorate in northern Morocco later in the same year, while Tangier’s international status also ended in 1956.
Why did many Moroccan Jews leave Morocco?
Large numbers emigrated during the mid-twentieth century, especially after the creation of Israel and around the period of Moroccan independence. Motivations differed by family and included political uncertainty, Zionism, economic prospects and family migration networks.
Who founded Marrakech?
Marrakech was founded during the Almoravid period in the eleventh century and became one of Morocco’s most important imperial capitals.
Which dynasty rules Morocco today?
The Alaouite dynasty. It has ruled Morocco since the seventeenth century, and King Mohammed VI has been monarch since 1999.
Experience Morocco’s History as You Travel
Fes, Marrakech, Meknes, Rabat, Volubilis and the old caravan routes of southern Morocco turn the country’s history into part of the journey itself. Our private trips can connect these places with the Atlas Mountains, Sahara and Morocco’s living cultural traditions.