 By 1892 , Mogadishu was under the joint control of the Somali Sultanate of the Geledi and the Omani Sultanate of Zanzibar . The Geledi Sultans were at the height of their power . They dominated the southern ivory trade , and also held sway over the Jubba and Shebelle valleys in the hinterland . The Omani Sultans ' authority in Mogadishu , however , was largely nominal . When Imam Azzan bin Qais of Oman sought to build a fort in the city , he was thus obligated to request permission from Sultan Ahmed Yusuf of Geledi . This Fort of Garessa was eventually constructed in 1870 . The Sultan of Zanzibar later leased and then sold the infrastructure that he had built to the Italians , but not the land itself , which was Somali owned . 
