Marrakesh, or Marrakech (Berber: Merrakec, ⵎⴻⵔⵔⴰⴽⴻⵛ; Arabic: مراكش, Murrākuš) (pronounced Marra-kesh), is a major city in the northwest African nation of Morocco. With a population of 794,620 and 1,063,415 in the metropolitan area according to the 2004 census, it is Morocco's fourth largest city after Casablanca, Fes and Rabat, and the capital of the mid-southwestern economic region of Marrakech-Tensift-El Haouz, near the foothills of the snow-capped Atlas Mountains. By road, Marrakesh is located 580 km (360 mi) southwest of Tangier, 327 km (203 mi) southwest of the Moroccan capital of Rabat, 239 km (149 mi) southwest of Casablanca, and 246 km (153 mi) northeast of Agadir.
Marrakesh is the most important of the four former imperial cities in the history of Morocco. Inhabited by Berber farmers from Neolithic times, the city was founded in 1062 by Abu Bakr ibn Umar, chieftain and cousin of Yusuf ibn Tashfin. Led by the Almoravids, many mosques including the Koutoubia Mosque and madrasas (Koranic schools) were built here during the 12th century with Andalusian influence. The red walls of the city, built by Ali ibn Yusuf in 1122-1123, and various buildings constructed during this period have given the city the nickname of the "Red City" or "Ochre City" because of the red sandstone used. 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 Fez, in the early 16th century, Marrakesh again became the capital of the kingdom and reestablished its former glory especially during the reigns of the wealthy Saadian sultans Abu Abdallah al-Qaim and Ahmad al-Mansur who embellished the city with sumptuous palaces such as the El Badi Palace (1578), and restored many ruined monuments. As a centre for sufism, the city became known for its "Seven Saints". In 1912 the French Protectorate in Morocco was established and T'hami El Glaoui, known as "Lord of the Atlas", became Pasha of Marrakesh, a post he held virtually throughout the 44 year duration of the Protectorate, dominating the city and living a lavish lifestyle. In 2009, Fatima Zahra Mansouri became only the second woman in Morocco's history to be elected mayor of a city.
Morocco (Arabic: المغرب al-Maghrib ; Berber: ⴰⵎⵕⵕⵓⴽ or ⵍⵎⴰⵖⵔⵉⴱ Ameṛṛuk or Lmaġrib; French: Maroc), officially the Kingdom of Morocco. Arabic name al-Mamlaka al-Maghribiyyah (Arabic: المملكة المغربية) translates to "The Western Kingdom". Al-Maghrib (Arabic: المغرب), or Maghreb, meaning "The West", is commonly used. The Kingdom of Morocco is the most westerly of the North African countries. It has Atlantic and Mediterranean coastlines, and a rugged mountain interior.
Morocco has a population of over 32 million and an area of 446,550 km2 (172,410 sq mi); if Western Sahara is included that would be 710,850 km2 (274,460 sq mi). The political capital is Rabat, although the largest city is Casablanca; other major cities include Marrakesh, Tangier, Tetouan, Salé, Fes, Agadir, Meknes, Oujda, Kenitra, and Nador. Morocco has a history of independence not shared by its neighbours. Its rich culture is a blend of Arab, Berber (indigenous African) and also other African and European influences.