When you are in a hole, stop digging. That is the maxim that should now be applied to the war in Iraq. All of my life I have watched as Britain and America have become embroiled in conflicts, only to find that a purely military solution is rarely available. But the situation in Iraq is turning into something more unpleasant than anything since the war in Vietnam.
The grisly state of affairs in Iraq is creating pressure for two radically opposed alternatives. One is to increase the number of British troops; that is, dig a deeper hole. The other is to withdraw British and US forces. But the more it goes on, the clearer it is to me that we must withdraw.
The images of torture by US forces and the worsening security situation are not short-term aberrations - they are the outcome of the wrong policy. The core of what is happening is that without lawful international support, neither the international community nor the Iraqi population will regard US and British troops as a legitimate force.
It is not clear what proportion of Iraqis sympathize with the current armed resistance to US and British forces. But the great majority of Iraqis are clearly not prepared to cooperate in giving information to an occupying force. Without such intelligence, US and British forces are unable even to anticipate and prevent assaults on themselves, let alone defeat those staging them. What appears as a security problem is, in the end, political. All attempts to find substitutes for political legitimacy will not work and will make matters worse.
The first US attempt to bludgeon its way out of the problem of political legitimacy was the massive military action in built-up areas such as Falluja - all guns blazing but wearing a blindfold. The effect was to drive wider layers of the population into opposition to the US presence.
Starting attacks on civilian areas with limited information, only to curtail or abandon them, was a policy bound to leave the militants strengthened. In the Shia south, only a few months were required to transform Moqtada al-Sadr from a marginal figure into one with significant minority support.
When information is not forthcoming, the only way to try to get it is to beat it out of people. That is the logic that has led to the horrific scenes in Abu Ghraib. Hiding the torture won't work and will not ease the security situation. The truth will just leak on to TV screens and the internet.
The efforts of the Bush administration to square this circle through the transfer of some power to an unelected Iraqi administration on June 30 will fail. The US will retain real control of security. No Iraqi administration that does not control the security forces is "sovereign", nor will it be seen as such. Attacks on US and British troops will continue. Measures to stop them will further alienate the population.
The Lib Dems, who opposed the war before it started, have flirted with the idea for more than a year that more troops should be sent. I hope they conclude that there is no military mechanism that can solve this political problem. Security cannot be achieved until Iraqis are convinced that they have a legitimate administration and security forces. Only elections will deliver this. The most rapid possible timetable for elections, not the chimera of military solutions, must be the British policy in Iraq.
While elections are being organized, the UN should take charge of all foreign security forces in Iraq. The main political organizations in Iraq would have an entirely different attitude to a UN-commanded force than the current US-led one, isolating those engaged in military actions. This would also have the welcome effect of widening the Iraqi administration, which ought to be restructured to take this into account.
In principle, US and British troops could be transferred to such a UN command. But the US has always refused to put its troops under UN command. US and British troops are now compromised in the eyes of the population. The only way forward is to transfer command of security operations to the UN and announce the progressive withdrawal of US and British troops.
The Iraqi administration, working with the UN, would be responsible for deciding what security measures, what combination of internal, UN and neutral foreign forces, it wished to maintain during the transition. This might well mean temporarily replacing departing British and US troops with those from members of the Arab League - which are more likely to be seen as neutral by Iraqis.
This is literally a life-and-death matter for British soldiers and Iraqi civilians. The policy we are pursuing cannot succeed and it will remain far worse for everyone involved, not just the Iraqis, than the earliest possible withdrawal of British forces from Iraq.
· Ken Livingstone is the London mayor
© Guardian Newspapers Limited 2004