The coast of Africa's eastern horn has long been a region of strategic significance and of cultural ferment. During the "scramble for Africa" in the late 1800s, the British were able to secure several treaties from local Somali leaders in the northern plateau area and declared the region a protectorate (called "Somaliland") in 1886.
In the southern portion of the horn and elsewhere along the East African coast, the Italians were pursuing treaties with the Arab or Swahili sultans who controlled most of the area's significant trading cities. In 1905, the Italians had declared the colony of "Italian Somaliland"—which included the modern capital of Mogadishu. From 1936, the region of southern Somalia served as a base for Italian operations in Ethiopia, as the Italians sought to expand their colonial holdings. During World War II there were clashes between the forces of British and Italian Somaliland, with the British eventually seizing control of all Italian holdings. In 1950, the area of Italian Somaliland was returned to Italian administration, but under the aegis of a UN trusteeship.
The combination of nationalist agitation in both Somali-lands and UN pressure for decolonization led to the two regions being unified as an independent Somalia on 1 July 1960. Elections in 1959 gave a strong majority to the Somali Youth League (SYL) party, but the first independent government was a coalition formed between the SYL and two smaller parties from the northern region. The first prime minister was Abdirashid Ali Shirmake, with Aden Abdullah Osman Darr as president.
From the first years of independence, Somalia's government pursued a policy of "Somali self-determination" that led to tensions and conflict with neighboring states. Tens of thousands of ethnic Somali lived in the Ogaden region of Ethiopia, northeastern Kenya, and French Somalia (now Djibouti). The Somali government stated that these regions rightfully belonged to Somalia. Border skirmishes between Somali forces and those of Ethiopia and Kenya were common in the 1960s. These tensions were further fueled in 1962 when Somalia signed an agreement with the Soviet Union for the provision of military aid.
During the course of the 1960s, Somalia saw not only regional, but growing internal conflict. Rivalries between clans saw the fragmentation of political parties into smaller and smaller units. By the late 1960s, there were over 60 political parties in the country. When President Abdirashid Ali Shermake was assassinated in October 1969, the military seized power under the leadership of Major General Mohamed Siad Barre. Siad Barre's government disbanded the Parliament, suspended the Constitution, and formed the Supreme Revolutionary Council. Declaring a policy of "scientific socialism" the government nationalized many foreign-owned firms, drawing the ire of already suspicious Western powers. The new government launched ambitious development and infrastructural programs, created an alphabet for the Somali language, and launched a major literacy campaign.
By the middle of the 1970s, Somalia was embroiled in regional and international conflicts. In 1975, the United States alleged that Somalia was allowing the Soviet Union to establish military bases along the strategic Gulf of Aden. In 1977, Siad Barre officially recognized the Western Somali Liberation Front, which had been fighting for Somali self-determination in the Ogaden region of Ethiopia, and then sent in Somali troops. Substantial gains were made until the Ethiopians signed a mutual defense treaty with the Soviet Union, leading to massive military aid and an airlift of some 17,000 Cuban troops. Unable to face such overwhelming odds, the Somali troops were soon pushed out of the Ogaden. Soviet advisers were expelled from Somalia in retaliation, and the Siad Barre government turned to the West for support. The 1980s, during the administration of U.S. president Ronald Reagan, saw increasing U.S. military and economic aid to the Siad Barre government. Such aid was essential to the Somali repulsion of an Ethiopian-backed invasion in 1982.