If the Conservatives are still in power in Ottawa after October’s election, they’re going to have a hard time reconciling their fervent support for the Israeli government and contempt for Iran with the new realities of power and influence emerging in the Middle East.

It’s on the cards now that, within the next few days, Tehran will do a deal with the five permanent members of the United Nations Security Council — the United States, Russia, China, Britain and France — plus Germany, to end the 12-year dispute over Iran’s nuclear development program. In return for Tehran agreeing to limit its program to electricity generation and to stop well short of the ability to make nuclear weapons, the so-called P5+1 group will initiate the end of crippling UN economic sanctions.

The deal will leave the Stephen Harper government’s Middle East policy, such as it is, at loose ends on two counts. Since it closed the Canadian embassy in Tehran in 2012 and severed diplomatic relations, Ottawa has no foundation on which to reconstruct a relationship with an Iran welcomed back into the community of nations.

And even the Israeli government of Prime Minister Benjamin Netanyahu, whose approval seems to be the main aim of Harper’s Middle East policies, is setting aside his frequently intemperate objections to doing a deal with Tehran. He continues to insist Iran plans to “wipe Israel off the map.” But mollified by Washington’s promises of new defensive and offensive weapons systems, Netanyahu is shifting his focus to more immediate Israeli security threats such as Iran’s proxy militant groups in Lebanon, Syria and Gaza.

The Liberals have castigated the Harper government for closing the Canadian embassy in Tehran and thus (in the Liberals’ view) excluding Canada from any role in the nuclear agreement with Iran. In truth, that was never a realistic prospect. In the first place, dealing with Tehran has been a game for the big kids in the P5+1 group.

Second, the Harper government’s dogged and determined campaign to make Canada a country of supreme international inconsequence has been profoundly successful. Harper has pursued the premise that the world needs less Canada. The world has come to the same conclusion.

U.S. Secretary of State John Kerry will meet Iranian Foreign Minister Javad Zarif in Geneva this weekend for what is being billed as the final push to resolve the dispute over Tehran’s nuclear program. The talks may stray past the self-imposed June 30 deadline, and there will doubtless be serious bumps in the road along the way towards a final resolution. Some potholes may even threaten to throw the whole process into the ditch. But the bottom line is that it is in everyone’s interest to make a deal that brings Iran out of United Nations-imposed semi-isolation.

The impact of that will go well beyond the question of whether Iran has — or wants — a nuclear weapons stockpile. Tehran, as the champion of the Shi’ite sect of Muslims who make up about 12 per cent of the followers of Islam, is already in a violent contest with Saudi Arabia, the leader of Sunni Islam, for influence in the Middle East. Resolution of the nuclear issue, the lifting of sanctions and the beginnings of a detente with Washington, whose relationship with Riyadh is notably cool, will enhance Tehran’s regional stature.

If anything, Washington and Tehran’s common cause against Islamic State enhances the prospect of a successful agreement on Iran’s nuclear program. If anything, Washington and Tehran’s common cause against Islamic State enhances the prospect of a successful agreement on Iran’s nuclear program.

And it is in Tehran, far more than at the UN or among the P5+1 group, that the success or failure of the deal will be decided. For Iran, there are two critical issues that will determine whether it is possible to build a domestic political consensus behind an agreement.

One is the pace of the lifting of economic sanctions. Iranian President Hassan Rouhani, who has championed the negotiations in the face of strong opposition from hardliners within the establishment, wants an immediate benefit on signing with the lifting of all sanctions. The U.S. in particular wants a progressive lifting of embargoes as Iran meets its obligations along the way. This is going to be a crucial area for compromise in the coming days.

Far more vexing in the contorted power structure of Tehran is the issue of international inspection of Iran’s nuclear sites after the deal is done. Although Rouhani is Iran’s elected president, he is constrained in his freedom of action by the fact that the country is a Muslim theocracy where ultimate power rests with the ‘Supreme Leader’, Ayatollah Ali Khamenei.

