British forces that were in Kenya during World War II captured Mogadishu on February 26, 1941. The British ruled until they gave Italy control of the city again in 1952. Somalia became independent in 1960 with Mogadishu as its capital.