The History of Marrakech’s Medina: A Quick Traveler’s Primer

A short Marrakech medina history: founded around 1070, reshaped by four dynasties, split in two by France in 1912, and UNESCO World Heritage since 1985.

A stretch of rammed-earth wall near the riad I was staying in has stood, more or less, for nine centuries. I walked past it every morning on the bread run and barely registered it. It was just the wall. Then a friend visiting the city asked me something simple, and I couldn’t answer it: who actually built all this, and when? I’d spent weeks inside these walls. I still had to go and read up on Marrakech medina history.

Marrakech medina history title card, with a keyhole arch, a rampart gate, and the Koutoubia minaret in silhouette over a terracotta-to-navy gradient.

Disclosure: Some links in this guide may earn us a commission, at no extra cost to you. It never changes what we recommend.

This is the primer I wish I’d had that day. It isn’t an architecture deep dive, and it isn’t a where-to-go guide. It’s Marrakech medina history told the only way that sticks: dynasty by dynasty. Marrakech is one of those rare cities where the past isn’t behind museum glass. It’s the street under your feet. Once you can read the layers, the whole old town changes shape.

Key Takeaways

  • Marrakech medina history starts around 1070 with the Almoravids. The earliest work is credited to Abu Bakr ibn Umar, and his cousin Yusuf ibn Tachfin built it into a capital. Some medieval sources say 1062 (Wikipedia, History of Marrakesh, retrieved 2026-08-09).
  • The city gave Morocco its name. “Marrakech” likely comes from the Amazigh Amur n Akush, “Land of God,” and medieval Europeans stretched the capital’s name to cover the whole country (Wikipedia, Marrakesh, retrieved 2026-08-09).
  • The Almohads took Marrakech in 1147 and built the Koutoubia. That site holds two mosques, not one: the second was re-angled about five degrees to fix the first’s qibla (Archnet, Jami’ al-Kutubiyya, retrieved 2026-08-09).
  • The Medina of Marrakesh has been a UNESCO World Heritage Site since 1985. Jemaa el-Fna carries its own intangible-heritage status, proclaimed in 2001 and inscribed in 2008 (UNESCO World Heritage Centre, retrieved 2026-08-09; UNESCO Intangible Cultural Heritage, retrieved 2026-08-09).
  • The city commune counted 1,002,697 people at the September 2024 census. The old medina is one district of a city that spilled past its walls long ago (CityPopulation.de, retrieved 2026-08-09).

Who Founded Marrakech, and When?

The Almoravids founded Marrakech around 1070. They were a reformist Amazigh (Berber) movement out of the Sahara, and they needed a capital for an empire that would stretch from Senegal to Spain. Credit for the first building usually goes to their leader Abu Bakr ibn Umar. His cousin Yusuf ibn Tachfin turned it into a real capital (History of Marrakesh; Britannica, retrieved 2026).

You’ll sometimes see 1062 given instead. That isn’t a typo. Medieval chroniclers disagreed with each other, and modern historians tend to settle near 1070 while noting the older date.

Start with the name, because it’s the city’s first piece of history. “Marrakech” most likely comes from the Amazigh Amur n Akush, or “Land of God.” And here’s the part that surprises almost everyone I tell it to: this one city named the entire country. Medieval European merchants and diplomats knew the realm through its southern capital, so “Marrakech” (Murrākush) slid outward until it became “Morocco” (Marrakesh). You’re standing in the town Morocco is named after.

Two Almoravid decisions still shape daily life here. First, they ringed the new city in pisé: rammed red earth, packed into those salmon-pink ramparts. Second, they solved the desert’s core problem, which was water. Their engineers dug khettara, gently sloping underground channels that pulled Atlas snowmelt into the city and its gardens. That’s how a town on the edge of an arid plain grew the vast Palmeraie palm groves.

Almost nothing else they built survives. The next dynasty knocked it all down.

One Almoravid building did make it through, and it’s absurdly easy to miss. I walked past it on three separate trips before I knew what it was. The Koubba Ba’adiyn is a small domed pavilion built around 1117 under Ali ibn Yusuf, probably an ablutions annex for the old mosque. It’s the only Almoravid structure still standing in the city, and it survived by being buried and forgotten. Nobody dug it out until 1952 (Wikipedia, Almoravid Koubba, retrieved 2026-08-09).

