There have been many battles of Mogadishu. Somalia is not really a nation-state in the western sense, and never has been. It's more like a political black hole into which numerous failed polities have fallen. Violence has been a constant instrument of rule in that country, and struggles for power have often disproportionately affected the capital city. It all really kicked off just under twenty years ago.
End of the Cold War
In the dying days of the Cold War, Somalia was ruled by a dictator called Siad Barre. His regime had been faced with a triad of insurgent movements since defeat in a war with Ethiopia in 1977, and in 1988 the central state launched a counterattack which touched off a civil war. This came at a particularly inapposite time for Barre, who was denied aid by the United States when rebel forces threatened the capital. The U.S. Congress demanded that he instead seek political reconciliation, something which his enemies understandably weren't interested in. Because the Cold War was over, the Americans no longer really had any need for this dictator, and so he was allowed to fall from power.
Barre had to flee in 1991, but that was when things really started to get bad for the residents of Mogadishu. Because there was no effective mechanism for deciding who would take over, and the Somalis had no tradition of nationwide governance, the rival insurgent movements instead turned to battling one another. Whether one dictator is really an inferior option to several wannabes who will lay waste to a country in pursuit of their goals is a puzzle that it might have done well for the U.S. to cogitate on prior to invading Iraq. The realization of this situation for Somalia was certainly nothing less than a disaster.
Law and order in Mogadishu totally broke down as a result of Barre's overthrow. The two main factions were led by Mohammed Farah Aideed and Ali Mahdi Mohammed, who each controlled half of the Somali capital and fought for the other half. Even when they nominally declared a ceasefire in February 1992, this did little to impact the security situation on the ground. The wide proliferation of weapons and loose control structures meant violence continued; some 100,000 light weapons had been seized from Barre's arsenal in Mogadishu, and armed gangs now used them to extort aid supplies.
As a result, food was not reaching the most vulnerable members of the Somali population. Aid in warehouses in Mogadishu was unable to be removed and taken across the country to where it was needed. According to the Red Cross, one million of Somalia's pre-war population of seven million had been killed by December 1992. The chaos which had been engendered had also disrupted the normal agricultural rhythm of the country, and food output was expected to dwindle to fifty per cent of usual levels; hence international assistance was severely needed to redress the deficit.
In April 1992, United Nations Operation in Somalia I (UNOSOM I) had arrived to try and protect food deliveries. Unfortunately, the operation was about as effective as its title was imaginative. The UN force had strict rules of engagement and relied on the consent of the factional leaders to deliver food; sadly they were more interested in extorting it. One contigent of Pakistani peacekeepers had to spend their entire tour of duty sat in Mogadishu airport because they were too afraid to leave. The situation finally reached rock bottom in November 1992 when Aideed demanded that UN peacekeepers leave.
In that same month, President George H. W. Bush made an unprecedented decision. He said that the U.S. would send tens of thousands of troops to Somalia to ensure the delivery of food supplies, so long as the UN Security Council would authorize their use of "all necessary means" (i.e. guns) in pursuit of this goal. The U.S. decision was reached for a number of reasons. Bush saw it as an opportunity to showcase U.S. capabilities and intent in the "New World Order" he'd been going on about, because only the U.S. had the military capability to carry out this operation in an acceptable timeframe. The military agreed to it because they believed that the operation would be manageable and might help them avoid what was likely to be a much more complicated and costly involvement in Bosnia.
UN Secretary-General Boutros-Boutros Ghali wanted the new mission, which was called UNITAF, to begin a process of state-building, whereas American officials imagined a much shorter deployment.1 President Bush initially hoped the troops could be pulled out as early as January 19, 1993 (just before he left office). He literally wanted them to go in, deliver a bunch of food, and then leave: his mission amounted to little more than temporary relief of the country's symptoms, not its underlying disease. However, when the Clinton administration took over, it was much more willing to expand the mission to include state-building. The words "rebuilding" and "reconstruction" got thrown about a lot, but they weren't really appropriate because there had actually never been a Somali state to begin with. Hence, the U.S. had taken on a colossal task.
The transition to the state-building force took place in May 1993 with the creation of UNOSOM II (guess what it stands for).2 Yet this expanded mission was to be taken on with a much smaller force than the relief effort had enjoyed the use of, and the troops available were generally of a lower quality. While there had been some 25,000 U.S. troops in-country during UNITAF, there were only 4,000 involved in UNOSOM II (and a 1,200 strong Quick Reaction Force sat offshore). I'd like to say that this horrific match-up of the means-to-ends ratio was a peculiar disease of the Clinton administration, but sadly the declaration of fantastic goals which can't possibly be reached with the means available has been a permanent feature of U.S. foreign policy after the Cold War.
Mogadishu continued to be a battleground, now between international forces and Mohammed Farah Aideed. Aideed had emerged as top dog in Somalia, and he was no longer particularly interested in the UN presence. Aideed's militia attacked peacekeepers from various countries, and he quickly came to be seen as the primary obstacle to the development of state structures in Somalia. Administration officials started to talk bullishly about getting him "removed from the equation", as if this would solve Somalia's problems. It might have been a start, but the U.S. still didn't possess any concrete plan for what to do next. They instead focused on killing or capturing Somalia's bad guy.
Then, in October, a target of opportunity presented itself. The U.S. command believed it had learned Aideed's location, and sent in a force of Army Rangers and Special Forces to pick him up; they instead found a number of his lieutenants at the location, and suffered heavy casualties while withdrawing. Because the deployment to the country had been on such thin ice politically, this merely tactical setback was transformed into a strategic calamity; the mission was over. Although U.S. forces remained in the country until March 1994 and their numbers were increased considerably after the Battle of Mogadishu, this was merely for the purpose of saving face; no expansive goals were being sought anymore, and attempts to build a Somali state were over. U.S. forces idled away their time or tried to move mountains with teaspoons until they were withdrawn, much like British forces in southern Iraq today.
The consequences for Somalia were dramatic. After U.S. forces left, the entire UN mission called it a day soon after. Somalia continued to possess no effective state, and became a battleground between competing militias and regional powers. Many more people in Mogadishu and the country as a whole would die as more battles occured: firstly the chaos of no rule, then the takeover by the Islamic Courts Union, and then its ejection by Ethiopian forces.
The consequences for global peacekeeping were also dramatic. Peacekeeping is the sort of thing that sounds great but nobody really wants to do, and so hardly anyone ever does properly. Even the half-hearted Clinton administration attempt to build a Somali state was not likely to be repeated any time in the near future; indeed, it hasn't been to this day. The U.S. debacle in Mogadishu had a direct impact on the U.S. response to events in Burundi and Rwanda soon thereafter, providing yet more evidence for those who wished to argue that intervention would be disastrous and might even have perverse consequences for the target country.
The U.S. intervention in Somalia was pregnant with many lessons. The first of these was how difficult it is for outsiders to build democratic state structures in a country with no tradition of them, even when that country has Somalia's remarkable ethnic homogenity. The second is the sensitivity of democracies to relatively small numbers of casualties, especially when the mission is not considered a vital national interest. If you're going to enter into an incredibly dangerous mission with a tenuous chance of success and then leave as soon as a few dozen soldiers get killed, why bother launching the mission in a first place? The lives of these brave soldiers and the unfortunate Somalis who got in their way will have been spent in vain if they do not serve as a lesson that if we're going to get involved in peacemaking, we need to do so seriously. Let's not sacrifice any more lives on the altar of wishful thinking.
1. "UNITAF" is a nice bit of linguistic juggling. It stands for "Unified Task Force" and so avoids mentioning the United Nations. This was useful because many Americans were suspicious of the world body and certainly did not want their troops to be under UN command (which they weren't: this caused problems later on). But as an acronym it sounds like any other United Nations mission.
2. The Clinton administration was much less concerned about referring to the United Nations; in fact, the world body was central to their foreign policy. These were the days when "assertive multilateralism" was Washington's favourite catchphrase, and Clinton officials often talked about the UN to a pathological extent. For instance, although they continued to insist that U.S. forces not be under UN command in Somalia (hence making co-ordination between forces difficult), they continually referred to the "UN operation" and "UN mission", hence failing to capitalize on their position in domestic debates because nobody realized that U.S. forces were not under UN control.
More to read
The best source is probably John L. Hirsh and Robert B. Oakley, Somalia and Operation Restore Hope: Reflections on Peacekeeping and Peacemaking (Wahington, D.C.: Institute of Peace, 1995). Madeline Albright with Bill Woodward, Madam Secretary (New York: Miramax, 2003) and Bill Clinton, My Life (London: Hutchinson) give insider perspectives, although the latter shows about as little interest in the issue as Clinton reportedly did at the time. My figures on deaths/food come from Jonathon Stevenson, "Hope Restored in Somalia?" from Foreign Policy no. 91 (Summer 1993).