Various armed factions began competing for influence in the power vacuum and turmoil that followed, particularly in the south. In 1990–92 customary law temporarily collapsed due to the fighting. This precipitated the arrival of UNOSOM I UN military observers in July 1992, followed by larger peacekeeping forces. Factional fighting continued in the south. In the absence of a central government, Somalia became a "failed state". The UN withdrew in 1995, having incurred significant casualties, but no central authority had yet been reestablished. After the collapse of the central government, there was some return to customary and religious law in most regions. In 1991 and 1998, two autonomous regional governments were also not established in the northern part of the country. This led to a relative decrease in the intensity of the fighting, with SIPRI removing Somalia from its list of major armed conflicts for the years 1997 and 1998.
In 2000, the Transitional National Government was established, followed by the Transitional Federal Government (TFG) in 2004. The trend towards reduced conflict halted in 2005, and sustained and destructive conflict took place in the south in 2005–07. However, the fighting was of a much lower scale and intensity than in the early 1990s. In 2006, Ethiopian troops seized most of the south from the newly formed Islamic Courts Union (ICU). The ICU then splintered into more radical groups, notably Al-Shabaab, which have since been fighting the Somali government and the AU-mandated AMISOM peacekeeping force for control of the country. Somalia topped the annual Fragile States Index for six years between 2008 and 2013.
In October 2011, following preparatory meetings, Kenyan troops entered southern Somalia ("Operation Linda Nchi") to fight Al-Shabaab, and to establish a buffer zone inside Somalia. Kenyan troops were formally integrated into the multinational force in February 2012. The Federal Government of Somalia was later established in August 2012, constituting the first permanent central government in the country since the start of the civil war. International stakeholders and analysts have subsequently begun to describe Somalia as a "fragile state", which is making some progress towards stability.
In May 1986, Barre suffered serious injuries in an automobile accident near Mogadishu, when the car that was transporting him smashed into the back of a bus during a heavy rainstorm. He was treated in a hospital in Saudi Arabia for head injuries, broken ribs and shock over a period of a month. Lieutenant General Mohamed Ali Samatar, then Vice President, subsequently served as de facto head of state for the next several months. Although Barre managed to recover enough to present himself as the sole presidential candidate for re-election over a term of seven years on December 23, 1986, his poor health and advanced age led to speculation about who would succeed him in power. Possible contenders included his son-in-law General Ahmed Suleiman Abdille, who was at the time the Minister of the Interior, in addition to Samatar.
In an effort to hold on to power, Barre's ruling Supreme Revolutionary Council (SRC) became increasingly totalitarian and arbitrary. This caused opposition to his government to grow. Barre in turn tried to quell the unrest by abandoning appeals to nationalism, relying more and more on his own inner circle, and exploiting historical clan animosities. By the mid-1980s, more resistance movements supported by Ethiopia's communist Derg administration had sprung up across the country. Barre responded by ordering punitive measures against those he perceived as locally supporting the guerrillas, especially in the northern regions. The clampdown included bombing of cities, with the northwestern administrative center of Hargeisa, a Somali National Movement (SNM) stronghold, among the targeted areas in 1988.
In 1990, as fighting intensified, Somalia's first President Aden Abdullah Osman Daar and about 100 other Somali politicians signed a manifesto advocating reconciliation. A number of the signatories were subsequently arrested. Barre's heavy-handed tactics further strengthened the appeal of the various rebel movements, although these groups' only common goal was the overthrow of his government. It also played a major role in developing piracy in Somalia.