It sits below modern street level near the Ben Youssef Mosque, and most visitors stride right over it toward the flashier sights. The oldest thing in Marrakech is just a hole in the ground you have to know to look for.

How Did the Almohads Reshape the City?

In 1147 a rival Amazigh movement, the Almohads, took Marrakech after a long siege. They kept it as their capital and set about erasing the Almoravids from the skyline (History of Marrakesh). That’s why the Koubba Ba’adiyn stands so alone. The Almohads pulled down what came before and built their own city on top of it.

Their signature is the Koutoubia, the minaret that still works as the medina’s compass. You can pick it out from rooftops all over the old town. Two Koutoubia mosques once stood on that site, though, and the reason is worth knowing. The Almohads began the first between 1147 and 1154. Then they started a second one beside it, shifting the qibla wall about five degrees to fix the original’s angle toward Mecca. The first prayers were said in that second mosque in September 1158 (Archnet, Jami’ al-Kutubiyya).

Ever noticed the faint rectangle in the ground beside the standing mosque? That’s the ghost of the first Koutoubia. (The building detail, how the minaret works, the twin-window rhythm, the zellige, belongs in my Moroccan architecture guide rather than here.)

Their other legacy is the kasbah, the walled royal quarter in the medina’s south, with its own gate: the blue-grey stone arch of Bab Agnaou. Later dynasties would put their grandest palaces and tombs in that same district. So the Almohads didn’t just leave monuments. They set the template for where power would sit for the next 700 years. Both the Almoravids and the Almohads were Amazigh dynasties, part of a much longer story I trace in my Amazigh (Berber) culture guide.

Marrakech Medina History at a Glance

Before we go further, the whole of Marrakech medina history on one line: six moments that each reset the city’s course.

Six turning points in Marrakech’s history c.1070 Founded (Almoravid) 1269 Capital moves to Fes 1912 French Protectorate 1147 Almohads conquer 1578 Badi Palace (Saadian) 1985 UNESCO listing Points are spaced evenly for legibility, not to scale by year. Sources cited throughout this guide, 2026.
Two peaks of capital-city glory, Almohad and Saadian, bracket a long Marinid eclipse. That’s the shape of the whole story.

Why Did Marrakech Fall Behind Fes?

Because in 1269 the Marinids took power and chose Fes as their capital, leaving Marrakech to fade (History of Marrakesh). Most travelers skip this chapter. It matters, though, because it answers a question you’ll feel on the ground: why does Marrakech read as medieval while Fes reads as older still?

For roughly two and a half centuries, Marrakech was a provincial town rather than an imperial capital. Building slowed. Fewer people lived here. The city coasted on Almohad foundations while power, scholarship, and money pooled up north.

That gap is the most overlooked part of Marrakech medina history. This wasn’t a smooth thousand-year climb. It was two bursts of capital-city wealth with a deep trough between them. The chart below shows how long each ruling dynasty actually kept its capital here, and the Marinid zero is the whole point.

Years Marrakech was the reigning dynasty’s capital Almoravid ~77 Almohad ~122 Marinid 0: capital moved to Fes Saadian ~105 Alaouite 0: capital sat elsewhere Morocco Travel Life editorial calculation from the dynastic dates cited throughout this guide, 2026. Spans are approximate. The Alaouites kept Marrakech as a royal city but ruled from Fes, Meknes, and later Rabat.
The medina you walk today was mostly shaped in two windows, the Almohad and Saadian capitals, with a long quiet Marinid stretch in between.

What Was Marrakech’s Golden Age?

The 16th century, under the Saadians. That’s the era that gave the medina most of its showpieces. The Saadians unified Morocco in the mid-1500s and moved the capital back to Marrakech. Then they funded a building spree on two goods: Saharan gold and locally refined sugar. Both were wildly valuable at the time.

El Badi Palace was the flagship, built between 1578 and 1594 as a diplomatic palace for Sultan Ahmad al-Mansur. It went up as part of his victory campaign after he beat the Portuguese at the Battle of the Three Kings (Archnet, Badi’ Palace, retrieved 2026-08-09). “Al-Badi” is one of the ninety-nine names of God, and it means “the incomparable.” The palace was built to earn the name: a huge walled garden ringed by reception halls, a riyad plan taken to its limit.

Then an Alaouite sultan took it apart. In 1696 Moulay Ismail had the ornament stripped out and shipped to his new capital at Meknes, and the job took ten years to finish (Badi’ Palace). What you tour today is a glorious ruin: high earthen walls, sunken gardens, storks nesting on top. Somehow that hits harder than the intact palace would have.

