Marrakech History: From the Almoravids to Modern Morocco and the Sights That Tell the Story
Marrakech history stretches back almost a thousand years, from a camp founded by desert dynasties to one of the most visited cities in Africa. This guide explains the main chapters of Marrakech history in simple terms, who built the city, why it matters, and which sights in the medina and beyond let you see that past with your own eyes. Dates and names in historical writing vary slightly between sources, and some details are debated by historians, so treat this guide as a readable overview, not an academic reference. For deeper reading you can start with the Wikipedia article on Marrakesh and check local museums and guides.

Marrakech history in brief
- Founded: in the 11th century by the Almoravids, a Berber dynasty from the Sahara.
- Golden ages: under the Almoravids, the Almohads and the Saadians.
- Nickname: the Red City, because of its walls and buildings made of reddish earth.
- Imperial city: one of Morocco’s four imperial cities, with Fes, Meknes and Rabat.
- Modern era: a French protectorate city in the 20th century, then part of independent Morocco from 1956.
- Heritage: the medina is listed as a UNESCO World Heritage Site, and Jemaa el-Fna is recognised for its oral and intangible heritage.
Before Marrakech: the land and the people
The Marrakech plain sits between the High Atlas mountains and the semi-arid south. For centuries the area was home to Amazigh (Berber) communities who farmed, herded and traded along routes linking the mountains, the Sahara and the Atlantic coast. Water was always the key to life here. Snowmelt from the Atlas fed streams and underground channels, and later engineers used these sources to irrigate gardens and palm groves. The city did not appear out of nothing: it grew in a region with a long history of settlement and trade.
The founding of Marrakech by the Almoravids
Marrakech history usually begins in the second half of the 11th century, around the 1060s or 1070. The Almoravids, a movement of Berber tribes from the Sahara united by a reforming religious message, expanded north and needed a base between the mountains and the plains. They chose the Marrakech area and set up a camp that grew into a city. Historians credit leaders such as Abu Bakr ibn Umar and Yusuf ibn Tashfin with the early stages, though sources differ on the exact roles and dates.
Under the Almoravids Marrakech became a political and cultural capital that looked both south to Africa and north to Al-Andalus in Spain. The dynasty brought Andalusian craftspeople and styles, which influenced architecture, gardens and decoration. The name “Morocco” in many languages is said to derive from the name of the city, which shows how central it was.
Water systems and early walls
One of the Almoravid achievements was bringing water to the city through underground channels known as khettaras, which supported gardens and a growing population. The first walls and gates were also built in this period, although many were rebuilt later. The Almoravid Qubba, a small domed building near the Ben Youssef Madrasa, is one of the few surviving examples of their architecture inside the medina.
The Almohads and the Koutoubia
In the middle of the 12th century, around 1147, the Almohads, another Berber dynasty from the Atlas mountains, conquered Marrakech. They saw the Almoravid city as too lax in religion and rebuilt much of it. Under the Almohads Marrakech became the capital of a vast empire that stretched across North Africa and into Spain.
The most visible legacy of this period is the Koutoubia Mosque, whose minaret rises about 70 metres above the old city and is the symbol of Marrakech. It is a model for other famous towers, including the Giralda in Seville and the Hassan Tower in Rabat. The name is linked to the bookseller’s market that once stood nearby, since “kutubiyyin” refers to booksellers. Non-Muslims cannot enter the mosque itself, but you can admire it from the surrounding gardens.


