How a Kingdom Was Built Across Continents, Civilizations and Centuries — and why it endured when so many others did not.
Empires have risen and disappeared. Kingdoms have flourished, fragmented and faded into history. Borders have shifted, dynasties have fallen and civilisations have been transformed by conquest, migration and revolution.
Yet for more than twelve centuries, Morocco has maintained an extraordinary continuity.
From the Atlantic Ocean to the Sahara, from the Rif Mountains to the valleys of the Atlas, Morocco has evolved without losing its identity. It is one of the world's oldest continuously governed kingdoms, shaped not by a single people or a single dynasty, but by centuries of exchange between Africa, Europe and the Middle East.
Its history is not a straight line. It is the story of a civilisation built through diversity, adaptation and continuity.
Morocco is among the world's longest continuously governed monarchies, with institutions that have evolved over more than twelve centuries. The Alaouite dynasty, which traces its lineage to the Prophet Muhammad, has ruled without interruption since 1666 — and the Moroccan kingdom itself dates to 788.
This article is not a conventional history lesson. It is the conclusion to Volume One of Roots of Morocco — an attempt to draw together the threads that readers have encountered across the first five chapters: Amazigh civilisation, Jewish heritage, Andalusian Morocco, the imperial cities, and the Saharan world that connected them all.
Before Morocco: The Civilisations That Came First
Long before the Kingdom of Morocco emerged, the land was already home to thriving civilisations.
The Amazigh peoples had inhabited North Africa for thousands of years, establishing kingdoms, developing trade networks and adapting to landscapes ranging from Mediterranean forests to Saharan deserts. Their story — told in depth in Issue No. 2 of this series — forms the oldest continuous thread in Morocco's human history.
Phoenician merchants established trading posts along the Atlantic and Mediterranean coasts, drawn by the region's natural harbours and its access to trans-Saharan trade routes. The Carthaginians expanded commercial influence across the region, and later, the Romans incorporated much of northern Morocco into the province of Mauretania Tingitana.
They left behind roads, aqueducts and cities such as Volubilis — today a UNESCO World Heritage Site — whose mosaic floors and triumphal arches still rise from the hills outside Meknes.
Even during Roman rule, however, large parts of the interior remained under Amazigh governance, preserving local traditions, languages and political structures that would continue to shape Morocco for centuries after Rome's collapse.
- Amazigh kingdoms — Atlantic to Sahara
- Phoenician coastal trading posts
- Carthaginian commercial networks
- Roman province of Mauretania Tingitana
- Berber kingdoms of Mauretania
- Sub-Saharan trade routes already established
The Birth of a Kingdom
The turning point came in the late eighth century.
Idris ibn Abdallah, a descendant of the Prophet Muhammad, arrived in Morocco after fleeing political upheaval in the Middle East. Welcomed by Amazigh tribes — who saw in him both religious authority and political legitimacy — he established a new political and religious centre at Volubilis before moving to the site that would become Fez.
His son, Idris II, founded Fez itself in 789, which rapidly grew into one of the most important cities in the Islamic world. Within a generation it had become a centre of scholarship, trade and religious learning — a city that would eventually house al-Qarawiyyin, founded in 859, which many scholars regard as the world's oldest continuously operating university.
Unlike many medieval states that disappeared after only a few generations, Morocco developed institutions that endured. New dynasties would emerge, capitals would change and borders would expand or contract, yet the kingdom itself survived. That survival did not happen by chance.
It rested on something more durable than any single ruler: the legitimacy of the Moroccan monarchy as an institution — religious, political and symbolic — that transcended dynasties.
The Idrisid dynasty is considered the founding dynasty of the Moroccan state. Their ability to unite Amazigh tribal leaders under a shared religious authority — rather than attempting to subjugate them — established the template that successive Moroccan dynasties would follow: legitimacy through alliance, not merely through conquest.
The Great Dynasties
Over the centuries that followed, Morocco was governed by a succession of remarkable dynasties, each of which transformed the kingdom without erasing what came before.
The Almoravids (1040–1147) transformed Marrakech into an imperial capital and built an empire stretching across present-day Morocco, Mauritania, western Algeria and much of Al-Andalus. Their military campaigns reunified a fragmented Iberian Peninsula and established Morocco as a power whose reach extended across two continents.
The Almohads (1121–1269) expanded that influence even further, leaving behind architectural masterpieces such as the Koutoubia Mosque, the Hassan Tower and the Giralda of Seville — monuments that still define the skylines of Morocco and southern Spain. Under their rule, Andalusian scholars, poets and scientists found patronage at the Moroccan court, deepening the cultural exchange explored in Issue No. 3 of this series.
The Marinids (1244–1465) strengthened Fez as a centre of scholarship, constructing magnificent madrasas and encouraging scientific and religious learning at a time when Europe was still emerging from its medieval period.
The Saadians (1554–1659) oversaw one of Morocco's most prosperous periods, benefiting from trans-Saharan commerce and asserting military strength during the Battle of Alcácer Quibir in 1578 — a victory that reverberated across the Islamic world and transformed Morocco's international standing.
The Alaouites — founded in the seventeenth century and continuing to this day — have guided Morocco through periods of reform, colonial rule, independence and modernisation, maintaining the institutional continuity that has characterised the kingdom for twelve centuries.
"Each dynasty transformed the kingdom. None erased what came before. That continuity remains one of Morocco's most defining characteristics."
— MoroccoPassport EditorialThe Sahara: A Bridge Between Worlds
To many modern observers, the Sahara appears to be an immense natural barrier — a void separating the civilisations of the Mediterranean from those of sub-Saharan Africa.
Historically, it was something very different.
For centuries, the desert served as one of Africa's great highways. Camel caravans crossed its vast expanses carrying gold, salt, textiles, books and ideas between the Mediterranean and West Africa. A caravan departing from Marrakech could reach Timbuktu in approximately fifty days — a journey that was arduous but routine for experienced Saharan traders.
The key city in this network was Sijilmassa — a now-vanished city in the Draa Valley that served for centuries as the northern terminus of the trans-Saharan trade. From Sijilmassa, caravans departed south through the Sahara to Timbuktu, Gao and other centres of learning. Gold and salt travelled north; manufactured goods, textiles and scholars travelled south.
Morocco was not simply a passive beneficiary of this commerce. Over successive dynasties, Moroccan sultans cultivated relationships with Saharan tribes through trade, diplomacy and religious authority — ties that historical sources document as taking varied forms depending on dynasty, region and period. In some well-documented cases, these relationships included formal pledges of allegiance (bay'ah) from tribal leaders to the Moroccan sultan. In others, they remained primarily commercial or religious in character. The depth and permanence of any particular relationship differed considerably across the Sahara's vast geography, and historians rightly caution against presenting Moroccan influence below the Atlas as uniform or continuous across all eras.
What the historical record does consistently confirm is the continuity of the connection itself. Over centuries, the Sahara was never a void between Morocco and sub-Saharan Africa — it was an active zone of exchange that both shaped and was shaped by successive Moroccan dynasties.
The Sahara was not isolated from Morocco. It was woven into its economic, religious and cultural life. Understanding this historical reality is essential for understanding why the desert occupies such a central place in Morocco's historical narrative — and why Moroccan sultans from the Almoravids onwards invested so heavily in maintaining influence over its routes and peoples.
The Almoravid dynasty itself originated in the western Sahara — among the Sanhaja Berber confederation — before sweeping north to found Marrakech and conquer Al-Andalus. Morocco's imperial ambitions and its Saharan connections have always been intertwined.
The Sahara's role as a connector rather than a barrier is one of the most underappreciated aspects of North African history. While European civilisations were separated from sub-Saharan Africa by the desert, Morocco — positioned at the desert's northern edge — used it as a highway. Saharan trade made Morocco wealthy, Saharan alliances made it powerful, and Saharan scholarship made it cosmopolitan.
Morocco and West Africa
Morocco's connections with West Africa extended well beyond commerce.
Trade brought prosperity. Scholarship brought ideas. Religion built enduring connections. Students travelled north to study in Fez — one of the world's leading centres of Islamic learning. Scholars travelled south carrying books, legal texts and religious teachings. Sufi brotherhoods — particularly the Tijaniyya and Qadiriyya — served as cultural bridges, transmitting Moroccan religious traditions across the Sahara and into the Sahel.
The most dramatic episode in this relationship came during the reign of Sultan Ahmad al-Mansur of the Saadian dynasty. In 1591, Moroccan forces crossed the Sahara — an extraordinary military achievement — and defeated the Songhai Empire at the Battle of Tondibi. The victory disrupted the Songhai's control of the gold and salt trade routes and gave Morocco significant leverage over trans-Saharan commerce during the Saadian period.
Although direct political control proved difficult to maintain over such vast distances, the commercial, intellectual and religious ties between Morocco and West Africa that predated the campaign continued long after the Saadian military presence receded.
The Songhai campaign under Ahmad al-Mansur remains one of the most audacious military operations in West African history — an army crossing a thousand kilometres of desert with artillery, infantry and logistical support. That it succeeded at all is a testament to the depth of Morocco's knowledge of Saharan geography, its relationships with desert tribes, and the organisational capacity of the Saadian state.
The Moroccan force that crossed the Sahara in 1591 was led by Ahmad al-Mansur's general Judar Pasha — a Spaniard who had converted to Islam and risen through the ranks of the Saadian court. The army included arquebusiers whose gunpowder weapons overwhelmed the Songhai cavalry at the Battle of Tondibi, fundamentally altering the balance of power in West Africa.
A Kingdom of Many Traditions
Few countries have been shaped by so many distinct influences while maintaining such a coherent national identity.
The Amazigh peoples gave Morocco its deepest historical roots — a civilisational inheritance explored in Issue No. 2 of this series that predates the kingdom itself by thousands of years. Their languages, their agricultural traditions, their mountain fortresses and their understanding of Saharan geography formed the foundation upon which everything else was built.
Arab dynasties from the eighth century onwards contributed religious and political institutions that gave the kingdom its enduring framework: Islamic governance, the role of the sultan as Commander of the Faithful, and the legal traditions of the Islamic scholarly world.
Jewish communities enriched Morocco's commerce, scholarship, music and urban life for more than two thousand years — a story told in full in Issue No. 1 and the Special Feature on the Mellahs. From the ancient mellahs of Fez to the Jewish quarter of Essaouira, their presence shaped the character of Morocco's cities in ways that remain visible today.
The arrival of Andalusian Muslims and Jews after the fall of Al-Andalus transformed architecture, cuisine, music and craftsmanship — contributing a cultural refinement that can still be heard in Moroccan classical music and seen in the zellige tilework of Fez's medina, explored in depth in Issue No. 3.
African traditions travelled north through caravan routes. Mediterranean exchanges introduced new ideas, technologies and artistic forms. Saharan tribes contributed resilience, knowledge of desert geography and a cosmopolitan commercial culture that connected Morocco to civilisations its Mediterranean neighbours rarely encountered.
Rather than replacing one another, these influences blended into a civilisation that remains uniquely Moroccan.
- Amazigh — the civilisational foundation
- Arab — religious and political institutions
- Jewish — commerce, scholarship and urban culture
- Andalusian — architecture, music and refinement
- Saharan — trade networks and desert knowledge
- African — cultural exchange and diplomacy
- Mediterranean — ideas, technology and artistic forms
Why Morocco Endured
History offers many examples of powerful kingdoms that disappeared. Morocco did not. Its survival cannot be explained by geography alone, nor by military strength.
Morocco's continuity rested on several interlocking foundations.
Institutions. The Moroccan monarchy developed a set of institutions — the makhzen, the religious establishment, the system of tribal alliances — that proved remarkably adaptable. When dynasties changed, these institutions provided continuity. The new sultan inherited not just a throne but a system.
Religious legitimacy. Morocco's sultans have historically held the title of Commander of the Faithful (Amir al-Mu'minin), grounding their authority in religious as well as political terms. This dual legitimacy proved more durable than purely military power — it could not simply be conquered away.
Geography. Morocco occupies a unique position — buffered by the Atlas Mountains to the south and east, facing the Atlantic and Mediterranean, with the Sahara as a vast southern frontier. This geography made it difficult to conquer entirely and gave successive dynasties natural defensive advantages that kingdoms in more exposed positions lacked.
Commercial networks. Control of trans-Saharan trade routes provided successive Moroccan dynasties with the revenues necessary to maintain armies, build cities and patronise scholarship. Commerce was not incidental to Morocco's survival — it was central to it.
Adaptation. Perhaps most importantly, Morocco evolved. It absorbed new peoples, new ideas and new technologies without losing its core identity. The Andalusian refugees who arrived in the fifteenth and sixteenth centuries were not merely tolerated — they were integrated, their skills put to use, their culture absorbed into the national fabric.
"Morocco evolved. It rarely began again. That distinction explains much of its remarkable resilience."
— MoroccoPassport EditorialAncient Foundations, Forward-Looking Kingdom
Modern Morocco is both ancient and forward-looking. High-speed rail connects cities founded more than a thousand years ago. Ancient medinas stand alongside modern business districts. Traditional craftsmanship continues while industries such as aerospace, renewable energy and automotive manufacturing expand.
The kingdom continues to build upon foundations laid centuries earlier. Its history is not confined to museums. It remains visible in daily life — in the architecture of the medinas, the ritual of the mint tea, the music of the Gnaoua, the Jewish-influenced cuisine of Fez, the Amazigh script that now appears on road signs alongside Arabic and French.
Morocco does not merely preserve its past. It inhabits it.
One Civilisation, Many Stories
To understand Morocco is not simply to visit its cities, admire its architecture or cross its deserts.
It is to recognise the continuity that connects every chapter of its history. From Amazigh kingdoms and Idrisid foundations to imperial cities, Saharan caravan routes, Jewish heritage, Andalusian traditions and the modern constitutional monarchy, Morocco has continually renewed itself while preserving its identity.
Morocco's story is not the story of one people, one dynasty or one city. It is the story of a civilisation that has woven together mountains and deserts, Atlantic and Mediterranean, Africa and Europe, tradition and renewal into a kingdom whose continuity remains one of its most remarkable achievements.
Few nations have followed such a long and uninterrupted path.
That continuity is more than a historical achievement. It is one of Morocco's greatest strengths — and one of the keys to understanding the Kingdom today.
The Sahara's role as a connector rather than a barrier is one of the most underappreciated aspects of North African history. While European civilisations were separated from sub-Saharan Africa by the desert, Morocco — positioned at the desert's northern edge — used it as a highway for eight centuries. Saharan trade made Morocco wealthy. Saharan alliances made it powerful. Saharan scholarship made it cosmopolitan.
Understanding this changes how one reads Moroccan history. The kingdom was never simply a Mediterranean country that happened to border the Sahara. It was a civilisation whose identity was shaped by the desert as much as by the sea — a country that always faced in two directions at once.
That dual orientation — towards Africa and towards Europe, towards the desert and towards the ocean — remains visible in Morocco today. It is, perhaps, one of the most important things to understand about what Morocco is and how it came to be.
End of Volume One
The first five chapters of Roots of Morocco offer an introduction to the civilisations, peoples and historical forces that shaped the Kingdom — from Amazigh foundations and Jewish heritage to Andalusian Morocco, the imperial cities, and twelve centuries of continuity. Future volumes will continue exploring Morocco's remarkable story through new themes, personalities and discoveries.
Continue Exploring
Travel guides, cultural heritage and historical context for the places at the heart of Morocco's story.