This week General David Petraeus and ambassador Ryan Crocker have been in London, trying to persuade Britain not to pull all its troops out of Iraq. Last week they were in Washington, trying to persuade Congress and the American public. Strip away a rather thin coat of gloss paint and you do not find Petraeus and Crocker arguing that things will be good in Iraq if we stay. Rather, they argue that things will be even worse in Iraq if the occupying forces precipitately and completely withdraw.

Now it is entirely possible to maintain, as I do, that Iraq is Britain's biggest foreign policy disaster since Suez, and America's biggest since Vietnam, yet still conclude that the two emissaries may be right. That's what happens when you make big mistakes: you end up with lousy choices. We all know the counter-arguments. Morally, we have no right to be occupying someone else's country; militarily, our forces have become part of the problem, not the solution; politically, the best chance of a settlement is to leave the Iraqis to sort it out among themselves. That's also what some politicians in Washington say, eager to find a high-minded justification for advocating what is most likely to get them re-elected.

But is it true? Discount Petraeus and Crocker, if you will, on the grounds that "they would say that, wouldn't they?" Listen, however, to George Packer, one of the best and most critical journalists to report from Iraq, writing in the latest New Yorker. American troops in Iraq, Packer concludes, have come to be a brake on the violent forces which they themselves unleashed through the war and bungled occupation. "America's diplomatic leverage will be weakened by a withdrawal, and Iraq's predatory neighbours will take advantage of the power vacuum to pursue their own interests. Even if regional interference doesn't take the form of Saudi troops crossing the border to defend their Sunni brothers, Iranian Revolutionary Guards infiltrating Iraq to secure Shi'ite power, and Turkish forces entering Kurdistan to prevent it from becoming independent, the combined effect of proxy fights, irregular incursions, and increased refugee flows will likely roil the Middle East for years."

Packer goes on to quote the British academic Toby Dodge, a critic of the original invasion. If American troops depart, he says, they will leave behind "a free-for-all where everyone will be fighting everyone else - a civil war that no one actor or organisation will be strong enough to win ... So if you and I were mad enough to jump in a car in Basra - pick a date, 2015 - and we tried to drive to Mosul, what we'd be doing is hopping through islands of comparative stability dominated by warlords ... Those fiefdoms will be surrounded by ongoing violence and chaos. That looks a lot to me like Afghanistan before the rise of the Taliban. Or Somalia. That's where Iraq goes when Americans pull out."

These are the views of two independent analysts who know the realities on the ground. Others disagree - but these warnings should at least make us pause before rejecting out of hand what Crocker and Petraeus are asserting. The leader of the Liberal Democrats, Sir Menzies Campbell, says Britain has "fulfilled its moral obligation to Iraq" and should pull out completely. I find this a strange argument. I would say we failed in our moral obligation to the people of Iraq by not warning the United States forcefully enough about the likely consequences of invasion. Having gone along with it, our primary moral obligation is surely to minimise the subsequent and consequent harm to innocent Iraqis. If it is true that precipitate and complete withdrawal would escalate the civil war, increase the likelihood that Iraqis who have worked with occupying forces (sometimes in the genuine hope of building a secular, democratic Iraq) would be killed, and push up the number of refugees from an already horrendous figure of around 4 million externally and internally displaced, then our moral obligation is to prevent that further deterioration.

To be sure, the direct, practical effect of the few thousand British troops remaining at the Basra airfield will be small. So far as I can gather, what the Americans would ideally like the British to do is to help secure their vital supply lines from the south of the country, maintain some capacity to intervene when internecine clashes get completely wild, continue to train the Iraqi military and police, and sustain some little-publicised intelligence-gathering and special forces operations.

According to British sources, Britain seems likely to relinquish the first two of these roles in the course of next year, while bringing its troop numbers down from 5,500 to 3,500 - and below. There remains an important symbolic difference between this and total pullout, with a potentially significant impact both inside Iraq and abroad.

The main issue, however, is the American forces. For all the impatience in Congress, and the country at large, the reality is that there will probably still be some hundred thousand American troops in Iraq when the next US president takes office early in 2009. Won't their continued presence merely prolong the agony? The case can be made - and certainly the American military are the very last people to claim that there is a military solution to Iraq. But the argument for a slower drawdown of forces is that it would give a chance to a kind of politics that has thus far hardly been tried: the politics of regional negotiation and broader international involvement.

There will be a conference of the major regional actors in Istanbul at the end of next month. It is just possible that Turkey, Saudi Arabia and Iran will conclude that their own, separate and conflicting interests are all best served by an Iraq that stays together in a kind of precarious, artificially sustained stalemate, under the woolly auspices of the UN - a weak, divided country in which the neighbours all have a hand, but none the upper hand. Since they distrust each other as much or more than they distrust the US, they might even accept a long term American military and political presence as a minimal guarantee that no party to the conflict would reach for domination or, in the case of Iraqi Kurdistan, full independence.

This may be whistling in the dark but, given the grim alternatives, it's surely worth a try. The neighbour least likely to cooperate is, of course, Iran. The regional negotiation around Iraq is infinitely complicated by the simultaneous attempt to prevent Iran acquiring the capacity to make nuclear weapons. In Washington earlier this month, I was assured by several very well-informed observers that, despite all the contrary advice they are receiving, President Bush and vice president Cheney may still decide to bomb Iran before they leave office. This is a danger that President Nicolas Sarkozy is attempting to head off by his tough talk and proposal for stronger European sanctions: a French preemptive strike, so to speak, against the possibility of an American preemptive strike.

So the challenges of Iraq and Iran are closely linked. After the twin towers, they are the twin nightmares. The nightmare in Iraq is very far from over, while that over Iran has barely begun. They will be disturbing our sleep for many years to come.