Located in the Horn of Africa, the Federal Republic of Somalia has been inhabited since the Paleolithic period.
Ancient Somalia domesticated the camel during the 3rd and 2nd millennium BC, and developed a profitable trade system.
The Adal and Ajuuraan kingdoms flourished during the Middle Ages, and their successor states continued to thrive through the 19th century. The notorious 'Scramble for Africa' began in the late 19th century, as European powers set their sights on colonizing the continent.
Dervish leader, Mohammed Abdullah Hassan, rallied against the British forces trying to take control, and sparked one of the longest colonial resistance wars in history.
In 1920, following a series of aerial bombardments by Britain, the Dervish state collapsed and its territory turned into a protectorate.
Britain withdrew from British Somaliland in 1960 in order to allow its protectorate to join with Italian Somaliland and form the new nation of Somalia. In 1969, a coup headed by Mohamed Siad Barre ushered in an authoritarian socialist rule that managed to impose a degree of stability in the country for a couple of decades.
Following the regime's overthrow early in 1991, Somalia descended into decades of turmoil, factional fighting and anarchy. In June 2006, a coalition of clerics, business leaders and Islamic court militias, the Supreme Council of Islamic Courts (SCIC), defeated powerful Mogadishu warlords and took control of the capital.
The Courts continued to expand, spreading their influence throughout much of southern Somalia and threatening to overthrow the TFG in Baidoa. Ethiopian and TFG forces concerned over suspected links between some SCIC factions and al-Qaida in late December 2006 drove the SCIC from power.
During 2007 and 2008, Al-Shabaab seized key towns and ports in central and southern Somalia. In January 2009, the Ethiopian troops were forced to withdraw from the country.
President Abdullahi Yusuf Ahmed resigned from office in December 2008, and a month later Sheikh Sharif Sheikh Ahmed was elected president.
Conflict continues in the southern and central parts of the country between government troops and extremist Islamist militants with links to al-Qaeda.
A famine struck Somalia in 2011 following the worst drought of East Africa in 60 years. Relief from all over the world poured in, and by February 2012 the UN announced that the food crisis was over.
In spite of the civil unrest, the economy has remained healthy, primarily based on livestock, money transfer companies and telecommunications.