Mogadishu (ˌmɒ, also USˌmoʊɡ-,_ˌmɔːɡ-; Muqdisho, Wadaad: mʉq'dɪ:ʃɔ or Xamar, Wadaad: ħɑmɑr; ), locally known as Xamar or Hamar, is the capital and most populous city of Somalia. The city has served as an important port connecting traders across the Indian Ocean for millennia, and has an estimated urban population of 6,610,483. Mogadishu is located in the coastal Banadir region on the Indian Ocean, which unlike other Somali regions, is considered a municipality rather than a (federal state).
Mogadishu has a long history, which ranges from the ancient period up until the present, serving as the capital of the Sultanate of Mogadishu in the 9th-13th century, which for many centuries controlled the Indian Ocean gold trade, and eventually came under the Ajuran Empire in the 13th century which was an important player in the medieval Silk Road maritime trade. Mogadishu enjoyed the height of its prosperity during the 14th and 15th centuries and was during the early modern period considered the wealthiest city on the East African coast, as well as the center of a thriving textile industry. In the 17th century, Mogadishu and parts of southern Somalia fell under the Hiraab Imamate. In the 19th century it came under the Geledi Sultanate's sphere of influence yet the Abgal imams still held to power within and outside of the city.
In 1894 Somali Chief had signed a treaty of peace, friendship and protection with Filonardi of the Italian Benadir Company. The onset of Italian colonialism occurred in stages, with Italian treaties signed in the 1880s followed by economic engagement between Somali clans and the Italian Benadir Company and then direct governance by the Italian government after 1906, British Military Administration of Somalia after World War II and the UN Italian Trust Territory in the 1950s. This was followed by independence in 1960, the Hantiwadaag (socialist) era during Siad Barre's presidency (1969–1991), a three-decade civil war afterwards, and as of the late 2010s and 2020s a period of reconstruction.