Located on a fertile plain, Marrakesh is one of Morocco's four imperial cities. Founded in eleventh-century as the African capital of Almoravid dynasty; it was conquered by the Almohads in 1147, and then to Marinids, only to be taken by the French in 1912.
Marrakesh was founded in 1062 by Yusif Ben Tashfin, the first ruler of the Almoravid dynasty. His son, Ali, built the Ben Yussef Mosque and the city wall. The Almohads (1146-1268) made Marrakesh the capital of their empire and it was during this period that the Koutoubia was built.
The Marinids (1268-1520) neglected Marrakesh but they were succeeded by the Saadians (1520-1668) who endowed the city with the Badi' palace, the Ben-Yussef madrasa and the Saadian mausoleum.
From 1668 onwards, the Alawites, who resided in Marrakesh only occasionally, erected numerous buildings such as the palace of Bahia and Dar Si Saod at the end of the nineteenth-century. Later, the modern town was to develop three kilometres from the Medina, with its wide avenues bordered with palm-trees, orange-trees and jacarandas.
When first created in the 11th century, Marrakesh was a link on the caravan route that joins the south and the north of Morocco by way of the valleys up the Upper Atlas. Routes from the Tafilelt region and the Draa valley also converged on Marrakesh. Later, as the capital of the Almoravid and subsequently the Almohad empires (eleventh and thirteenth centuries), it became the seat of the unique authority ruling the entire Muslim West, including Andalusia.
At that time, Marrakesh was a large metropolis, housing probably up to 100,000 inhabitants.
Between the thirteenth and early sixteenth centuries, Marrakesh experienced a period of decline due to the displacement further east (in Algeria, Tunisia and particularly Egypt) of roads used to transport African gold, and the relocation of Morocco's capital to Fez. During the sixteenth and seventeenth centuries, under the Saadians, Marrakesh was revived and flourished thanks to the gold trade, and the conquest of Tombouctou by the Saadians.
The fortifications of Marrakech were first constructed in 1126 and 1127 by Almoravid leader 'Ali bin Yusuf (reg. 1107-1142). At that time, Marrakech was the capital city of the Almoravid empire and was the subject of increasingly frequent attacks by other groups attempting to seize power of the region, particularly the Almohads who eventually conquered the city. The fortifications were built to enclose the city along its extents at that time and to protect the capital, its treasury and its leaders. The huge construction project was completed in only eight months.
The overall plan of the fortifications is an irregular polygon with fifteen major faces, including one extremely long south face. The plan is asymmetrical, as it was determined by the sprawl of the Almoravid city that the walls were built to enclose. In all, the length of the fortifications is approximately 9 km, making it one of the longest continuous city enclosures in existence. After 1147, Almohad rulers encouraged city growth beyond the boundaries of the Almoravid fortifications, so the walls bound only the inner medina of modern-day Marrakech.
The wall system includes a series of gates that provide fortified points of entry and exit from the Almoravid city. Twelve principal gates, some of which still stand, were constructed during the Almoravid period and the first years of Almohad rule. While some of the gates were built concurrently with the construction of the walls in 1126, others are dated to the time of the Almohad conquest of Marrakesh in 1147. At least seven additional gates previously existed but have been destroyed and are less known to contemporary historians. The twelve major original gates of the Marrakesh fortifications, in linear sequence, are Bab Aylan, Bab ad-Dabbagin, Bab el-Khemis, Bab Tagzut, Bab Mussufa, Bab Dukkala, Bab ar-Raha, Bab al-Mahzan, Bab as-Saria, Bab Neffis, Bab as-Saliha, and Bab Aghmat. Not included in this list is the gate that is best known today, the Bab Agnaou, which was built in 1147 but only became well-trafficked decades later.
Along their length, the walls feature numerous defensive towers that project out along their exterior faces. These towers would allow soldiers within the city to fight invading forces from a superior vantage at the top of the perimeter wall. The walls are approximately 2 meters deep along their length, and 8 to 14 meters deep where they are thickened by the addition of towers or fortified gates. There is also archaeological evidence that the walls were originally surrounded by a fossé, or a large dry ditch which served to increase the height of the ramparts from the exterior.
Due to the speed with which the fortifications needed to be constructed in order to stave off enemy attacks, the use of stone as a primary building material was quickly ruled out, as it was both difficult to source and expensive. Instead the ramparts, walls, fortified towers and gates were constructed using the pisé (rammed earth) technique, also known as tabiya or luh. In this construction method, moistened earth was rammed into temporary formworks from above to create a densely packed mud wall that built up from the ground in stratified layers. This technique had spread to Morocco after early Roman and Phoenician examples were built along the coast, and the red soil around Marrakech had proven to be ideal for this type of construction in previous applications.
A major addition to the fortifications was made in the 1830s by Moulay 'Abd-al-Rahman (reg. 1822-1859) in order to protect the vast Agdal Gardens that he commissioned adjacent to the south of the existing city walls. Enclosing these gardens added approximately 7 kilometers of defensive walls to the extant fortifications of the city. The west ramparts bordering the Agdal Gardens were destroyed in 1862, only 30 years after their construction; the ruling sultan Sidi Muhammad IV (reg. 1859-1873) rebuilt the ruined sections of the wall and further commissioned the fort Sqallat al-Mrabit to defend the west side of the city.
While the north and west faces of the Almoravid walls remain relatively intact, a large portion of the south wall and three of its gates have been ruined. Additional small sections of the wall have been lost, as well as most of the Almohad gates. However, the fortifications remain a strong physical presence in Marrakech today and continue to demarcate the boundary between the early Almoravid city and its later Almohad, Sa'did, Alawid and French expansions.
Bosworth, Clifford Edmund. 1996. The New Islamic Dynasties, 37-53. New York: Columbia University Press, 1996.
Deverdun, Gaston. Marrakech, des origines à 1912, 108-128, 229-232, 528-529. Casablanca: Editions Frontispiece, 2004.