Chaos creates strange bedfellows. Having induced shambles in Iraq and so far failed to induce shambles in Iran, America now needs Iran's help to clear up the shambles in Iraq.

Instability is the worst curse an invader can visit on a vanquished state. At such a time, any agent of stability is welcome. As in Syria and Lebanon, and now in Iraq, Iran is such an agent, and a desperate America is running to bang on its door.

Iran could be forgiven for wanting President Obama and his "finest fighting force the world has ever seen" to be grovelling and begging at its feet. How now America, it might say. How am I a mere terrorist state, an axis of evil, a jumped up nuclear wannabe? You have marched into my sphere of influence and destabilised my borders with Iraq and Afghanistan. You have imposed vicious sanctions to protect your club of nuclear states. Now you are caught in a trap of you own making, and you need my help.

There is no way the militant Sunni uprising will stray into Iran. It is most unlikely to recapture Baghdad or – what does matter to Iran – the holy Shia shrines to the south around Karbala. On the other hand, Iran might indeed agree to help in Iraq if America were to back off its ally, President Bashar al-Assad of Syria. It would also appreciate less rampant paranoia about its nuclear enrichment given America's tolerance of those of Israel and Pakistan. And it would like relief from sanctions.

So what price, Washington, for three revolutionary guard battalions to aid the Baghdad regime of prime minister Nouri al-Maliki? It is near impossible to think of a single benign outcome of the 2003 Bush-Blair invasion of Iraq – even Saddam was moderation itself compared with that coalition's blood-thirsty reign.

But this crumb of diplomatic comfort is a welcome dash of sanity. Iran is by far the most powerful player in the emerging Sunni-Shia conflict. During America's 2012 presidential election, Republican candidates vied with each other over the number of bombs they wanted to rain down on Tehran in what seemed little more than crude war lust. America's drone operators continue to massacre far more Muslims than any Sunni atrocity.

So perhaps realpolitik has at last come to the aid of a respect for the integrity and sovereignty of foreign states. For these blessings we must give thanks.