The old foes have a common enemy in the Sunni extremists, but distrust remains and their interests are likely to diverge

US and Iran have been forced on to the same side by Isis

Tacit cooperation between the US and Iran in the war against Islamic State (Isis) in Iraq is a textbook illustration of the old saying that “my enemy’s enemy is my friend”. It is true, but only up to a point in this complicated case.

Confirmation from Washington that Tehran has sent fighter planes to mount air strikes on jihadi targets in Iraq’s eastern Diyala province – denied by the Iranians – is consistent with Iran’s known presence in and strategy towards its western neighbour, where it has played a key role fighting the Sunni extremists.

Denials in both capitals about American-Iranian coordination are also consistent with their respective difficulties in dealing with an old and mistrustful foe even as their interests force them, temporarily, into the same trench. Yet they are probably telling the truth.

The notional model for Iranian-US cooperation is the experience of Afghanistan after the 9/11 attacks on America. In late 2001 the US provided air power and intelligence for the Northern Alliance, Iran’s ally, while Iran picked Taliban targets for US bombers. But that brief honeymoon ended when George Bush included Tehran in his “axis of evil”, along with Saddam Hussein’s Iraq and North Korea – reinforcing the Iranian view of America as “the great Satan”.

Mutual hostility remains a reflex even today as Barack Obama has reached out to Iran’s theocratic supreme leader, Ayatollah Ali Khamenei, in the quest for an agreement over the Islamic Republic’s nuclear programme.

The Iraq crisis has been discussed in the margins of that long-running and still inconclusive negotiation. But there is no evidence of direct or open coordination such as a joint operations room where US and Iranian officers work side by side, even if only to “de-conflict” their air forces.

Far more likely, analysts believe, is coordination with the Baghdad government, which has formally requested the assistance of both Tehran and Washington in the effort to defeat Isis.

“In the Iraqi context the Iranians do not have to directly cooperate with the Americans,” said Hossein Rassam, an Iranian expert. “All they need to do is to work with the Iraqi military. Iranians generally are not very keen on direct bilateral contacts with the Americans. That hasn’t changed. Distrust still goes very deep.”

Another reason is that the two countries are on opposite sides of the war in Syria, where Isis expanded before it horrified the region and the world by taking over the Iraqi city of Mosul last summer.

The US calls for the removal of Bashar al-Assad and backs moderate Syrian rebel forces, albeit haltingly. Iran, displaying far greater strategic commitment, provides indispensable military and financial support for Damascus.

Still, Washington and Tehran have shared interests in Iraq before, even when Iranian revolutionary guards were training and supplying Shia militias attacking American troops.

Nouri al-Maliki, blamed for promoting Shia sectarianism before he was recently replaced as Iraq’s prime minister by the more consensual Haider al-Abadi, was backed by both countries when he was elected in 2006.

Now, as before, the US and Iran want to promote Iraq’s stability and avoid fragmentation. The deal is that Iran looks after security in the south and the Americans influence Kurdistan as long as Iran dominates southern oil flows. Isis, commented the strategic consultancy Stratfor, “has the ability to cripple the government in Baghdad and potentially unravel Iran’s position in Iraq”.

Iran’s proconsul in Iraq is General Qasim Suleimani, legendary commander of the Quds force of the Iranian revolutionary guards, who has coordinated the defence of Baghdad and worked with Shia militias and Kurdish troops. In recent weeks Tehran has raised the profile of its semi-covert presence. Suleimani also maintains Iran’s links with its Lebanese ally Hezbollah and Palestinian groups as well as managing the crucial Syria “file”.

It should be no surprise then that in the longer term, American-Iran interests in Iraq are likely to diverge as well. The US, in principle at least, wants to see an inclusive democracy take root while Iran is focused on protecting Iraq’s Shia majority and religious shrines while bolstering its position vis-a-vis the nervous Saudis and the other western-backed Sunni monarchies of the Gulf.

Tehran’s most dependable allies and proxies in Iraq are Shia militias such as Asaib Ahl al-Haq, which are viscerally hostile to the Americans.

“There has been a pragmatic accommodation between the US and Iran via Iraqi intermediaries about where the Americans do and don’t operate,” said Toby Dodge, an Iraq expert at LSE. ”They are using the Iraqis as a cutout. There is a patchwork of fighting forces on the frontlines that the Americans find it impossible to work with, some of them really nasty sectarian militias which are controlled by Suleimani.

“The Americans may think they have a coalescence of interests with Tehran, but that is a false hope. Iran’s policy has always been to sectarianise the conflict and back Shia chauvinism. That is the exact opposite of the outcome the Americans want – citizenship and equality for all before the Iraqi state.”