Khamenei will not only give final thumbs up or down on the deal with the P5+1, he also controls the country’s most potent and influential military force — the Islamic Revolutionary Guards Force (IRGF). The IRGF regards itself as the embodiment of the security of the Iranian state, and it has developed a large and lucrative business empire during sanctions. It and Khamenai have final control over the nuclear program and the IRGF is vehemently opposed to any UN-backed inspection regime that would preclude Iran from making nuclear weapons if it feels the need.

Khamenei may be Supreme Leader, but he is not unaccountable. There is a Guardians Council of senior Muslim clerics who can remove the Supreme Leader for misconduct. Thus Khamenei’s power is circumscribed and he needs the support of the IRGF for a measure of security. It was to show his concern for the IRGF that on Tuesday Khamenai said the deal with the P5+1 cannot include international inspection of Iranian military sites.

That looks like a deal-breaker, but how seriously Khamenei meant what he said is debatable. Khamenei may be Supreme Leader, but he also needs to acknowledge that the administration of President Rouhani and the Iranian parliament have considerable political legitimacy and public support.

So even though Khamenei has publicly backed the concerns of the IRGF, he also has strongly supported the efforts of Rouhani and his ministers to do a deal with the P5+1.

There are several ways in which the IRGF can be placated. This army, commanded by Mohammad Ali Jafari, already has control of much of Iran’s security policy. It is in the forefront of supporting Tehran’s proxies in the region, such as Hezbollah in Lebanon, Palestinian Islamic Jihad in the Israeli-controlled West Bank and Gaza, the Huthi who now control most of Lebanon, and the regime of Bashar al-Assad in Syria.

Indeed, the IRGF and some of its units are on the ground fighting with proxies against the Islamic State group (ISG) in Syria and Iraq, and with the Huthi in Yemen. The IRGF was born in Iran’s 1979 Islamic revolution and it is deeply imbued with anti-Americanism. But now the IRGF is fighting against ISG in the same cause as U.S. forces, with Canadians in tow.

How much co-ordination there is between the Pentagon and IRGF in attacks on ISG is impossible to know at this point. But active and retired staff officers say, at the very least, there must be an exchange of information about pending actions against ISG. Without such an exchange the danger of accidentally killing each other would be great.

This may prove to be a significant confidence-building relationship between the Revolutionary Guards and American military. The potential for eroding mutual suspicion by fighting together against a common enemy is significant.

If anything, Washington and Tehran’s common cause against ISG enhances the prospect of a successful agreement on Iran’s nuclear program.

Rouhani was elected president in 2013 and came to office amid much optimism that he would pursue a reformist agenda. He has, however, followed a deft and careful path through the minefield of Iranian politics. Rouhani has been careful to keep Khamenei’s backing for his administration by refraining from appointing radical reformists to senior posts and not pushing on such issues as political reform and women’s rights.

His strategy seems to be that if he can get a nuclear deal and improvements in the economy with the lifting of sanctions — Iran has the second largest conventional oil reserves after Saudi Arabia — he will then be in a better position to pursue other objectives during a second term as president.

Jonathan Manthorpe is the author of “Forbidden Nation: A History of Taiwan,” published by Palgrave-Macmillan. He has been a foreign correspondent and international affairs columnist for nearly 40 years. He was European bureau chief for the Toronto Star and then Southam News in the late 1970s and the 1980s. In 1989 he was appointed Africa correspondent by Southam News and in 1993 was posted to Hong Kong to cover Asia. For the last few years he has been based in Vancouver, writing international affairs columns for what is now the Postmedia Group. He left the group last year and now writes for a range of newspapers and websites. jonathan.manthorp[email protected]

The views, opinions and positions expressed by all iPolitics columnists and contributors are the author’s alone. They do not inherently or expressly reflect the views, opinions and/or positions of iPolitics.