Their other lasting gift sits in the kasbah quarter. The Saadian Tombs are a jewel-box royal burial ground finished around 1591, then sealed up and lost for centuries. Nobody found them again until 1917 (Wikipedia, Saadian Tombs, retrieved 2026-08-09). This era also gave Marrakech the Ben Youssef Madrasa in the form you visit now. And it’s when the Mellah, the walled Jewish quarter, was cut off in the medina’s southeast in 1558. I follow that story across the country in my guide to Morocco’s Jewish heritage.

What Did the Alaouites and the 19th Century Add?

The Alaouites have ruled Morocco since the 1660s and still hold the throne. They kept their capitals mostly in Fes, Meknes, and later Rabat. So Marrakech settled into the role of a great royal city rather than the seat of power. The 19th century handed the medina one more masterpiece, though: the Bahia Palace.

Its first section, Dar Si Moussa, went up between 1859 and 1873 for Si Moussa, grand vizier to Sultan Sidi Muhammad bin Abd al-Rahman. His son Ba Ahmed, grand vizier to the young Sultan Mawlay Abd al-Aziz, expanded it hugely between 1894 and 1900. He kept adding section after section, which is how the plan turned into the beautiful rambling sprawl you walk today (Archnet, Bahia Palace, retrieved 2026-08-09).

“Bahia” means “brilliance.” The painted cedar ceilings and courtyard gardens are the best-preserved high-19th-century Moroccan palace craft you can walk into anywhere. The ending is very Marrakech, though. Within hours of Ba Ahmed’s death in 1900, the sultan ordered the palace raided for its furnishings and fittings (Bahia Palace).

A pattern shows up once you’ve walked the medina a few times. Every dynasty built its glory in the same southern kasbah zone. And every dynasty either demolished or looted the last one’s work. The Almohads erased the Almoravids. Moulay Ismail stripped the Saadians’ Badi. Bahia was plundered the week its owner died. So the medina isn’t really a set of preserved monuments. It’s a palimpsest: layer scraped over layer, each dynasty reusing the same sacred southern ground. That’s why the old town feels so dense. It’s the same few blocks, rebuilt five times.

How Did the French Protectorate Change the Map?

The French Protectorate, set up in 1912, drew the line that still defines how Marrakech is laid out. The French didn’t bulldoze the medina. They built a whole new city instead, on open ground just outside the western ramparts. That’s the Ville Nouvelle, known here as Gueliz: wide boulevards, cafés, a street grid (History of Marrakesh). Independence came in 1956. The two-city split stuck.

That 1912 decision is the single most useful thing a visitor can understand, because you feel it the moment you cross town. The medina is the walled, car-resistant, thousand-year-old maze. Gueliz is the grid of boulevards, wine bars, and boutiques where anyone staying more than a week ends up running their errands.

Friends ask me why their riad sits five minutes from a spice souk while their favorite modern café is a fifteen-minute taxi away. The answer is a French urban-planning choice from over a century ago. For the practical side, where to stay in each, how to get between them, what to see, that’s all in my Marrakech travel guide. This post is just the why behind the map.

Why Is the Medina a UNESCO World Heritage Site?

Because it’s one of the largest and most complete living historic Islamic cities anywhere. The Medina of Marrakesh has held UNESCO World Heritage status since 1985. It was listed for its dense fabric of ramparts, gates, mosques, palaces, souks, and homes, built up over nearly a thousand years (UNESCO World Heritage Centre).

“Living” is the key word here. This isn’t a ruin behind a fence. The wider city commune counted 1,002,697 people at the September 2024 census (CityPopulation.de), and the medina is still a working neighborhood of homes, workshops, and markets. It isn’t a museum you visit and leave.

Jemaa el-Fna, the medina’s great central square, carries a second and separate honor. In 2001 UNESCO proclaimed its cultural space a Masterpiece of the Oral and Intangible Heritage of Humanity. It was formally inscribed on the Representative List in 2008 (UNESCO Intangible Cultural Heritage). That listing isn’t for the buildings. It’s for the practice: the storytellers, musicians, herbalists, and food stalls that fill the square every night. Few places on earth are listed for what people do there rather than for what was built.

