Somalia, officially the Federal Republic of Somalia, is the easternmost country in continental Africa. Stretching across the Horn of Africa, it borders Ethiopia to the west, Djibouti to the northwest, Kenya to the southwest, the Gulf of Aden to the north, and the Indian Ocean to the east. Somalia has the longest coastline on Africa's mainland. Somalia has an estimated population over 19 million, of which 2.7 million live in the capital and largest city, Mogadishu. As one of Africa's most ethnically homogeneous countries, around 85% of its residents are ethnic Somalis. The official and national language of the country is Somali, and Arabic is recognised as a second language. The overwhelming majority of the population are Sunni Muslims.

In ancient history, Somalia was an important commercial centre.John Kenrick (1855) Phoenicia, B. Fellowes, p. 199. During the Middle Ages, several powerful Somali empires dominated the regional trade, including the Ajuran Sultanate, Adal Sultanate, and the Sultanate of the Geledi. In the late 19th century, the Somali sultanates were colonised by the Italian and British empires,Encyclopædia Britannica, inc, Encyclopædia Britannica, Vol. 1, (Encyclopædia Britannica: 2005), p. 163 who merged these tribal territories into two colonies: Italian Somaliland and British Somaliland. In 1960, the two territories united to form the independent Somali Republic under a civilian government. Siad Barre of the Supreme Revolutionary Council (SRC) seized power in 1969 and established the Somali Democratic Republic, launching a failed invasion of Ethiopia which triggered major instability in Somalia and brutally attempting to quash the Somaliland War of Independence in the north of the country.

The SRC collapsed in 1991 with the onset of the Somali Civil War. Instability continued through periods of reduced conflict under transitional governments in the early 2000s.At the end of 2006, a US-backed Ethiopian invasion overthrew the Islamic Courts Union (ICU), leading to the installation of the Transitional Federal Government of Somalia (TFG) in Mogadishu under an Ethiopian military occupation. The subsequent insurgency which emerged saw the ICU fragment into various rebel factions, including the militant group al-Shabaab, which waged a protracted conflict against Ethiopian forces, the two powers exchanging control of territories through mid-2012. A new provisional constitution was passed in August 2012, reforming Somalia as a federation and began reconstruction under the Federal Government of Somalia. Insurgents still control much of central and southern Somalia and influence government-controlled areas.

Somalia is among the least developed countries in the world because of its low GDP per capita and the Human Development Index. It has maintained an informal economy mainly based on livestock, remittances from Somalis working abroad, and telecommunications. It is a member of the United Nations, the Arab League, African Union, Non-Aligned Movement, East African Community, and the Organisation of Islamic Cooperation.

In 2026 the United Nations and the World Food Programme warned that six million people or one third of Somalia's population were facing food crises and that 1.9 million children faced acute malnutrition, primarily due to a severe drought and cut in aid expenditures.

Etymology Samaale, the last common ancestor of several Somali clans, is generally regarded as the source of the ethnonym Somali. Another theory is that the name is derived from the words soo and maal, which together mean "go" and "milk". This interpretation varies depending on region, with northern Somalis believing it means "camel's milk," and southern Somalis using the transliteration "sa maal", which refers to cow's milk. This is a reference to the pastoralism of the Somali people.I. M. Lewis, A pastoral democracy: a study of pastoralism and politics among the Northern Somali of the Horn of Africa, (Oxford University Press : 1963), p.12. Another proposed etymology is that the term Somali is derived from the Arabic , transliterated as dhawu māl and meaning "wealthy", again referring to Somali riches in livestock.

The first written reference of the sobriquet Somali dates back to the early 15th century AD during the reign of Ethiopian Emperor Yeshaq I, who had one of his court officials compose a hymn celebrating a military victory over the Sultanate of Ifat.I.M. Lewis, A modern history of the Somali: nation and state in the Horn of Africa, 4, illustrated edition, (James Currey: 2002), p.25. Simur was also an ancient Harari alias for the Somali people.

History

Prehistory

Somalia was likely one of the first lands to be settled by early humans due to its location. Hunter-gatherers who would later migrate out of Africa likely settled here before their migrations. During the Stone Age, the Doian and Hargeisan cultures flourished here. The oldest evidence of burial customs in the Horn of Africa comes from cemeteries in Somalia dating back to the 4th millennium BC. The stone implements from the Jalelo site in the north were also characterised in 1909 as important artefacts demonstrating the archaeological universality during the Paleolithic between the East and the West.

According to linguists, the first Afroasiatic-speaking populations arrived in the region during the ensuing Neolithic period from the family's proposed urheimat ("original homeland") in the Nile Valley,Zarins, Juris (1990), "Early Pastoral Nomadism and the Settlement of Lower Mesopotamia", (Bulletin of the American Schools of Oriental Research) or the Near East.

The Laas Geel complex on the outskirts of Hargeisa in northwestern Somalia dates back approximately 5,000 years, and has rock art depicting both wild animals and decorated cows. Other cave paintings are found in the northern Dhambalin region, which feature one of the earliest known depictions of a hunter on horseback. The rock art is dated to 1,000 to 3,000 BC. Additionally, between the towns of Las Khorey and El Ayo in northern Somalia lies Karinhegane, the site of numerous cave paintings, which collectively have been estimated to be around 2,500 years old.