Decline, rivalry and the shift to Fes
After the Almohads weakened in the 13th century, power moved to the Marinids, who favoured Fes as their capital. Marrakech remained important but lost its leading role for a time. Over the following centuries it was still a major regional centre, though parts of the city suffered from conflict and neglect. This is a reminder that Marrakech history is not a straight line of glory: the city rose, declined and rose again.
The Saadian golden age
In the 16th century the Saadians, a dynasty from the south of Morocco, made Marrakech their capital and brought the city a new period of prosperity. Their most famous ruler, Ahmad al-Mansur, ruled in the late 16th century and is associated with wealth from trade in sugar, gold and other goods across the Sahara. He used this wealth to build monuments.
- El Badi Palace: built in the late 16th century as a grand palace for ceremonies and receptions. Today it is mostly ruins, but you can still see large courtyards and basins, and storks often nest on the walls.
- The Saadian Tombs: royal tombs from this period that were sealed off for a long time and rediscovered in the 20th century. They are known for fine decoration in cedar, stucco and marble.
- Ben Youssef Madrasa: a former Islamic school with an earlier foundation, rebuilt in the Saadian period, one of the largest in the Maghreb.
Visiting hours, ticketing and which parts are open can change, so check locally before you go. For a broader list of places read our guide to Marrakech attractions and activities.
The Alaouites and the later centuries
The Alaouite dynasty, which still reigns in Morocco today, came to power in the 17th century. Sultan Moulay Ismail, who ruled from Meknes, is remembered for strengthening the state and for large building projects elsewhere. In his reign Marrakech lost some of its imperial status, and some Saadian buildings were reportedly stripped for materials. Over time, later Alaouite rulers restored the importance of Marrakech as one of the southern capitals.
In the 19th century Marrakech saw new palaces and gardens. The Bahia Palace, built in the late 19th century by high officials, is a good example of the decorative style of this period, with painted ceilings, tiled courtyards and carved plasterwork. If you want to compare it with other imperial cities, read our Meknes travel guide.
The French protectorate and the New Town
In 1912 Morocco became a French protectorate. In Marrakech, as in other cities, the French authorities built a separate modern district, known today as Gueliz, next to the old medina. This created the two-part structure you can still see: the walled medina with its lanes and souks, and the wide avenues and cafes of the new town. The French resident-general Hubert Lyautey is often linked to the policy of preserving old medinas while building new districts alongside them.
This period also saw the creation of well-known gardens and villas, including the Majorelle Garden, begun by the French painter Jacques Majorelle in the 1920s and later restored and opened to visitors. Local power during this time was held by figures such as the Pasha of Marrakech, whose role is a debated part of the period’s history. Historians evaluate the protectorate in different ways, so look for several sources if you want to go deeper.
Independence and modern Marrakech
Morocco regained independence in 1956. After that, Marrakech grew as a centre for tourism, crafts, agriculture and services. Artists, writers and travellers have been drawn to the city for decades, and today it is one of Morocco’s most visited destinations. The medina was inscribed as a UNESCO World Heritage Site in the 1980s, and Jemaa el-Fna was recognised for its oral and intangible heritage in the early 2000s, which highlights the importance of storytelling, music and street performance as living traditions.
In September 2023 a strong earthquake struck the High Atlas region south-west of Marrakech, causing serious loss of life and damage in mountain villages and some damage in the city. Recovery and restoration work has continued since, so check current information on specific monuments before you plan your visit.

