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 of 18.1 million, of which 2.7 million live in the capital and largest city, Mogadishu. As one of Africa's most ethnically homogenous countries, around 85% of its residents are ethnic Somalis. The official languages of the country are Somali and Arabic, though Somali is the main language. Somalia has historic and religious ties to the Arab world. The overwhelming majority of the population are Sunni Muslims.
In antiquity, Somalia was an important commercial centre. 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, who merged all of 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, brutally attempting to squash the Somaliland War of Independence in the north of the country. The SRC collapsed in 1991 with the onset of the Somali Civil War. The Transitional National Government of Somalia (TNG) was established in 2000, followed by the formation of the Transitional Federal Government of Somalia (TFG) in 2004, which reestablished the Somali Armed Forces.