For Brown has already reassured the United States he will do no such thing. I'm told by a high-ranking Bush administration official that Brown has used "multiple channels", including meetings between defence secretary Des Browne and his US counterpart Robert Gates, to reassure the Americans that no surprises are on the way. After the "drawdowns" that have already been announced, any further British moves will be "conditions-based" - dependent on the situation on the ground - and taken only in consultation with Washington. Brown said as much when he met Bush face to face in April, my source hints. Of course, that still leaves plenty of wriggle room if Brown decides to make a hasty exit. He could simply tell Washington the "conditions" have changed. But for now, the Americans are happy - and Labour's antiwar left is set to be disappointed.

Still, there could be a much graver blow to come, as Iraq and Afghanistan come to look like the relatively simple files in Brown's foreign policy in-tray. Knottier and more urgent will be the one marked "Iran". The evidence is mounting that Brown could suffer the turmoil that came to define his predecessor - and be asked by a US president to join in a military adventure.

Already audible are the throbs of a political drumbeat. All the frontline US presidential candidates, from both parties, are united in their refusal to take "the military option off the table", in the words of Barack Obama. Despite what you might expect to have been the chastening experience of Iraq, there's jockeying to strike the toughest, most hawkish pose on Iran. Hillary Clinton talks of the country's "malevolent influence", while Rudy Giuliani said last week that Iran has to know its nuclear ambitions are unacceptable to the US: "I think it could be done with conventional weapons, but you can't rule out anything." In other words, the current Republican frontrunner for the US presidency is considering a nuclear strike against Tehran.

Other rumblings are just as telling. On Sunday Senator Joe Lieberman suggested "aggressive military action" against Iran, to punish it for training Iraqis to kill American soldiers. At the Hay festival last month former Pentagon adviser and super-hawk Richard Perle talked openly of bombing Iran, offering a clue as to timing: the US would wait till it had fewer troops in Iraq, so denying Tehran an easy target for retaliation.

Now Perle is not as tightly woven inside the loop as he once was; many of his neocon comrades have fallen by the wayside. But his predictions are worth taking seriously. I remember visiting him in Washington the day Kabul fell, in November 2001. Matter-of-factly he made clear that Washington's next target was Saddam Hussein. And so he was.

The military clues are harder to detect. Veteran analyst Dan Plesch of the School of Oriental and African Studies wonders why the US is strengthening airbases in Afghanistan, Kurdistan and Iraq, forming a ring around Iran: "You don't need air power to fight the insurgency, do you?" It has to be preparation for an attack on you-know-who. He also notes the two or three US expeditionary strike forces in the Gulf, each one with an aircraft carrier twice the size of the Ark Royal. Iran's neighbours certainly reckon something is up. This week Kuwait's defence minister said he would not allow the US to use his country's territory to attack Iran, and other Gulf states have made similar noises. They wouldn't be saying that if they thought the prospect was purely hypothetical.

US officials deny all this, of course. Every effort is on the diplomatic track, they say. Besides, military action is a "pretty stressful" option, according to one US source, given the workload in Iraq. There are two reasons why that's not so reassuring. First, no one is imagining a massive ground invasion of Iran; that would indeed be impossible given the overstretch in Iraq and Afghanistan. Any attack would surely be an aerial bombardment of thousands of nuclear and other military, political and infrastructural sites in Iran. That could be over in four nights, like the 1998 Desert Fox pounding of Iraq, or several weeks, like the Nato assault on Serbia and Kosovo. Second, cynics will remember being reassured in 2002, not least by Tony Blair, that no decisions for war in Iraq had been taken. Nevertheless, war followed.

Why would military action be a bad idea? It should be obvious that if, as Blair insists, this is a battle for hearts and minds, then yet another western hammering of a Muslim country would lose hearts and minds by the million. Jihadism would open its arms to legions of new recruits, flooding to its banner from all over the world. Iran itself would hit back whichever way it could, whether unleashing its proxy Hizbullah against Israel or firing missiles at the country directly, as well as at US bases in the Gulf states.

Tehran would surely activate sleeper cells around the world, ready to hit American, British or Israeli targets in an all-out, worldwide asymmetric war. (One Arab analyst cites the 1988 Lockerbie bombing as a precedent - revenge, he believes, for the US downing of an Iranian passenger jet earlier that year.) Of course, US troops in Iraq would be the immediate object of Iranian ire, suddenly facing Iran's Shia allies bent on a lethal vengeance. Instead of exploiting the Sunni-Shia rift through artful diplomacy to isolate Iran, bombing Tehran would heal that divide: Muslims of every strand would unite behind their new Iranian champion.

Yet the dangers of a nuclear Iran are real too. Egypt and Saudi Arabia would feel compelled to match Tehran, so triggering a nuclear arms race in the most combustible region on earth. Israel would feel the menace most keenly. As even al-Ayyam, the Palestinian daily, conceded yesterday, "the Jewish state would face a mortal threat to its very existence".

So how to stop this peril, without resorting to reckless violence? The answer, of course, is muscular diplomacy, though with more creativity than one might imagine. One former Israeli cabinet minister calls for greater attention to Russia. With its security council veto, Russia needs to be won over to the cause of thwarting Tehran. If that means giving Moscow what it wants in other areas - say, smoothing Russian admission to the World Trade Organisation - those are surely prices worth paying. A smart divestment campaign, urging western pension funds and financial houses to disinvest from companies trading with Iran, could hurt those in charge too.

There are solutions here, but Washington will need persuading. This could turn out to be the prime task of Gordon Brown's foreign policy - to prevent a Gulf war devouring him the way it devoured his predecessor.

freedland@theguardian.com