Somalia’s history stretches back thousands of years and has long been tied to its geography and trading position. Known to the ancient Egyptians as the Land of Punt, Somalia became famous for producing frankincense and myrrh, both highly valued commodities. Archaeological evidence is limited, but hunter-gatherers are believed to have inhabited the region as early as the 8th millennium B.C. Over the centuries, Egyptian, Phoenician, Greek, Roman, Persian, Arab, and even Chinese traders came to Somali coasts, making towns such as Zeila and Mogadishu part of a wider Indian Ocean trade network. These towns flourished as centers of commerce and Islamic culture, linking East Africa to Arabia, Persia, and India. By the 9th century, Mogadishu had emerged as a leading city, controlling surrounding trade routes and exporting ivory, livestock, hides, slaves, and aromatic resins.
The Somali people trace their identity through clan-based genealogies that link them to Arab Quraysh ancestors. Over time, six major clan-families developed: the Dir, Darod, Hawiye, Isaaq, Digil, and Rahanweyn. Traditionally, the Somalis divided themselves into two main branches: the Samaal, who were mostly nomadic pastoralists, and the Sab, who were largely settled agriculturalists in the river valleys of the south. These clans migrated gradually across the Horn of Africa, often competing with Oromo groups and other communities for access to pasture and water. Their society was organized around kinship, with decision-making carried out in assemblies of adult males. Conflicts between clans were frequent, but temporary alliances were also common, especially in times of war.
One of the most famous figures in Somali history is Ahmed ibn Ibrahim al-Ghazi, also known as Ahmed Grañ (“the Left-Handed”), who led a powerful Muslim movement in the 16th century. Rallying Somali and Afar warriors, and supported by Turkish artillery, he waged a decade-long campaign against Christian Abyssinia, conquering much of the highlands. However, he was killed in 1542, and his conquests quickly collapsed. Despite this, he became a Somali folk hero, remembered as the first major leader to unify Somalis in a common struggle under Islam.
In southern Somalia, Somali clans expanded into the Juba and Shabeelle river valleys, where they displaced earlier rulers such as the Ajuran confederation. Agriculture grew in importance here, fueled in part by slave labor. Somali clans fought bitterly over control of caravan routes and ports, eventually displacing Arab merchant dynasties that had dominated the Benadir coast. The Somali takeover of coastal trade laid the foundation for their increasing economic and political role in the region.
The colonial period in the 19th century divided Somali-inhabited lands among European powers. Egypt briefly occupied northern Somali ports but withdrew in the 1880s. Britain established the British Somaliland Protectorate in 1884 to safeguard food supplies for Aden and protect the Suez Canal. France developed Djibouti, while Italy consolidated its hold on southern Somalia, creating Italian Somaliland. Ethiopia also annexed Somali-inhabited territories such as the Ogaden. These partitions left the Somali people scattered across five territories: British Somaliland, Italian Somaliland, Djibouti, the Ogaden, and Kenya’s Northern Frontier District. Resistance to colonial rule was fierce, particularly under Mohamed Abdullah Hassan, known to the British as the “Mad Mullah.” From 1899 to 1920, he led a sustained armed struggle against the British and Italians before being defeated by superior firepower.
Somalia gained independence in 1960 when British Somaliland and Italian Somaliland united to form the Somali Republic. The early years of independence were marked by high hopes but also serious challenges. Integrating two colonial administrations proved difficult, and political life became dominated by clan-based parties. While Somalis shared a common language, religion, and culture, politics was often shaped by descent-group loyalties and competition for scarce resources. The ideal of Pan-Somalism, or uniting all Somali-inhabited territories into a “Greater Somalia,” became a central political goal but also created tensions and conflicts with Ethiopia, Kenya, and Djibouti.
During the 1960s, Somalia’s civilian governments—led by Prime Ministers such as Abdirazak Haji Hussein and Mohamed Ibrahim Egal—struggled to address corruption, economic underdevelopment, and clan rivalries. President Abdirashid Ali Shermarke was assassinated in 1969, deepening the country’s instability. Soon after, the military, under Major General Mohamed Siad Barre, staged a bloodless coup.
The Revolutionary Regime abolished parliament and political parties, renaming the state the Somali Democratic Republic. Siad Barre and his Supreme Revolutionary Council adopted “Scientific Socialism,” a blend of Marxist-Leninist principles with Islamic and nationalist overtones. The government nationalized banks and large businesses, launched ambitious literacy campaigns using a new Somali script, and introduced social reforms, including expanded rights for women. A severe drought in 1974–75 devastated pastoral livelihoods but allowed the government to settle nomads into new agricultural and fishing communities.
Somalia’s Cold War alliances also shifted dramatically. In 1974, Somalia signed a treaty of friendship with the Soviet Union, which built naval and air bases at Berbera. But when Somalia invaded Ethiopia’s Ogaden region in 1977 to support Somali separatists, the Soviets sided with Ethiopia, airlifting weapons and Cuban troops. Defeated in 1978, Somalia expelled the Soviets and turned toward the United States and Arab allies for support. By the early 1980s, the country was politically authoritarian, economically weakened, and burdened with nearly one million refugees. Opposition movements began to grow, but Siad Barre remained in power, ruling through a strong security apparatus and clan-based patronage.