==========================================The decision to impose an EU oil embargo on Iran, agreed on Monday by European foreign ministers, sets a potential bomb ticking, timed to detonate on 1 July.

On that day, according to the package of measures on the table in Brussels, Europe will stop importing oil from Iran, about a fifth of the country's total exports. At about the same time, US sanctions targeted at the global financing of Iran's oil trade will also kick in. Iran could still export some of its oil to Asia, but at big discounts.

Unlike previous sanctions on Iran, the oil embargo would hit almost all citizens and represent a threat to the regime. Tehran has long said such actions would represent a declaration of war, and there are legal experts in the west who agree.

The threat of an immediate clash in the Gulf appeared to recede over the weekend when the USS Lincoln aircraft carrier and its task force, including the British frigate HMS Argyll and a French warship, travelled through the strait of Hormuz without incident. This was despite warnings earlier this month from the Iranian Islamic Revolutionary Guard Corps (IRGC) that it would oppose the return of a US carrier to the region.

But tensions are almost certain to build again as the effective date of the oil sanctions approaches. The US has already begun beefing up its military presence in the region, and the IRGC is planning new naval war games next month. Rear Admiral Ali Fadavi told the Fars news agency earlier this month that the upcoming exercises, codenamed "the Great Messenger", would be different from previous war games, without going into detail.

Iran's oil supply

The strait of Hormuz is the kink in the hose of the Gulf's oil supply to the world. A small amount of pressure can have a disproportionate effect, sending world crude prices soaring and starving the world's oil-dependent economies.

At its narrowest point, between the Oman peninsula and the Iranian islands off Bandar Abbas, the strait is 20 miles wide, but the channels down which more than a third of the world's ocean-borne oil flows – 17m barrels – are even more tenuous. The tanker lanes going in each direction are just 2 miles wide in parts, through the deep water off Oman and then again, further west, inside Iranian territorial waters.

This is where oil tankers are most vulnerable to an Iranian attempt to turn off the global petrol pump. It was enough for an Iranian official to simply raise the prospect of closing the strait, in retaliation for the threat of sanctions, for the world price of crude to rise to $115 (£74) a barrel. Maintained over the long term, that is costly enough to strangle any hint of a global economic recovery.

That is what makes Iranian naval action in the Gulf such a potent weapon. But it is a decidedly double-edged one, potentially more lethal to Iran than its adversaries. For, while Saudi Arabia can bypass the strait by pipeline, all of Iran's oil terminals are west of the choke point. Iran would cut off its own lifeblood, which accounts for more than 60% of its economy.

Furthermore, the US has made clear that interruption to sea traffic in the Gulf would be a "red line", triggering an overwhelming military response in which Iran's nuclear facilities would be on the target lists. Until now, theUS military has ruled out strikes on the nuclear programme, as the costs of starting a war with Iran outweigh the gains of setting the programme back, in defence secretary Leon Panetta's estimation, one or two years at most. But if the US was going to war anyway over oil, that cost-benefit analysis would change.

So closing the strait outright would be – if not suicidal – an exercise in extreme self-harm for Iran. But the choice facing Tehran is not a binary one.

There is a spectrum of options falling well short of total closure; forms of harassment of the oil trade that would drive the price of crude up and keep it up, very much to Iran's benefit, but fall short of a casus belli for war. However, exercising such options requires subtlety and fine judgment on all sides and that is by no means a given.

In a period of sustained high tension, an over-zealous Iranian Revolutionary Guards commander could seize his moment to start a war, or a nervous American captain, his vessel just seconds from Iran's anti-ship missiles, could just as easily miscalculate. The last time Iran and America played chicken in this particular stretch of water, in 1988, a missile cruiser called the USS Vincennes shot down an Iranian Airbus, killing 290 civilians including 66 children.

The shadow of Iran Air 655 hangs over the current standoff, as a reminder of how even the world's mightiest and most advanced militaries cannot necessarily control a situation in which tensions have been allowed to escalate.

US military options

There is no doubting the overwhelming firepower at America's disposal. The US Fifth Fleet, whose job it is to patrol the Gulf, is expected to be beefed up from one to two aircraft carriers. Meanwhile, as it has pulled its troops out of Iraq, the Pentagon has quietly boosted its army's presence in Kuwait. The Los Angeles Times reported that it now has 15,000 troops there, including two army brigades and a helicopter unit. The US is also bolstered by the significant naval presence of its British and Gulf allies.

The Iranian military looks puny by comparison, but it is powerful enough to do serious damage to commercial shipping. It has three Kilo-class Russian diesel submarines which run virtually silently and are thought to have the capacity to lay mines. And it has a large fleet of mini-submarines and thousands of small boats armed with anti-ship missiles which can pass undetected by ship-borne radar until very close. It also has a "martyrdom" tradition that could provide willing suicide attackers.

