The first mistake was to announce their arrival too far in advance of the first marine landings. This gave time for Somali armies and gangs to move their fighters and weapons out of Mogadishu and hide them. This mistake was compounded by a delay in the arrival of the marines and the abandonment of the original plan to take over several key points simultaneously. Instead, the Marines piled ashore at Mogadishu, established a beach-head and fanned out. By this time most of the serious guns were over the horizon or even the Ethiopian border.
Secondly, the Americans' stated aim was to create a safe environment for food relief. In fact they were taking over a country. Their brief fell far short of what was expected by Somalis or what was needed. The Somalis backed off in the face of US firepower but in military terms, all the Americans achieved was the ending of the toll system, whereby food relief was taxed, blocked or stolen by the warlords.
The key question of disarmament was left unanswered. Robert Oakley, the US special envoy in Somalia, argued it would be too imperialistic and might cost US lives. As soon as the Americans were replaced by soldiers who were neither feared nor respected by the Somalis, the guns returned.
Mr Oakley then made the third mistake, which was to court General Mohammed Farah Aideed and the other warlords. Mr Oakley was escorted from the airport when he first arrived by General Aideed's fighters, and moved into a house opposite the general's residence and under his control.
The only public warning Aideed received was in the form of two Cobra helicopters, which circled his house for an hour on the eve of the invasion. His response was to welcome the Americans ashore. What Somalis saw was Mr Oakley and Aideed shaking hands.
Many non-combatant Somalis argued that warlords and murderers had to be marginalised or destroyed before a new leadership could emerge in Somali society. They said the warlords' power was purely military and that Mr Oakley's attempt to turn Aideed and his rival, Ali Mahdi Mohammed, into politicians, was doomed.
The fourth mistake compounded them all. On 4 May the US pulled out the main force - too soon. Many believed last December that George Bush needed a glorious military display before he left office and that once the television cameras had gone the Americans would leave. They were not prepared to risk American lives to solve the problem.
Political progress is still minute and, as has been proved, vulnerable to a sudden flare-up. Mr Oakley spoke of peace on the streets and a new breed of leadership and a police force emerging, but he and his masters in Washington were not prepared to stay until this happened.
When they left, the only crucial question - who was to be master of Somalia - lay unanswered. In public, Washington said that was down to the Somalis to sort out and the UN to manage. In private, US officials admitted the Somalis were still at war and the UN was not competent to manage Somalia. Yet still they pulled out. It will take years for a new Somali leadership to emerge and gain enough respect to rule the country. In the meantime, the warlords must be destroyed or contained. The Americans failed to do this, which is why they are back.
And they have returned in such a way that no outside force will be able to remain in Somalia by consent. If the UN stays on, it will do so as an army of occupation.