Somalia occupies the easternmost projection of the African continent, the Horn of Africa, bordered by the Gulf of Aden to the north and the Indian Ocean to the east. The country shares land borders with Djibouti to the northwest, Ethiopia to the west, and Kenya to the southwest. The total land area measures approximately 637,657 square kilometers. The coastline extends over 3,300 kilometers, one of the longest in continental Africa. Two major rivers, the Jubba and the Shabelle, flow from the Ethiopian highlands through Somalia toward the Indian Ocean, though the Shabelle does not reach the ocean in most years. The Cal Madow mountain range in the north reaches elevations above 2,400 meters. The country's political geography includes the capital Mogadishu on the Indian Ocean coast, the self-declared independent region of Somaliland in the northwest with its capital at Hargeisa, the autonomous region of Puntland in the northeast with its capital at Garowe, and the southern region of Jubaland.
The population of Somalia was estimated at approximately 18 million in 2024, though precise census data remains unavailable due to ongoing conflict and limited state capacity. Ethnic Somalis constitute approximately 85 percent of the population. The Somali people are subdivided into major clan families including the Darod, Isaaq, Hawiye, Dir, Digil, and Rahanweyn. Clan identity remains the primary social organizing principle in Somali society. Minority groups include the Bantu Somalis, who descend from populations brought to Somalia from southeast Africa during the slave trade and number several hundred thousand, concentrated along the Jubba and Shabelle river valleys. Small populations of Arabs, Persians, Indians, and Italians reside primarily in urban centers. Mogadishu holds an estimated population between 2 and 2.5 million, making it by far the largest city. Hargeisa in Somaliland contains approximately 1 to 1.5 million residents. Other significant urban centers include Bosaso, a port city in Puntland with approximately 700,000 residents, and Kismayo in the south with approximately 400,000.
Somali and Arabic are the two official languages of Somalia. Somali belongs to the Cushitic branch of the Afroasiatic language family. The language was not written in an official script until 1972, when the Latin alphabet was adopted by the government of Mohamed Siad Barre. Prior to 1972, Somali existed primarily as an oral language, with Arabic, Italian, and English used for written administration depending on the region and colonial history. Somali contains three main dialect groups: Northern Somali, Benaadir, and Maay. Northern Somali, spoken in Somaliland, Puntland, and Djibouti, forms the basis of the standardized written language. Maay is spoken primarily by the Digil and Rahanweyn clan families in southern Somalia and differs significantly enough from Northern Somali that mutual intelligibility is limited. English and Italian are spoken by educated urban populations as legacy languages from colonial administration.
Islam is the state religion of Somalia, and the population is virtually 100 percent Sunni Muslim, primarily following the Shafi'i school of Islamic jurisprudence. Islam arrived in the Somali peninsula during the lifetime of the Prophet Muhammad in the 7th century CE, when early Muslims fleeing persecution in Mecca sought refuge across the Red Sea. The settlement at Zeila on the northern coast became one of the earliest Muslim communities in Africa. Somali Islam traditionally incorporated Sufi orders, particularly the Qadiriyya and Ahmadiyya orders, which emphasized mysticism and veneration of saints. Sheikh Isaaq, the 12th-century founder of the Isaaq clan, is buried at Maydh in Somaliland, and his tomb remains a pilgrimage site. Aw Barkhadle, located in the mountains near Hargeisa, contains the ruins of an ancient Islamic settlement with a necropolis of hundreds of tombs, some dated to the 12th century. The Fakr ad-Din Mosque in Mogadishu was constructed in 1269 CE and stands as one of the oldest surviving mosques in the city. Beginning in the 1990s during the collapse of state authority, more austere Salafi and Wahhabi interpretations of Islam gained influence, often imported through funding from the Persian Gulf states.