The Fifth Fleet's greatest concern is that such asymmetric warfare could be used to overpower the sophisticated defences of its ships, particularly in the narrow confines of the Hormuz strait, which is scattered with craggy cove-filled Iranian islands ideal for launching stealth attacks.

In 2002, the US military ran a $250m (£160m) exercise called Millennium Challenge, pitting the US against an unnamed rogue state with lots of small boats and willing martyr brigades. The rogue state won, or at least was winning when the Pentagon brass decided to shut the exercise down. At the time, it was presumed that the adversary was Iraq as war with Saddam Hussein was in the air. But the fighting style mirrored that of the Iranian Revolutionary Guard.

In the years since, much US naval planning has focused on how to counter "swarm tactics" – attacks on US ships by scores of boats, hundreds of missiles, suicide bombers and mines, all at once.

"Every couple of weeks in Washington you can go to a different conference on swarming," said Sam Gardiner, a retired US air force colonel who has taught strategy and military operations at the National War College. "War games have shown that swarming, missiles and mines all together put a strain on the capacity of ships to defend themselves. Your challenge is how to protect your minesweepers from swarming techniques."

One of the US naval responses has been to develop a new kind of fighting vessel, the littoral combat ship (LCS), tailor-made for countering Iran's naval tactics. The LCS is sleek, small and agile with a shallow draft and high speeds, allowing it to operate along island-pocked coastlines.

At the low-tech end of the scale, the Fifth Fleet is reported to have deployed a significant number of dolphins trained to seek out mines.

Ultimately, the US response to swarming will be to use American dominance in the air and multitudes of precision-guided missiles to escalate rapidly and dramatically, wiping out every Iranian missile site, radar, military harbour and jetty on the coast. Almost certainly, the air strikes would also go after command posts and possibly nuclear sites too. There is little doubt of the effectiveness of such a strategy as a deterrent, but it also risks turning a naval skirmish into all-out war at short notice.

Iranian tactics

For that reason, most military analysts argue that if Iran does decide to exact reprisals for oil sanctions, it is likely to follow another route. Gardiner believes the most likely model will be the "tanker war" between Iran and Iraq from 1984 to 1987. The aim would be to raise insurance premiums and other shipping costs, and so boost oil prices as a way of inflicting pain on the west and replacing revenues lost through the embargo.

"They wouldn't necessarily do anything immediately. If they do what they did in the tanker war, a mine would be hit and it wouldn't be clear exactly how long it had been there. Things like that push up the price of oil. People talk about a spike in oil prices, but it might be more like a plateau," Gardiner said.

"The answer is not to escalate. You start protecting tankers and searching for mines."

Even if Iran decides on retaliation, there is no reason for it to be confined to an immediate response in the strait. It could target the oil price with acts of sabotage aimed at Arab state oil facilities along the southern shore of the Gulf, or western interests could be targeted anywhere around the world, months or years after the imposition of an embargo.

Adam Lowther, of the US air force's Air University, pointed out recently on the Diplomat blog that Iran's "ministry of intelligence and national security (MOIS), Iran's espionage service, is among the most competent in the world".

"Over the past 30 years, MOIS agents have successfully hunted down and assassinated dissidents, former officials of the shah's government, and real or perceived threats to the regime. MOIS is still capable of carrying out assassinations, espionage, and other kinetic attacks against government and civilian targets. The spy service is also likely to have covert agents in the United States," Lowther said.

Ehsan Mehrabi, an Iranian journalist specialising in military and strategic issues who recently left the country, wrote on the Inside Iran website: "I recall a famous Iranian idiom that was quite popular among the military officials: 'If we drown, we'll drown everyone with us'. They were pretty clear about their intention. If attacked by a western power, the war would not be contained within the Iranian borders. The entire world would become Iran's battleground – at least this was their thinking."

Obama administration officials believe that last year's Washington bomb plot, in which Revolutionary Guard officials are alleged to have planned to kill the Saudi ambassador to the US by blowing up his favourite restaurant in the American capital, could have been an attempt to settle scores for some past incident.

Bruce Riedel, a former senior CIA official said recently at a seminar in Washington organised by the Atlantic Council: "One of the ways Iran can hurt us which is not often talked about is Iranians' capacity to hurt us in Obama's war, in Afghanistan. The Iranians are already superbly placed to make the war in the Afghanistan – which is already difficult – impossible."

All these options however represent high-risk strategies, fraught with risks of miscalculation. In the tanker war scenario, maintaining the line between war and peace would, in effect, be delegated to relatively junior officers, forced to make high-stakes decisions in a matter of seconds, the exact set of circumstances that led to the 1988 Airbus disaster. Even if Washington and Tehran remain determined to avoid an all-out war, with every passing month there is a rising chance of one breaking out by accident.