page_title: History of Marrakesh
section_title: Imperial capital
hierarchical_section_title: History of Marrakesh / Imperial capital
caption_attribution_description: English: Map of walls, with main parts of the walled city labelled and dated.
context_page_description: The history of Marrakesh, a city in southern Morocco, stretches back nearly a thousand years. The country of Morocco itself is named after it.
  Founded c. 1070 by the Almoravids as the capital of their empire, Marrakesh went on to also serve as the imperial capital of the Almohad Caliphate from 1147. The Marinids, who captured Marrakesh in 1269, relocated the capital to Fez, leaving Marrakesh as a regional capital of the south. During this period, it often broke off in rebellion into a semi-autonomous state. Marrakesh was captured by the Saadian sharifs in 1525, and resumed its status as imperial capital for a unified Morocco after they captured Fez in 1549. Marrakesh reached its epic grandeur under the Saadians, who greatly embellished the city. The Alawite sharifs captured Marrakesh in 1669. Although it served frequently as the residence of the Alawite sultans, Marrakesh was not their definitive capital, as Alawite sultans moved their courts frequently between various cities.
  In the course of its history, Marrakesh achieved periods of great splendor, interrupted by repeated political struggles, military disorders, famine, plagues and a couple of sacks.
context_section_description: Marrakesh served as the capital of the vast Almoravid empire, which stretched over all of Morocco, western Algeria and southern Spain (al-Andalus).  Because of the barrenness of its surroundings, Marrakesh remained merely a political and administrative capital under the Almoravids, never quite displacing bustling Aghmat, just thirty kilometres away, as a commercial or scholarly center. This began to change under the Almoravid emir Ali ibn Yusuf (r.1106-1142) ("Ben Youssef"), who launched a construction program to give Marrakesh a grander feel. Ali ibn Yusuf erected a new magnificent palace, along Andalusian design, on the western side of the city, connected by a corridor to the old Qasr al-Hajar armory.  More importantly, he introduced a new system of waterworks, via cisterns and khettaras (gravity-driven underground canals) designed by his engineer Abd Allah ibn Yunus al-Muhandis, that could supply the entire city with plenty of water and thus support a larger urban population. Ibn Yusuf also built several monumental ablution fountains and a grand new mosque, the Masjid al-Siqaya (the first Ben Youssef Mosque), the largest mosque built in the Almoravid empire.  The new mosque and the surrounding markets (souqs), were set to form the center of urban life. The rest of the fledgling city was organized into neighborhoods, cut across by two grand street axes, connecting four monumental gates: Bab al-Khamis (north), Bab Aghmat (SE) and Bab Dukkala (NW) and the Bab al-Nfis (SW).
  The new construction boom and availability of water began to finally attract merchants and craftsmen from elsewhere, gradually turning Marrakesh into a real city. The first to arrive were the tanners, arguably Marrakesh's most famous industry. (Goatskin tanned with sumac is still commonly referred to as "Moroccan leather" in English; books "bound in Moroccan leather" are synonymous with high luxury).  The "dirty" industries - tanners, potters, tile-makers, dyers - were set up on the east part of town, on the other side of the Issil river, partly because of the stench, partly because of their need for the river's water. Ali's irrigation system allowed a surfeit of new planted orchards, vineyards and olive gardens, which attracted oil presses and related businesses, set up on the north side of town.  Wealthy merchants and courtiers would go on to erect stately city homes, with Andalusian-style inner fountained garden courtyards, the riads for which Marrakesh is famous, and splendid colonnaded villas outside of it.
  Although the bulk of Almoravid coinage was still struck by the mints of Sijilmassa and Aghmat, gold dinars were struck in Marrakesh already in 1092, announcing its debut as a city.  Unlike other Moroccan cities, Jews were not allowed to live within Marrakesh by decree of the Almoravid emir, but Jewish merchants from Aghmat visited Marrakesh routinely, usually via the Bab Aylan gate and a makeshift Jewish quarter was erected outside the city limits.  Intellectual life was more tentative. Although Malikite jurists and theologians closely connected to the Almoravid court moved to Marrakesh, there were no madrasas outside the palace, thus scholars were naturally more attracted to the vibrant intellectual centers of Fez and Cordoba, and even nearby Aghmat and Sijilmassa.  A leper colony, the walled village of El Hara, was established then or sometime after, to the northwest of the city.  The city's earliest Sufi saint, Yusuf ibn Ali al-Sanhaji ("Sidi Yussef Ben Ali", d.1197) was a leper.
  Curiously, Marrakesh was originally unenclosed, and the first walls were erected only in the 1120s. Heeding the advice of Abu Walid Ibn Rushd (Averroes), Ali invested 70,000 gold dinars into bolstering the city's fortifications as Ibn Tumart and the Almohad movement became more influential. 6 metres (20 ft) tall, with twelve gates and numerous towers, the walls were finished just on time for the first attack on the city by the Almohads. The Almohads were a new religious movement erected by preacher and self-proclaimed Mahdi Ibn Tumart among the highland Masmuda of t
caption: The outline of the ramparts of Marrakesh today, including Almohad and later expansions.
exif: {}