As President Bush prepares to leave office, the pundits will start to produce their balance sheets. It is hard to know what they will list under “achievements”, but easy to predict their “disasters”: Iraq, Afghanistan, economic meltdown, soaring debt and America's loss of global stature.
One other debacle should feature prominently in that second column, but probably won't because it has occurred in a faraway country that most Westerners know only through the film Black Hawk Down - or from recent reports of rampant piracy including the seizure early on Sunday of a Saudi tanker, carrying more than two million barrels of oil, which had an immediate effect on crude prices.
I am referring to the Bush Administration's intervention in Somalia in the name of the War on Terror. It has helped to destroy that wretched country's best chance of peace in a generation, left more than a million Somalis dead, homeless or starving, and achieved the precise opposite of its original goal. Far from stamping out an Islamic militancy that scarcely existed, the intervention has turned Somalia into a breeding ground for Islamic extremists and given al-Qaeda a valuable foothold in the Horn of Africa.
Rewind to the early summer of 2006. For 15 years, since the fall of the dictator Mohamed Siad Barre, feuding warlords had made Somalia a byword for anarchy and terrorism - the archetypal failed state. A tenth of its population had been killed. A million had fled abroad. At that point the warlords were finally routed, despite covert CIA backing, by a remarkable public uprising in support of the so-called Islamic Courts movement that promised to end the lawlessness.
Somalia had always practised a mild form of Islam, but the Courts received a bad press in the West, being widely portrayed as a new Taleban determined to impose the most draconian forms of Sharia on a terrified populace. That was certainly what I expected when I visited Mogadishu in early December 2006. But what I actually found was a people still celebrating the return of peace and security.
Gone were the checkpoints where the warlords' gunmen extorted and killed. Gone were their “technicals” - the Jeeps with heavy machineguns on the back with which they terrorised the citzenry. For the first time that most Somalis could remember, they were walking around their shattered capital in safety, even at night. Businesses were reopening. Exiles were returning. Mountains of rubbish were being carted away.
“It's like paradise compared to even one year ago,” according to Mohammed Ahmed, a doctor who had returned from working at the West Middlesex Hospital.
The Courts had certainly imposed what would be seen in the West as some fairly repressive moral codes. They cracked down on the narcotic qat that rendered half the menfolk senseless, banned sexually explicit films, encouraged women to cover their heads and discouraged Western music and dancing. There had been two public executions. But that was a price most Somalis were happy to pay, and while the Courts' disparate factions undoubtedly included extremists with dangerous connections and intentions, they also included moderates with whom the West could have done business.
European nations favoured engagement. Washington did not. It accused the Courts of harbouring the al-Qaeda terrorists responsible for bombing US embassies in Kenya and Tanzania in 1998. The Courts hardly helped their cause by claiming territory in Kenya and Ethiopia.
Weeks after my visit the US supported - morally, materially and with intelligence - an invasion by predominantly Christian Ethiopia, Somalia's oldest bitter enemy. That replaced what was, for all its faults, Somalia's most effective government in memory with a deeply unpopular one led by former warlords, which had been cobbled together by the international community in Nairobi two years previously.
“The Americans see an extremist under every Muslim stone,” one European official complained bitterly, and the consequences were entirely predictable. An insurgency that began early in 2007 has steadily gathered strength, while the reviled Government in Mogadishu has come to depend utterly for its survival on thousands of Ethiopian troops that were meant to withdraw within weeks.
As the fighting has worsened 10,000 Somali civilians are thought to have been killed, more than a million have fled their homes, and more than three million - 40 per cent of the population - now urgently need humanitarian assistance. Although the UN World Food Programme is still getting some aid into the country the situation is deteriorating and scores of humanitarian workers have been killed or abducted. Exploiting the lawlessness, pirates have turned the waters off Somalia into some of the most dangerous in the world.
In Kenya last weekend Abdullahi Yusuf, Somalia's President, finally admitted that insurgents now control most of the country and have advanced to the very edge of Mogadishu. His Government, he said, was close to collapse.
There are several insurgent forces, but one of the most powerful is the Shabab - a group of virulently anti-Western jihadists that has now eclipsed the Islamic Courts movement of which it was once part.
Somalia's nightmare may be only just starting. President Yusuf predicts wholesale slaughter if the Shabab seize Mogadishu. Diplomats fear that the Shabab will wage all-out war with other insurgent forces, including those of the Islamic Courts, for control of the country once Ethiopian troops - the common enemy - are withdrawn.
And unlike the Courts, the Shabab has no truck with moderation: in the port city of Kismayo last month a young girl who complained that she had been raped was stoned to death for adultery, while in Balad two dozen Somalis were flogged for performing a traditional dance.
Whatever happens, Somalia will be another horrendous legacy for Barack Obama, but somewhere on the Afghanistan-Pakistan border one man will be celebrating. Shabab openly supports al-Qaeda. It has adopted suicide bombings and other tactics. “Al-Qaeda is the mother of the holy war in Somalia... We are negotiating how we can unite into one,” Muktar Robow, a leading Shabab commander, recently told the Los Angeles Times. “We will take our orders from Sheikh Osama bin Laden because we are his students.”
All in all, hardly a resounding triumph for the War on Terror.