Those Gnawa troupes whose qraqeb you hear after dark are part of that living tradition too. I unpack the music itself in my guide to traditional Moroccan music. The souks that spill off the square are their own deep subject, and I cover the shopping side in my Marrakech souk guide.

Reading Marrakech Medina History on the Ground

Marrakech medina history is still legible on the ground if you know the tells. This is the cheat sheet I’d give a friend before their first walk.

EraWhat to look forWhere to see it
Almoravid (c.1070–1147)Pisé ramparts; underground khettara logic; the lone survivorCity walls; Koubba Ba’adiyn
Almohad (1147–1269)The compass minaret; the royal kasbah gateKoutoubia; Bab Agnaou
Marinid (1269 on)Absence: the quiet centuries, with power up in Fes(Felt more than seen)
Saadian (16th c.)Gold-and-sugar grandeur, ruined and intactEl Badi Palace; Saadian Tombs; the Mellah
Alaouite / 19th c.Painted-cedar palace craft at its peakBahia Palace
French Protectorate (1912)The grid outside the wallsGueliz / Ville Nouvelle

Walk the medina with those six layers in mind and the old town stops being a pretty maze. It becomes a readable timeline. The gate you photograph, the minaret you navigate by, the ruined palace with the storks: each belongs to a different century and a different dynasty, all crammed into the same square kilometer.

Frequently Asked Questions

Who founded Marrakech and in what year?

The Almoravids founded Marrakech around 1070. They were an Amazigh (Berber) dynasty, and the earliest work is credited to their leader Abu Bakr ibn Umar. The city grew into a capital under Yusuf ibn Tachfin. Some medieval sources give 1062 instead, which is why you’ll occasionally see that date (History of Marrakesh; Britannica, retrieved 2026).

Is the Marrakech medina a UNESCO World Heritage Site?

Yes. The Medina of Marrakesh has been on UNESCO’s World Heritage List since 1985, listed for ramparts, gates, palaces, souks, and mosques built up over nearly a thousand years. Jemaa el-Fna square holds a separate honor: its cultural space was proclaimed an intangible-heritage masterpiece in 2001 and inscribed in 2008 (UNESCO World Heritage Centre; UNESCO ICH).

Did Marrakech give Morocco its name?

Very likely, yes. “Marrakech” probably derives from the Amazigh Amur n Akush, meaning “Land of God.” Medieval European traders and diplomats knew the country through its southern capital, so the city’s name (Murrākush) gradually widened until it covered the whole realm as “Morocco” (Marrakesh).

What is the oldest building in the Marrakech medina?

The Koubba Ba’adiyn, also called the Almoravid Koubba, is a small domed pavilion built around 1117. It’s the oldest surviving building in the city and the only Almoravid structure left standing, because the Almohads demolished nearly everything else. It survived by being buried and forgotten, and nobody dug it out until 1952 (Almoravid Koubba).

Why does the Marrakech medina feel newer than Fes?

Blame a long gap in the city’s story. The Marinids took power and moved the capital to Fes around 1269. Marrakech then spent roughly two and a half centuries as a provincial town, while money and scholarship pooled up north. Imperial wealth only returned under the Saadians in the 16th century (History of Marrakesh).

Putting It Together

Marrakech’s medina isn’t one old thing. It’s six layers stacked in the same few blocks: Almoravid walls, an Almohad minaret, a Marinid silence, Saadian gold, an Alaouite palace, and a French line drawn just outside the gate in 1912. Once you can see the seams, a walk through the old town becomes a walk through a millennium. That is Marrakech medina history at street level, and it’s exactly why UNESCO listed the whole medina in 1985 rather than any single monument.

If this primer did its job, you’ll want the two guides on either side of it. My broader guide to understanding Moroccan culture puts these dynasties into the national story. My practical Marrakech travel guide tells you how to actually walk it: which gates, which palaces, and how to find the Koubba I kept missing.

Marco Delgado
Marco Delgado

I'm a travel writer and digital nomad practicing slow travel, weeks-long stays that get me past the postcard version of a place. I write practical guides on visas, budgeting, transport and remote work, paired with on-the-ground storytelling for readers planning their own extended trips.

Staying put for weeks changes what you can report. Prices get checked in person rather than lifted from a press page. Routes get walked before they get recommended. Opening hours get confirmed the boring way, by turning up. Where a figure comes from an official source I name that source, and where good data does not exist I say so rather than guess.

If you have a collaboration, a partnership or a story idea in mind, get in touch through the contact page.

Articles: 55