The camel is believed to have been domesticated in the Horn region between the 2nd and 3rd millennium BC. From there, it spread to Egypt and the Maghreb.Suzanne Richard (2003) Near Eastern archaeology: a reader , Eisenbrauns, p. 120 .

Classical era

Ancient pyramidical structures, mausoleums, ruined cities and stone walls, such as the Wargaade Wall, are evidence of an old civilisation that once thrived in the Somali peninsula. This civilisation enjoyed a trading relationship with ancient Egypt and Mycenaean Greece since the second millennium BC, supporting the hypothesis that Somalia or adjacent regions were the location of the ancient Land of Punt. The Puntites native to the region traded myrrh, spices, gold, ebony, short-horned cattle, ivory and frankincense with the Egyptians, Phoenicians, Babylonians, Indians, Chinese and Romans through their commercial ports. An Egyptian expedition sent to Punt by the 18th dynasty Queen Hatshepsut is recorded on the temple reliefs at Deir el-Bahari, during the reign of the Puntite King Parahu and Queen Ati.

In the classical era, the Macrobians, who may have been ancestral to Somalis, established a powerful kingdom that ruled large parts of modern Somalia. They were reputed for their longevity and wealth, and were said to be the "tallest and handsomest of all men".The Geography of Herodotus: Illustrated from Modern Researches and Discoveries by James Talboys Wheeler, pg 1xvi, 315, 526 The Macrobians were warrior herders and seafarers. According to Herodotus' account, the Persian Emperor Cambyses II, upon his conquest of Egypt in 525 BC, sent ambassadors to Macrobia, bringing luxury gifts for the Macrobian king to entice his submission. The Macrobian ruler, who was elected based on his stature and beauty, replied instead with a challenge for his Persian counterpart in the form of an unstrung bow: if the Persians could manage to draw it, they would have the right to invade his country; but until then, they should thank the gods that the Macrobians never decided to invade their empire.John Kitto, James Taylor, The popular cyclopædia of Biblical literature: condensed from the larger work, (Gould and Lincoln: 1856), p. 302. The Macrobians were a regional power reputed for their advanced architecture and gold wealth, which was so plentiful that they shackled their prisoners in golden chains.

During the classical period, the Barbara city-states of Mosylon, Opone, Mundus, Isis, Malao, Avalites, Essina, Nikon and Sarapion developed a lucrative trade network, connecting with merchants from Ptolemaic Egypt, Ancient Greece, Phoenicia, Parthian Persia, Saba, the Nabataean Kingdom, and the Roman Empire. They used the ancient Somali maritime vessel known as the beden to transport their cargo.

After the Roman conquest of the Nabataean Empire and the Roman naval presence at Aden to curb piracy, Arab and Somali merchants agreed with the Romans to bar Indian ships from trading in the free port cities of the Arabian peninsula. to protect the interests of Somali and Arab merchants in the lucrative commerce between the Red and Mediterranean Seas.. However, Indian merchants continued to trade in the port cities of the Somali peninsula, which was free from Roman interference.. For centuries, Indian merchants brought large quantities of cinnamon to Somalia and Arabia from Ceylon and the Spice Islands. The source of the cinnamon and other spices is said to have been the best-kept secret of Arab and Somali merchants in their trade with the Roman and Greek world; the Romans and Greeks believed the source to have been the Somali peninsula.. The collusive agreement among Somali and Arab traders inflated the price of Indian and Chinese cinnamon in North Africa, the Near East, and Europe, and made the cinnamon trade a very profitable revenue generator, especially for the Somali merchants.

Islamic era

Islam was introduced to the area early on by the first Muslims of Mecca fleeing prosecution during the first Hejira with Masjid al-Qiblatayn in Zeila being built before the Qiblah towards Mecca. It is one of the oldest mosques in Africa. In the late 9th century, Al-Yaqubi wrote that Muslims were living along the northern Somali seaboard. He also mentioned that the Adal Kingdom had its capital in the city. According to Leo Africanus, the Adal Sultanate was governed by local Somali dynasties and its realm encompassed the geographical area between the Bab-el-Mandeb and Cape Guardafui. It was thus flanked to the south by the Ajuran Empire and to the west by the Abyssinian Empire.

Throughout the Middle Ages, Arab immigrants arrived in Somaliland, a historical experience which would later lead to the legendary stories about Muslim sheikhs such as Daarood and Ishaaq bin Ahmed (the purported ancestors of the Darod and Isaaq clans, respectively) travelling from Arabia to Somalia and marrying into the local Dir clan. The oldest writing in Somalia dates to this time, with the funerary inscription of Ḥajj Shānid in the al-Jami mosque in Barawa dating to 1104 or 1105 CE (year 498 AH). Although these medieval inscriptions are in Arabic, they were clearly written by people who were well-integrated into Somali culture and society. For example, an inscription from 1365 CE calls this year a Saturday year, using the traditional Somali calendar where years are named after the weekday on which the year begins.