Marrakesh or Marrakech (məˈrækɛʃ or ˌmærəˈkɛʃ; murrākuš, murraːkuʃ; ) is the fourth largest city in Morocco. It is one of the four Imperial cities of Morocco and the capital of the Marrakesh-Safi region. It is situated west of the foothills of the Atlas Mountains.
The region has been inhabited by Berber farmers since Neolithic times. The city was founded in 1070 by Emir Abu Bakr ibn Umar as the imperial capital of the Almoravid Empire. The Almoravids established the first major structures in the city and shaped its layout for centuries to come. The red walls of the city, built by Ali ibn Yusuf in 1122–1123, and various buildings constructed in red sandstone afterwards, have given the city the nickname of the "Red City" (المدينة الحمراء Almadinat alhamra''') or "Ochre City" (ville ocre). Marrakesh grew rapidly and established itself as a cultural, religious, and trading center for the Maghreb.
After a period of decline, the city was surpassed by Fez. Marrakesh gain