In southern Morocco, at the foothills of the Atlas Mountains, a city emerged in the fifth century AH/eleventh century CE that had not existed long before. Within a few generations, it had become the capital of an empire that stretched across Morocco and al-Andalus.
It is Marrakesh, the city founded by the Almoravids, which the Almohads then made the heart of their state. From it they ruled a vast area extending from the Sahara to the Mediterranean, and from Morocco to al-Andalus.
For this reason, the story of Marrakesh differs from that of Fez.
Fez grew out of an urban and scholarly environment associated with the Idrisids and al-Qarawiyyin, whereas Marrakesh emerged from the environment of the desert, the tribes and the Almoravid movement, and within decades transformed into an imperial capital.

A City Born from the Almoravid Movement
Sources differ on the exact year in which the founding of Marrakesh began. Historical sources place the beginnings in 454 AH/1062 CE, while other sources link the completion of the city's first nucleus to the years 459 AH/1067 CE to 462 AH/1070 CE.
The Turkish Encyclopaedia of Islam confirms that Abu Bakr began building the city in 454 AH/1062 CE, after which Yusuf ibn Tashfin completed a large part of the project after assuming administration of the Maghrib.
The choice of site was no accident. Marrakesh lies in the Haouz plain, near routes linking the Saharan south with northern Morocco, and at a distance that allowed it to connect with the Atlas roads, Morocco and al-Andalus. The city thus became a link between two worlds: the world of the desert from which Almoravid power came, and the world of the northern cities that they sought to control.
Here the distinctiveness of Marrakesh began.
From Military Camp to Capital
In its early days, Marrakesh was closer to a base for the Almoravids than to a fully formed city, but the state was expanding, and as it expanded the city's function changed.
The Almoravids did not control only the far Maghrib; they also entered al-Andalus, and Yusuf ibn Tashfin became one of the most prominent rulers of the Islamic West in the fifth century AH/eleventh century CE.
In 479 AH/1086 CE he crossed into al-Andalus in response to a request from the Taifa kings, and met the army of Alfonso VI at the Battle of Zallaqa, which ended in an Almoravid victory.
Historical sources describe this phase as the moment when Marrakesh became a political and cultural center of the Islamic West, benefiting from the expansion of the Almoravids in the Maghrib and al-Andalus.
Gold: The Artery that Linked Marrakesh to Africa
Military strength alone, however, does not create a capital of this size. There was also trade.
Marrakesh benefited from its position within the network of routes linking the Maghrib with the desert regions and sub-Saharan Africa. Gold arriving from West Africa was one of the most important elements of the economy that sustained the Almoravid state and the political entities that succeeded it.
For Marrakesh, therefore, the desert was not a geographical void but an economic route.
Merchants crossed the desert with caravans, and goods, gold, salt and various products reached the markets of the Maghrib, from which other merchandise then moved toward al-Andalus and the Mediterranean.
Recent studies of Almoravid Marrakesh indicate that the organization of markets was not solely an economic matter; it was part of the exercise of authority and the application of jurisprudential rulings in daily life.
Marrakesh and the Malikis: When Scholarship Became Part of State-Building
The Almoravid state was strongly tied to the Maliki school of law, and this connection was not merely a theoretical juristic position.
Scholars were part of political and social life, and fatwas, judiciary, market regulation and commercial relations were linked to the scholarly establishment.
For this reason Marrakesh began to develop a scholarly authority alongside the authority of the sultan. Then came Ali ibn Yusuf ibn Tashfin, who continued to develop the capital. Among the most prominent monuments of his reign is the Qubba of the Almoravids, which is considered one of the most important Almoravid architectural remains in Marrakesh.
A recent published study indicates that the Qubba stood at the heart of the Almoravid city and was linked to a project of water and urban development under Ali ibn Yusuf, who sought to transform Marrakesh into an imperial capital rivalling the cities of al-Andalus.
Here an important shift appears: the Almoravids were no longer building a camp; they were building an imperial city.

The Almohads: Marrakesh Reaches Its Peak
In 541 AH/1147 CE Marrakesh fell to the Almohads under the leadership of Abd al-Mumin ibn Ali, and Almoravid rule came to an end. Paradoxically, however, the Almohads did not abandon the city; they made it the capital of their empire.
The city witnessed vast urban expansion. Walls, gates, the Qasba, gardens and water installations were built, and the Kutubiyya was the most prominent symbol of this phase.
Construction of the mosque began under Abd al-Mumin between 541 AH and 553 AH/1147–1158 CE approximately, and it was then completed and its elements developed under his successors. Its minaret, which rises to about 77 meters, became a symbol of the city and one of the most celebrated examples of Islamic architecture in the West.
The Kutubiyya was not merely a congregational mosque; it was a sign that Marrakesh had become an imperial capital with a complete urban vision.

Yaqub al-Mansur: A Capital at the Height of Its Power
Marrakesh reached its zenith under Abu Yusuf Yaqub al-Mansur. The Almohads expanded the city, strengthened its Qasba, built gates and walls, and developed water networks and agriculture.
The Menara and Agdal were among the most prominent projects linked to water management and agriculture around the city, while the Qasba was built in the south to serve as a sultanic and military center.
Historical sources indicate that during this phase the Almohads established new quarters, extended the walls, fortified the Qasba, and created markets, gardens and water installations, including the network of khettaras that carried water to the city and its orchards.
This reveals an aspect often absent from accounts of the history of Islamic cities: architectural greatness was not only palaces and mosques; it was also the capacity to supply water and food and to organize the agricultural space around the city.

Marrakesh and al-Andalus: A Capital on Two Shores
In the Almohad period Marrakesh became closely tied to al-Andalus, and Seville was an important second center of the empire. The two cities exchanged architectural and cultural influences.
Studies of Almohad architecture show that architectural elements appeared in Marrakesh and then passed to, or resembled, models in Seville, the most famous of which is the style of minarets seen in the Kutubiyya and the Giralda in Seville and the Hassan Tower in Rabat.
Thus Marrakesh became part of a single civilizational space, one in which the waters of the strait separated Morocco and al-Andalus less than they connected them.
When Power Moved, the City Remained
Marrakesh fell to the Marinids in 668 AH/1269 CE, but the Marinids preferred Fez, and Marrakesh began to lose its political centrality.
This is an important moment in the history of cities: the loss of the capital does not necessarily mean the end of the city.
Marrakesh continued as a religious and commercial center, then returned to prominence strongly during the Saadi period in the tenth and eleventh centuries AH/sixteenth and seventeenth centuries CE.
Under the Saadis, the Saadian Tombs and the El Badi Palace were built, and a number of the city's structures were restored, returning Marrakesh to the circle of major sultanic cities.
Then came the Alawites, and the seat of power shifted again, especially when Sultan Moulay Ismail preferred Meknes as capital for a period of his reign, but Marrakesh remained a city of political, religious and architectural weight.
Marrakesh: A City That Left a Model
Marrakesh's importance in the history of Islam is not limited to its being the capital of the Almoravids and the Almohads. It is a city that shows how a religious and military movement can found a capital, how that capital can become an economic, scholarly and architectural center, and then become a model that other cities are influenced by.
UNESCO inscribed the old city of Marrakesh on the World Heritage List in 1406 AH/1985 CE, as a complete model of a major Islamic capital in the western Mediterranean, which still includes its walls, the Qasba, the Kutubiyya, the markets, the gardens and the living city.




