Somalia developed from a string of Arab sultanates along the northeast coast of Africa, which in turn had grown up from trading posts established from the 17th century onwards. As Arab influence waned, the British, French and Italians established protectorates on the Somali coast during the late-19th century. These were the subjects of various treaties, forged amid frequent border clashes between the colonial powers and the neighbouring Ethiopians, and between the European powers themselves.
Modern Somalia was created on 1 July 1960 from British and Italian Somalilands. Inherited tribal rivalries and territorial disputes have dominated the country's subsequent history. The Somali Youth League held on to power throughout the 1960s, mostly under the leadership of President Shermake. Throughout that decade, the government aggressively pursued claims to the Ethiopian Ogaden region and parts of Kenya's Northern Frontier District the latter resulting in a severance of diplomatic relations with the UK between 1964 and 1968. After President Shermake was assassinated in October 1969, a military coup installed Mohamed Siad Barre as president of the renamed Somali Democratic Republic. The new government built up close relations with the Soviet Union, which was especially keen to make use of the port of Berbera. However, the Soviets were also close to the revolutionary regime in Ethiopia, whose relations with Somalia deteriorated throughout the 1970s. Forced into a choice, the Soviets opted for Ethiopia, to which Siad Barre responded by building up links with the West and the USA in particular.
The USA sensed an opportunity to bolster their position in East Africa and granted Somalia military and economic aid. Relations with Somalia's other principal neighbour, pro-Western Kenya, followed a similar pattern bad during the 1970s, followed by an improvement during the 1980s. However, by 1987, the Siad Barre government was faced with serious unrest at home, caused by the poor condition of the economy and growing repression. Over the next four years, a coalition of rebel groups gradually pushed back government forces before achieving outright victory in January 1991. Siad Barre fled into exile. Since then, Somalia has had no more than a semblance of central government.
The alliance that overthrew Siad Barre was inherently unstable. It was mainly formed from three mutually antagonistic ethnic groups, within which numerous complex clan and tribal loyalties co-existed, and was quite unable to reach the sort of essential compromises upon which any national regime must depend. The Somali National Movement (SNM) was dominated by the Issaq people from the north. The Somali Patriotic Movement (SPM), drawn mainly from the Ogadeni clan, held the south. The third major group, the United Somali Congress (USC), was composed mostly of people from the Hawiye clan and controlled the capital, Mogadishu. Since the middle of 1991, the country has effectively been divided into autonomous regions, each under the control of the prevailing clan or guerrilla organisation.
From this point onwards, the country steadily descended into political and economic anarchy. Mogadishu was consumed by the feud between the two main powerbrokers of the United Somali Congress Ali Mahdi Mohammed (erstwhile USC leader in the capital) and General Mohammed Farah Aideed (military commander of USC forces, operating under the banner of the Somali National Alliance, SNA).
In December 1992, in an attempt to impose some kind of order and protect an increasingly essential but vulnerable international food aid operation, the USA sent in 20,000 troops under UN auspices, adding to a smaller multinational UN force that had already been despatched. After a number of UN troops had been killed, the Americans identified General Aideed as the principal obstacle and made several attempts to capture or kill him. These ended in disaster and the death of a number of US servicemen. (The episode had a profound effect on the American military.) The Americans finally pulled out in March 1994 and the UN left the following year. Two years later, the bulk of the international aid community left after the kidnapping and murder of several workers. This removed a lifeline for many ordinary Somalis and caused severe hardship. However, over the last few years, following the establishment of a reasonably stable environment (see below), some of the Arab aid organisations who had previously borne the brunt of the relief effort have returned to Somalia. Partly under their influence, Islam has become a potent social and political force in Somalia. Following the terrorist attacks of 11 September 2001, the Americans have renewed their interest in Somalia for hosting members of the militant Ittihad al-Islamiya organisation, which is allegedly linked to the al-Qaeda terrorist network.
Farah Aideed died in 1997 and was succeeded by his son Hussein (ironically, a former soldier in the US army). Hussein joined a group of half a dozen or so major powerbrokers with their associated militias. Several of these were backed by Ethiopia, which had assumed an increasingly active role in Somalia. There have been occasional outbreaks of inter-factional fighting, notably in early 2002, although the fragile peace has, for the most part, been maintained. Ethiopia was a member of a six-country Inter-Governmental Authority on Development (the other members are Djibouti, Eritrea, Kenya, Somalia itself, and Sudan), which has led the search for a political settlement. In 2000, they managed to establish a Transitional National Government, which has UN recognition (a valuable asset) but limited credibility among Somalis. But a final settlement proved elusive. By early 2004, most of the country's major politicians, 'warlords' and representatives of the secessionist provinces in the north, had signed a deal to set up a new parliament.
The group of northern provinces that formerly comprised British Somaliland has been the most stable part of the country since the early-1990s. These provinces seceded from Somalia in 1991, to form a nominally independent state, known as 'Somaliland', under the leadership of a former Somali prime minister of the 1960s, Mohamed Ibrahim Egal. Although it has so far received little official recognition from the outside world, Somaliland has established its own democratic governmental structures (see below) and held elections in 2003. These were won by Dahir Riyale Kahine, an ally of Egal, standing for the main political party known as UDUB (Unity, Democracy and Independence).
Then, in 1998, the neighbouring region on Somalia's northeastern tip, known as Puntland, also seceded and declared itself independent. Under the terms of the accord under consideration in February 2004, Puntland would reunite with Somalia. As of late 2004, however, it remains semi-autonomous. Coaxing a presently reluctant Somaliland back into the fold is likely to be an even more difficult task.
In late 2004, Abdullahi Yusuf Ahmed was elected as the country's new president. Mohamed Abdullahi Mohamed was declared prime minister in 2010. Somalia was the worst-hit of all African states following the tsunami on December 26 2004. Damage was concentrated in the region of Puntland, on the tip of the Horn of Africa. The effects of the wave destroyed both homes and livelihood, plus it rendered wells and reservoirs unusable. Between 150 and 200 Somalis died, with thousands homeless or still unaccounted for. The UN has called for $13 million to help victims of the tsunami. However, Somalia's poor infrastructure, especially its roads, will present aid agencies with a formidable challenge.