Marrakesh or Marrakech or Meṛṛakec, is a major city of Morocco. It is the fourth largest city in the country, after Casablanca, Rabat and Fes. It is the capital city of the mid-southwestern region of Marrakesh-Asfi. Located to the north of the foothills of the snow-capped Atlas Mountains. Marrakesh is possibly the most important of Morocco's four former imperial cities (cities that were built by Moroccan Berber empires). The region has been inhabited by Berber farmers since Neolithic times, but the actual city was founded in 1062 by Abu Bakr ibn Umar, chieftain and cousin of Almoravid king Yusuf ibn Tashfin. The red walls of the city, built by Ali ibn Yusuf in 1122–1123, and various buildings constructed in red sandstone during this period, have given the city the nickname of the "Red City" or "Ochre City". Marrakesh grew rapidly and established itself as a cultural, religious, and trading centre for the Maghreb and sub-Saharan Africa; Jemaa el-Fnaa is the busiest square in Africa.
After a period of decline, the city was surpassed by Fes, but in the early 16th century, Marrakesh again became the capital of the kingdom. Beginning in the 17th century, the city became popular among Sufi pilgrims for Morocco's seven patron saints, who are entombed here.
Tourism is strongly advocated by the reigning Moroccan monarch, Mohammed VI, with the goal of doubling the number of tourists visiting Morocco to 20 million by 2020. Despite the economic recession, real estate and hotel development in Marrakesh has grown dramatically in the 21st century. Marrakesh is particularly popular with the French, and numerous French celebrities own property in the city. Marrakesh has the largest traditional Berber market (souk) in Morocco, with some 18 souks selling wares ranging from traditional Berber carpets to modern consumer electronics. Crafts employ a significant percentage of the population, who primarily sell their products to tourists.