British, French, and Italian imperialism all played an active role in the region in the 19th cent. Great Britain's concern with the area was largely to safeguard trade links with its Aden colony (founded 1839), which depended especially on mutton from Somalia. The British opportunity came when Egyptian forces, having occupied much of the region in the 1870s, withdrew in 1884 to fight the Mahdi in Sudan. British penetration led to a series of agreements (188486) with local tribal leaders and, in 1887, to the establishment of a protectorate. France first acquired a foothold in the area in the 1860s. An Anglo-French agreement of 1888 defined the boundary between the Somalian possessions of the two countries.
Italy first asserted its authority in the area in 1889 by creating a small protectorate in the central zone, to which other concessions were later added in the south (territory ceded by the sultan of Zanzibar) and north. In 1925, Jubaland, or the Trans-Juba (east of the Juba [now Jubba] River), was detached from Kenya to become the westernmost part of the Italian colony. In 1936, Italian Somaliland was combined with Somali-speaking districts of Ethiopia to form a province of the newly formed Italian East Africa. During World War II, Italian forces invaded British Somaliland; but the British, operating from Kenya, retook the region in 1941 and went on to conquer Italian Somaliland. Britain ruled the combined regions until 1950, when Italian Somaliland became a UN trust territory under Italian control.