|Marrakech was founded in 1062 (year 454 of Hégire) by Youssef Ibn Tachfin, first king of the dynasty of Almoravides.|
Very quickly, in Marrakech, under the impulse of Almoravides, pious and austere men, of many mosques and médersas (schools of Koranic theology) were built, as well as a shopping mall for the Maghreb and the Black Africa. Marrakech grows quickly and was essential like an arts center and influential monk; ramparts were also built to protect the city.
The city was then strengthened by the son of Youssef Ibn Tachfin, Ali Ben Youssef, by the construction of ramparts on several kilometers. The architecture of the city was influenced by Fès, capital founded by Idris I er, and Moslem Spain. These two cities are the cultural and architectural radiation of Morocco, but also of the World Arabo-Moslem: it is they which inspired Al Andalus and which joined together it in the Arab World.
In 1147, Almohades, in favor of an orthodoxe Islam, seized the enclosure of the city; the Almoravides last were exterminated and almost the totality of the destroyed monuments. Almohades built many palaces and religious buildings, such as for example, celebrates it mosque of Koutoubia built on the ruins of a palace almoravide.
In order to feed the palm plantation and the large gardens, a system of irrigation was sophisticated. Marrakech, by cultural radiation attracted many writers and artists, come in particular from Andalusia.
In 1269, Marrakech was conquered by the nomads mérinides at the expense of the Almohades last. When the advent of the Mérinide dynasty occurred, Marrakech fell then into a certain lethargy, and its decline involved the loss of its statute of capital to the profit of its large rival, Fès.
At the beginning of the 16th century, Marrakech becomes again the capital of the kingdom, quickly reached its apogee, in particular thanks to the sultan Saadien, Mohammed El Mahdi. From the fortune piled up by the sultans, Marrakech was clearing, the monuments ruins some then restored and of sumptuous built palaces. The palace built by Saadiens, Badi, is a counterpart of Alhambra, carried out with the most invaluable materials coming from Italy, of Sudan, of the Indies and even of China. A sumptuous protocol, inspired of Topkapi of Istanbul, is applied there. In spite of their opposition to the Turks, Saadiens are attracted by Othoman civilization. A vestige of this influence resides in the name of the district of Derb Dabachi, which derives from the term “ogdabachi” and appoints a senior officer in the Othoman military hierarchy.
Marrakech again will lose its statute of capital. At the end of the 17th century, the current dynasty alaouite succeeded Saadiens. The throne is successively transferred to Fès then with Meknès, new imperial city.
At the beginning of the 20th century, Marrakech knows a few years of civil wars.
In 1912, the introduction of French protectorate in Morocco puts an end to this anarchy. In 1956, the return of exile of the king Mohammed V will be celebrated to Marrakech as in the remainder of the country.