The name of Morocco is derived from that of the city of Marrakech, originally called “Murrakush”. Toward the year 1000 it was little more than a gathering-place for nomads, until Abou Bakr, head of the Almoravid armies, established his army camp on the spot.
In 1062 Youssef Ibn Tachfin, who supplanted Abou Bakr, built Ben Youssef Mosque there. This was only the first of a great number of mosques to be raised. Surrounded with ramparts, the small town quickly became a major commercial, cultural and religious centre. It was also in this period that the date grove was planted and Marrakech became the capital of the kingdom, which was united in 1083.
In 1147 Abdel Moumen, at the close of an interminable siege, took Marrakech, overcame the Almoravids and brought about the start of the Almohad Dynasty. The city then lived a veritable golden age, drawing writers and other intellectuals. It was under the reign of the Almohads that that which is still the symbol of Marrakech was built: the Koutoubia Mosque.
In 1269 the Merinids in their turn brought the Almohad Dynasty to an end and took the city. The capital was immediately moved to Fez and Marrakech became somewhat forgotten.
It was only in the 16th century with the Saadians coming to power that Marrakech regained some of its former glory.
Superb palaces such as the Badi Palace came into being, without of course forgetting the fabulous Saadian tombs, rediscovered in 1917.
When the Alawites took power in the 17th century, Marrakech definitively lost to Meknes its status of capital. The start of the French protectorate in 1912 did nothing to change the situation, since the administrative capital was established at Rabat. The city of Marrakech then was governed by Pasha El Glaoui, whose palace can be visited in the medina.