10 key moments in Marrakech history
This simple timeline helps you keep the story in order. Dates are approximate.
- Around 1070: the Almoravids establish Marrakech as a new base.
- 11th and early 12th centuries: the city becomes an Almoravid capital with Andalusian influence.
- Around 1147: the Almohads conquer Marrakech and rebuild it.
- Late 12th century: the Koutoubia Mosque is built, and its minaret becomes the city’s symbol.
- 13th century onward: the Marinids favour Fes, and Marrakech loses some importance.
- 16th century: the Saadians make Marrakech their capital and build lasting monuments.
- 17th century: the Alaouites take power, and Meknes and Fes grow in importance.
- 19th century: new palaces and gardens appear, including the Bahia Palace.
- 1912: the French protectorate begins, and the New Town is created next to the medina.
- 1956 and after: independence, tourism growth and UNESCO recognition.
Where to see Marrakech history today
- Koutoubia Mosque and gardens: the Almohad landmark, best seen at different times of day.
- Almoravid Qubba: a small early monument, if open.
- Saadian Tombs: a compact site that shows Saadian decoration.
- El Badi Palace: atmospheric ruins with large courtyards.
- Bahia Palace: rooms and courtyards from the 19th century.
- Ben Youssef Madrasa: a former Islamic school with beautiful decoration, depending on opening status.
- Medina walls and gates: long stretches of red walls with historic gates.
- Jemaa el-Fna and the souks: living history in the form of markets and performance. See our Marrakech souks guide.
- Majorelle Garden: a 20th century garden linked to the protectorate period.
- Gueliz: the French-era New Town, with Art Deco buildings and cafes.
How to explore Marrakech history in 1 to 3 days
One day
Start with the Koutoubia in the morning, walk to Jemaa el-Fna and the souks, visit one palace such as Bahia or El Badi, and end the day with sunset in the square.
Two days
Add the Saadian Tombs, the Ben Youssef Madrasa area and the Majorelle Garden, plus time in Gueliz to see the contrast between old and new.
Three days
Take a day outside the city, for example to the Atlas mountains, Ouarzazate or the Agafay desert. See the Agafay desert guide and what to see in Ouarzazate.
For help choosing where to stay and how to get around, read our Marrakech travel guide and Marrakech travel tips.
Tips for visiting historic sites in Marrakech
- Go early to avoid crowds and heat, especially at the Saadian Tombs.
- Dress modestly, particularly near religious buildings.
- Check opening days and ticket rules, since they change.
- Consider a licensed guide if you want historical context, and agree the rate in advance.
- Carry small cash for tickets and tips.
- Respect signs about photography.
- Wear comfortable shoes for uneven floors and long walks.
For safety and etiquette read is it safe to visit Morocco and what languages are spoken in Morocco.
From Marrakech history to the Sahara
The same trade routes that made Marrakech rich once crossed the Atlas and the Sahara. Today you can follow part of that landscape on a trip to the Merzouga dunes, with stops in kasbah country on the way. Read Marrakech to Merzouga: distance, route, time and best stops, compare the best desert tours from Marrakech and see where Morocco is.
Marrakech history: frequently asked questions
Who founded Marrakech?
The Almoravids, a Berber dynasty from the Sahara, founded Marrakech in the 11th century. Sources differ on the exact date and leaders.
Why is Marrakech called the Red City?
Because its walls and many buildings are made of local reddish earth, which gives the city a warm red-pink colour, especially at sunset.
How old is Marrakech?
The city is almost a thousand years old, dating from the 11th century.
Which dynasties ruled Marrakech?
The main ones were the Almoravids, the Almohads, the Saadians and the Alaouites, with periods of Marinid influence in between.
Is Marrakech one of the imperial cities?
Yes, with Fes, Meknes and Rabat, it is one of Morocco’s four imperial cities.
What is the oldest building in Marrakech?
Some of the oldest surviving structures, such as parts of the walls and the Almoravid Qubba, date from the Almoravid period, though many were rebuilt. Ask a local guide or museum for details.
What is the Koutoubia?
A 12th century Almohad mosque whose minaret is the symbol of the city. Non-Muslims cannot enter, but can see it from outside and from the gardens.
Why is Jemaa el-Fna famous?
It is a large public square known for storytellers, musicians, food stalls and markets, and it is recognised for its intangible cultural heritage.
Which historical sites should I visit first?
The Koutoubia, a palace such as Bahia or El Badi, the Saadian Tombs and the medina souks give a good overview.
Was the city affected by the 2023 earthquake?
The earthquake mainly hit mountain areas, but the city also saw some damage. Check current information about specific monuments.
Continue your Morocco trip beyond Marrakech
If you want to continue from Marrakech to the dunes, a camel ride and a night in a desert camp, we can help you plan the route and the nights. Message us on WhatsApp at +212 620 628 083 or use the contact page. For the desert side of your trip, see the Merzouga desert complete guide.