The coast of Somalia has been of vital importance since ancient times. While we now think of the trade that passes through the Suez Canal and across to the Indian subcontinent, the region was vital even before. In Roman times, Somali and Arab merchants discouraged Indian merchants from visiting ports north of the Horn of Africa, as they were too close to Roman markets (so as to keep that lucrative connection for themselves), but they were free to establish themselves in ports such as Mogadishu, and so the city became a home for Indian traders in Africa. In addition to India and Rome, Somali merchants moved cloth and other goods from Phoenicia, Egypt, Greece, Persia, and beyond, down the Swahili coast. But networks also extended westward, into Sudan and Ethiopia. Ibn Khaldun, the Arab philosopher of the 14th century, described Mogadishu as a prosperous city, but still keeping a fundamentally nomadic character – Khaldun had proposed a cycle of history where nomadic peoples and settled peoples were in constant tension, and Mogadishu represented a triumph of the nomads.
When the Italians decided – late – to join the other European powers in the pursuit of colonialism, they set their sights on the Horn of Africa. In the late 19th century, they were “granted” what is now Eritrea (simply “Red Sea” in Latin) by the British, attempted to conquer Ethiopia (and failed, thanks to the Ethiopian Emperor Menelik II), and got the Somali sultans to sign off to become Italian protectorates. Mogadishu then, briefly, became Italian, but in the 1940s, Italy then lost Somalia to the British, who in turn handed the territory off to the United Nations until independence in the 1960s. When Somalia became independent, Mogadishu became its capital.