Founded by the Arabs in the 10th century, Mogadishu became the capital and chief port of Somalia. ... By 1871 the Sultan of Zanzibar gained control of Mogadishu and leased the city's port to the Italians in 1892. In 1905 the Italians bought the port city, making it the capital of Italian Somaliland