Mogadishu locally known as Xamar or Hamar, is the capital and most populous city of Somalia. The city has served as an important port connecting with traders over the Somali Sea for millennia, and the native inhabitants are the Shaansi community, in particular the Reer Xamar (English: Hamar people).
Mogadishu is located in the coastal Banadir region on the Somali Sea, which unlike other Somali regions, is considered a municipality rather than a maamulgoboleed (federal state). The territorial extent and scope of the term Benadir has varied in definition throughout its history, with medieval usage extending it to huge swaths of the Somali coast, the early modern period which extended the meaning of Benadir to the interior midway towards the Hirshabelle region, to the contemporary period wherein sometimes the nonstandard and incorrect misnomer of usage being interchangeable with the city of Mogadishu is used.
Mogadishu has a long history, which ranges from hunter-gatherers during the Lowland East Cushite and proto-Somali era during prehistoricity, the Zengisa Acra polity during the ancient period, the Muzaffar dynasty during the medieval era, the Ajuran Sultanate during the renaissance period, and the Geledi-Qais alliance in the early modern period.
The onset of European colonialism occurred in incremental stages, with Italian treaties in the 1880s followed by economic engagement between various Somali clans, including the Reer Mataan and the Shaansi (Cadcad) clans like reer Xamar and the Italian Benadir Company and then direct governance by the Italian government after 1906, British Military Administration of Somalia after World War two and the UN Trust Territory in the 1950s.
This was followed by independence in 1960, the Hantiwadaag (socialist) era during Barre's presidency (1969-1991), a three decade civil war afterwards, and as of the late 2010s and 2020s a period of reconstruction.