Largely forgotten since the days of Black Hawk Down, Somalia was back in the news this week. The “interim government” appealed for international assistance against its “Islamist” opponents: to “protect the region from the expansion of this al-Qaeda network, these terrorists.”

Somalia has been without a functioning government for 15 years; the interim government, a makeshift alliance of warlords, controls only one major town, Baidoa. The rest of southern Somalia is mostly in the hands of the Union of Islamic Courts (UIC), which took the capital, Mogadishu, back in June. (Northern Somalia is either largely or entirely independent.)

The interim government and its supporters are trying to paint the UIC as another Taliban and themselves as the last line of defence against terrorism. The media seem to have swallowed their line. But by supporting them, the west risks repeating the same mistakes it has already made across much of the middle east.

American policy has been confounded by the fact that when democracy has been given an opportunity in the middle east it has often resulted in gains to Islamic extremists – in Egypt, Iran, Lebanon and the Palestinian territories. It fails to realise that voters flock to these parties not because they support religious fundamentalism (much less terrorism), but because of their promise of clean government, democratic reform and national independence.

Sure enough, that’s proving to be the big attraction of the UIC in Somalia as well. Residents of Mogadishu don’t want a Taliban-style government, but they applaud the return of law and order and functioning public services. The “interim government” has done itself particular damage by its willingness to accept help from Ethiopia, Somalia’s hereditary enemy.

When the UIC took Mogadishu, the local BBC editor said that “if they are viewed as a hotbed of Islamic extremism, that too, could become a self-fulfilling prophecy.” Disaster looms if his warning is not heeded.