Borders of Time

Morocco

Who ruled Marrakesh?

Marrakesh dates from about 1070 CE. On our historical maps, the ground it stands on has been drawn inside 13 different states, empires and peoples. Read the history of Morocco.

Boris Macek · CC BY-SA 3.0 · Wikimedia Commons
Djemaa el Fna in the evening

Djemaa el Fna in the evening

Boris Macek · CC BY-SA 3.0 · Wikimedia Commons

The history of Marrakesh

Hear the whole article read aloud
Marrakech, Morocco
YoTuT from United States · CC BY 2.0 · Wikimedia Commons
Marrakech, Morocco

Marrakech, Morocco

YoTuT from United States · CC BY 2.0 · Wikimedia Commons

Marrakesh lies on the Haouz plain of southern Morocco, at the foot of the High Atlas mountains, where caravan routes from the Sahara met the roads to the Atlantic coast and the north. Water from the mountains, brought underground by long irrigation channels, made an oasis of palm groves and gardens possible on a dry plain. Founded as the capital of a desert dynasty, it gave its name to the whole country (the word Morocco comes from it), and for much of its history it was either the imperial capital or the great rival of Fez.

Almoravid and Almohad capital

Le jardin des majorelle l3
Viault · CC BY-SA 4.0 · Wikimedia Commons
Le jardin des majorelle l3

Le jardin des majorelle l3

Viault · CC BY-SA 4.0 · Wikimedia Commons

The city was founded around 1070 by the Almoravids, a Berber religious and military movement from the western Sahara, as a camp and then a fortified base on the plain. Under Yusuf ibn Tashfin and his son Ali ibn Yusuf it became the capital of an empire stretching from Senegal to al-Andalus in Spain. Ali built a great mosque and palace and, in 1126 to 1127, the long earthen walls whose line still encloses the medina.

In 1147, after a long siege, the Almohads, a rival reform movement from the Atlas, stormed the city and made it the capital of their own caliphate. They largely rebuilt it: the Koutoubia mosque, whose minaret was completed under Yaqub al-Mansur at the end of the twelfth century, became the model for the Giralda in Seville and remains the city's landmark. Almohad Marrakesh was a centre of learning, and the philosopher Averroes spent time at its court. When the Marinids took the city in 1269 they moved the capital to Fez, and Marrakesh declined into a provincial centre for more than two centuries.

Saadians, Alaouites and the French

Bahia Palace Marrakech Front Courtyard 2009 LL
Lionel Leo · CC BY-SA 3.0 · Wikimedia Commons
Bahia Palace Marrakech Front Courtyard 2009 LL

Bahia Palace Marrakech Front Courtyard 2009 LL

Lionel Leo · CC BY-SA 3.0 · Wikimedia Commons

The Saadian dynasty, which claimed descent from the Prophet, took Marrakesh in the 1520s and made it the capital of a reunited Morocco. Their greatest ruler, Ahmad al-Mansur (1578 to 1603), built the immense El Badi palace with wealth from sugar and from ransoms after the defeat of the Portuguese at the Battle of the Three Kings in 1578. In 1591 his army crossed the Sahara from Marrakesh and defeated the Songhai Empire, whose state collapsed, and gold and captives flowed back north. The Saadian tombs and the Jewish quarter, the mellah, date from this period.

The Alaouite dynasty, which still rules Morocco, took Marrakesh in the 1660s. Moulay Ismail moved the capital to Meknes and stripped the El Badi palace for materials, but later sultans often resided in Marrakesh and built new palaces and gardens there in the eighteenth and nineteenth centuries.

In 1912, the year Morocco became a protectorate of France, French troops occupied Marrakesh after expelling a rebel claimant, Ahmed al-Hiba. The French built a new European town, Gueliz, outside the walls, and governed the south through Thami El Glaoui, the powerful pasha of Marrakesh, who held the post until independence in 1956. Tourism grew from the interwar years, and in 1985 the medina was declared a UNESCO World Heritage Site. In September 2023 a strong earthquake in the High Atlas killed nearly 3,000 people in the region and damaged historic buildings in the medina. Marrakesh, with about 1 million inhabitants, is one of the largest cities in Morocco and the country's leading tourist destination.

In pictures

2 images · scroll →
Pavillon Menaragärten
Acp · CC BY-SA 3.0 · Wikimedia Commons
Pavillon Menaragärten

Pavillon Menaragärten

Acp · CC BY-SA 3.0 · Wikimedia Commons
Badi Palace DSCF6501
R Prazeres · CC BY-SA 4.0 · Wikimedia Commons
Badi Palace DSCF6501

Badi Palace DSCF6501

R Prazeres · CC BY-SA 4.0 · Wikimedia Commons

Timeline

20 periods
  1. 123,000 BCE – 10,000 BCEHomo heidelbergensisMap of 123,000 BCE →
  2. 10,000 BCE – 2000 BCENo state drawn here on the mapMap of 10,000 BCE →
  3. 2000 BCE – 1500 BCESaharan pastoral nomadsMap of 2000 BCE →
  4. 1500 BCE – 500 BCEBerbersMap of 1500 BCE →
  5. 500 BCE – 200 BCESaharan pastoral nomadsMap of 500 BCE →
  6. 200 BCE – 1 BCEMauretaniaMap of 200 BCE →
  7. 1 BCE – 700 CENo state drawn here on the mapMap of 1 BCE →
  8. 700 CE – 800 CEBarghawataunder Umayyad CaliphateMap of 700 CE →
  9. 800 CE – 1000 CEIdrisid CaliphateMap of 800 CE →
  10. 1000 CE – 1100 CECaliphate of CórdobaMap of 1000 CE →
  11. 1100 CE – 1200 CEAlmoravid dynastyMap of 1100 CE →
  12. 1200 CE – 1279 CEAlmohad CaliphateMap of 1200 CE →
  13. 1279 CE – 1300 CEMerinidesMap of 1279 CE →
  14. 1300 CE – 1492 CEMoroccoMap of 1300 CE →
  15. 1492 CE – 1530 CENo state drawn here on the mapMap of 1492 CE →
  16. 1530 CE – 1650 CEWatassid MoroccoMap of 1530 CE →
  17. 1650 CE – 1938 CEMoroccoMap of 1650 CE →
  18. 1938 CE – 1945 CEMorocco (France)under FranceMap of 1938 CE →
  19. 1945 CE – 1960 CEMoroccounder FranceMap of 1945 CE →
  20. 1960 CE – todayMoroccoMap of 1960 CE →

Quick answers

Who rules Marrakesh today?
On the latest map, Marrakesh is in Morocco.
Who ruled Marrakesh the longest?
On our maps, the Saharan pastoral nomads, for about 300 years (500 BCE to 200 BCE).
How many times has Marrakesh changed hands?
Our maps show it passing to a new ruler 11 times since 1 CE.
Who ruled Marrakesh in 1 CE, 1000, 1500 and 1900?
In 1 CE: no state on the map. In 1000: Caliphate of Córdoba. In 1500: no state on the map. In 1900: Morocco.

Dates are the years of our map snapshots, which are decades or centuries apart, so a change shown between two years happened at some point in that gap. The borders come from the historical-basemaps project and are approximate, especially for the ancient world and for peoples without fixed frontiers.

Marrakesh on this site

Marrakesh in the guided tours
Great Kingdoms of Africa and The Reconquista: Seven Centuries in Iberia

Visit today

See Marrakesh for yourself

Walking tours, museum and monument tickets, and guided visits to the places where Marrakesh's history happened.

Tours and tickets in Marrakesh

On GetYourGuide. We may earn a commission if you book. See our disclosure.