For more than 15 years, Somalia has been without a fully functioning government and torn apart by internal fighting. Below is a brief outline of the country and the key events that led to the latest fighting with Ethiopia.
Somalia's 10 million people are mainly Sunni Muslims.
They inhabit a land of desert, scrubland and mountains that extends for more than 1,000km down the East African coast.
The country has little industry and most of the population are herders and subsistence farmers.
Somali people have retained an ancient system of tribes and clans which dominates politics, business and trade.
Its neighbours are Djibouti to the northwest, Ethiopia to the west and Kenya to the southwest.
There are at least four million ethnic Somalis living in Ethiopia's Ogaden region.
History since independence
Somalia was created in 1960 through the merger of the British Somaliland Protectorate and Italian Somaliland.
|Mohammed Farah Aideed [AP] |
In 1969, Abdirashid Ali Shermarke, the then president, was assassinated and the army seized control. Mohammed Siad Barre became president.
In November 1991, after the overthrow of Barre, a power struggle broke out between rival clan regional commanders, Mohammed Farah Aideed and Ali Mahdi Mohammed.
Soon the government collapsed and fighting broke out between rival leaders, killing thousands of civilians.
Since 1990 Somalia had no functioning national government.
UN peacekeeping mission
In February 1992, the rival commanders signed a UN-sponsored ceasefire but failed to agree on monitoring provisions.
The UN deployed 500 soldiers in Mogadishu as part of United Nations Operation in Somalia (Unosom) which was intended to observe the ceasefire.
However, fighting continued to escalate.
|US soldiers leaving Somalia in 1993 [File: AP]|
In December 1992, the UN Security Council endorsed a full-scale military operation called Unosom II to be led by the US.
A week later US marines reached Mogadishu's beaches.
The UN deployment was initially a success, but soon fighting began not only between rival Somali factions and the UN's forces came under increasing attack from bandits and members of Aideed's militia.
In October 1993, 18 US army rangers and one Malaysian were killed after Somali militias shot down two US helicopters. Hundreds of Somalis died in the ensuing fighting.
The US withdrew from Somalia six months later. The UN peacekeeping mission finally ended in March 1995.
Civil war and anarchy
|Islamic Courts fighters in early 2006 |
Following the UN withdrawal Somalia collapsed into almost total anarchy as numerous local commanders and clans establishing their own virtual mini-states.
In October 2004, in the 14th attempt since 1991 to restore a central government, an Ethiopian-backed regional commander, Abdullahi Yusuf, was elected Somali president by politicians.
In December, a new government led by Mohammed Ali Gedi was sworn in in exile, in neighbouring Kenya.
In February, MPs arrived in the northwestern Somali town of Baidoa for the first meeting of the country's parliament on home soil.
After the descent into anarchy, the Islamic Courts Union tried to restore order by implementing the Sharia (Islamic law).
Before the new parliament met in the country in February, regional commanders formed an Alliance for the Restoration of Peace and Counter-Terrorism in what many analysts saw as a US-funded ploy to reduce the influence of Islamist leaders.
Rise of the Islamic Courts Union
On June 5, an Islamic Courts-allied militia defeated the US-backed leaders and took control of Mogadishu.
Since then, they have expanded their control over much of southern Somalia, capturing the key port town of Kismayo.
|Sharif Sheikh Ahmed, executive chairman of the Union of the Islamic Courts [File: AP]|
Areas under the Islamists' control have enjoyed a return to relative normality.
The Islamic Courts Union has also re-opened the city's international airport and numerous other ports along the Somali coast and invited foreign countries and individuals to invest in the war-shattered country.
The interim administration has been powerless to control fighting in Mogadishu and is not strong enough to move to the capital. It is based in Baidoa.
In the country's north, Somaliland and Puntland, two break-away regions, have established functioning governments and enjoy a measure of security and stability.
Somaliland, with the city of Hargeisa as its capital, declared independence from Somalia in 1991.
Source: Al Jazeera and agencies