In March 1992, the UN organized a tenuous ceasefire in the capital. The Security Council called for an arms embargo and moved to create the United Nations Operation in Somalia (UNOSOM), a group assigned to encourage peace talks and observe the distribution of food aid. UNOSOM had no military capacity. Certain factions, particularly the Aidid-led USC group, alleged that the UN was supplying their enemies with arms, and interrupted or seized relief supplies. During this time Siad Barre's SNF attempted to retake Mogadishu, but was driven back. This defeat effectively cost Siad Barre what little support and legitimacy he retained. After 21 years of rule, he fled the country.
Adding to Somalia's woes was a severe drought. Pastoralists and farmers, whose livelihoods had already been disrupted by the civil war, found themselves both unable to produce food and unable to find safe haven. Nearly half a million are estimated to have fled the country for camps in Kenya, Ethiopia, and Djibouti. Hundreds of thousands were threatened with starvation, and the political turmoil prevented effective distribution of relief supplies. In response to this deteriorating situation, the UN and the U.S. government organized the United Nations International Task Force (UNITAF). Composed of over 30,000 troops from over 20 countries, the UNITAF forces staged a dramatic landing in Mogadishu in December 1992. Given the moniker "Operation Restore Hope" the troops occupied urban centers throughout Somalia over the next several weeks, opening roads and establishing food-distribution networks. UNITAF forces also undertook efforts to establish a more stable peace—arranging talks between two of the most powerful Mogadishu-based warlords, Mohammad Fara Aidid and Ali Mahdi. Divisions within the UNITAF administration became evident when the UN contingent pressed for active disarmament of the various armed factions. Despite U.S. reluctance, limited disarmament operations were undertaken.
In the early months of 1993, UNITAF forces were being substantially reduced, though conflicts between factions continued in many parts of the country. Ethiopia hosted representatives of 15 factions for a "national reconciliation" conference in March 1993. After extended debate, the conference established a transitional committee that was to serve as the supreme administrative body for Somalia, and which had a mandate to hold elections within two years. This outcome also prompted the UN to make arrangements for UNITAF to be disbanded and replaced by UNISOM II—which was to have a more rigid command structure and a clearer mandate to disarm the Somali factions.
The situation in Somalia had become increasingly tense by June 1993. Tensions between UNISOM II and Mohammad Fara Aidid's Mogadishu-based group (called the Somali National Alliance) increased over issues of disarmament and UN accusations that Aidid was hindering peace talks. On 5 June a conflict between UNISOM II and Aidid's forces resulted in the deaths of 23 Pakistani peacekeepers. A warrant was later issued for Aidid's arrest. Attempts to capture Aidid over the next several months led to hundreds of Somali's being killed or wounded. Such incidents led to an erosion of Somali goodwill towards the peacekeeping forces. On 3 October, U.S. Rangers entered an area of Mogadishu under Aidid's control. In the ensuing battle, 18 American combatants were killed and dozens injured. The incident also resulted in hundreds of Somali casualties. Negative public opinion issuing from the clash led to plans being laid for an accelerated U.S. withdrawal.
In late 1993 and early 1994, several conferences between faction leaders were held in Ethiopia and in different regions of Somalia. Various factors—including conflicting strategies from within UNISOM and strife between Somali factions—prevented the reaching of any substantive agreements. In February 1994, the UN voted to gradually reduce its troop strength. This process continued until March 1995, when the last of the UN and U.S. troops left Somalia.
With the withdrawal of international forces, conflict between regional and clan-based factions continued. Further, unarmed UNOSOM personnel and relief workers who remained in Somalia became increasingly vulnerable to banditry. Some aid organizations simply declared the situation unworkable and pulled out of Somalia altogether. Others have taken to hiring bodyguards and paying "protection" to local leaders for the right to continue humanitarian operations in the area.
As Somalia entered the twenty-first century, it did so without a national government. However, the situation had somewhat stabilized with the establishment of several regional governments. Under the leadership of the SNM, the "Republic of Somaliland" in the north has maintained a modicum of stability. Courts have been established and currency has been printed. Still, ongoing conflict with smaller factions in the region has led to calls for recognition to be rebuffed. In the south, Aidid's SNA and Mahdi's "Group of Twelve" emerged as the most powerful factions. Aidid's group is based in South Mogadishu and Mahdi in North Mogadishu. On 1 August 1996, Mohammad Fara Aidid was killed in an ambush, and leadership of the SNA was taken over by his son Hussayn Muhammad Aidid—himself a former corporal in the U.S. Marines. Despite numerous assassinations within both camps, large-scale confrontations have been few. Hussayn Aidid did not, though, attended peace talks sponsored by the Arab League in Djibouti and Yemen. Rather, he repeatedly alleged that the UN and other groups are supplying his enemies. Mahdi, in turn, has stated that Aidid is receiving military aid from Libya and Sudan.
Northeastern Somalia, under the leadership of Colonel Abdullahi Yusuf, formed its own government called the Puntland regional government. Abdullahi was deposed in 2001 by a council of tribal leaders, a decree Adbullahi refused to recognize. Military supporters of his then declared a separate state within the statelet of Puntland. In 2002, Yusuf was attempting to regain power, and had won major battles against his rival for the Puntland presidency, Jama Ali Jama.
Efforts at mediation of the Somali internal dispute have been undertaken by many regional states. Ethiopia has played host to several Somali peace conferences and initiated talks at the Ethiopian city of Sodere, which led to some degree of agreement between competing factions. The governments of Egypt, Yemen, Kenya, and Italy also have attempted to bring the Somali factions together. In 1997, the Organization of African Unity (from 2002 known as the African Union) and the Inter-Governmental Agency on Development (IGAD) gave Ethiopia the mandate to pursue Somali reconciliation but with little success. During the early months of 2000, the Djibouti government attempted to bring together 50 Somali scholars and elders to work out modalities and procedures for the establishment of a national Somali government. In August of that year, a Transitional National Government (TNG) was established, led by Hassan Salat Abdiquassim (replaced in 2002 by Hassan Abshir Farah) and given a three-year mandate to create a permanent national government.
The TNG holds Somalia's seat at the UN and is recognized as the official government of Somalia by the African Union, but few nations outside of the area recognize its legitimacy. After the terrorist attacks on the United States in September 2001, U.S. government and military personnel visited Somalia and Ethiopia, the major power broker in the area, to see if there were any terrorist organizations in the country that might have links to organizations implicated in the attacks on the United States. News reports at the time implied that U.S. special forces were in the area actively looking for such organizations, but there was no official confirmation of any such activity. Subsequently, the U.S. government closed down the Al-Barakaat group in Somalia, which had been the largest employer in the country, with operations involved in money transfers, telecommunications, and soft drinks. The U.S. accused Al-Barakaat of having links with terrorism, although the group has denied that charge.
In April 2002, the Rahanweyn Resistance Army (RRA) in Baidoa announced the formation of an autonomous "Southwest State of Somalia," making it a third separatist region in Somalia (in addition to Puntland and Somaliland). As of the end of 2002, hundreds had been killed and thousands displaced by fighting between the forces loyal to RRA chairman, Hasan Muhammad Nur Shatigadud, and two of his deputies, Shaykh Adan Madobe and Muhammad Ibrahim Habsade.
The president of Somaliland, Muhammad Ibrahim Egal, died in May 2002. He was replaced by his vice president, Dahir Riyale Kahin, in a peaceful transfer of power. Somaliland remained something of a haven of stability in 2002–03, as local elections were held in December 2002, and presidential elections were held on 14 April 2003. Kahin's challengers in the elections were Ahmed Muhammad Silanyo of the Kulmiye (Solidarity) Party, and Faisal Ali Warabe of the Justice and Welfare Party. Kahin won 205,595 votes, or 42.08% of the total, to Silanyo's 205,515 votes (42.07%), a difference of 80 votes. (Warabe came in third with 15% of the vote.) The Kulmiye Party did not recognize the results of the election as being free and fair. The breakaway province of Somaliland is not recognized by a single country, but is considered to be the only responsibly governed area of the country.
Elsewhere in Somalia, however, Islamic courts have been created to deal with lawlessness. Due to the efforts of these courts, security has improved significantly and law and order in some parts of the country, particularly Mogadishu, have seen periods of civil order.
A peace conference held under the auspices of IGAD was established in the Kenyan town of Eldoret on 15 October 2002, in an effort to bring about reconciliation between the TNG, factions opposed to it, and the regional administrations of Puntland and Somaliland. All groups agreed to suspend hostilities for the duration of the talks. In December 2002, the TNG and five Mogadishu-based factions agreed to a ceasefire; however, that ceasefire was broken in early 2003.
In April 2003, the prime minister of the TNG, Hasan Abshir Farah, denied that there was a split between him and TNG president Hassan Salat Abdiqassim. Despite disruptions, the Eldoret peace talks continued in mid-2003, with all parties discussing the core issues of federalism, disarmament, conflict resolution, economic reconstruction, and land rights.