The United States is considering cooperation with Iran to address the challenge in Iraq of advancing Sunni Arab extremists – suggesting how profoundly the Iraq crisis could reshape relations in the Middle East.

Secretary of State John Kerry said Monday that the Obama administration is “open to discussions” with Iran, the closest ally of Iraq’s Shiite-majority government led by Prime Minister Nouri al-Maliki and a US adversary since Iran’s 1979 Islamic revolution.

A senior administration official suggested that such talks could take place this week on the margins of international negotiations in Vienna on Iran’s nuclear program.

For years, the US has condemned Tehran for meddling in Iraq’s internal affairs. Over the years of the US military occupation of Iraq, Washington accused the Iranian regime of sending across the border fighters and weapons that ended up targeting US forces. Earlier this year, the State Department said in its annual terrorism report that Iran continued to fund and arm Shiite militias in Iraq.

But Secretary Kerry’s hint at possible US-Iran cooperation, even to the extent of some kind of entente on outside military action to shore up the Maliki government, underscores how dire the US considers the threat of full-blown sectarian war in Iraq and the prospect of further victories by the fast-moving Islamic State of Iraq and Syria (ISIS).

ISIS forces that already control parts of northern Syria and have held the Iraqi city of Fallujah for months swept in and seized the Iraqi cities of Mosul and Tikrit last week, before advancing south to within 60 miles of Baghdad. They reportedly also seized the small city of Tal Afar on Monday.

The idea of the US and Iran forging common ground on Iraq is garnering support from some surprising quarters – with some congressional Republicans better known for harsh criticism of President Obama’s diplomatic overtures to Tehran saying that, in essence, Iran may be the lesser evil if the alternative is Baghdad falling into the hands of Al Qaeda-inspired Islamist extremists.

Sen. Lindsey Graham (R) of South Carolina, who in the past has blasted Mr. Obama for talking with Tehran’s “murderous regime” and the world’s “largest sponsor of terrorism,” now says that cooperating with Iran to help defeat ISIS in Iraq would be akin to the US joining forces with the Soviet Union’s Josef Stalin to defeat Nazi Germany in World War II.

“The Iranians can provide some assets to make sure Baghdad doesn’t fall,” Senator Graham said Sunday on CNN. “We need to coordinate with the Iranians,” he continued, before adding that other regional powers, including Turkey and the “Sunni Arabs,” need to “get in the game."

But support for cooperation with Iran is far from universal. On Monday, Sen. John McCain (R) of Arizona, who generally sees eye-to-eye with Senator Graham, skewered the thought that Iran could be a “partner” in confronting Iraq’s deteriorating security and stability as “the height of folly.”

Saying that US and Iranian interests “do not align in Iraq,” Senator McCain said Iran’s greater involvement in Iraq would only “inflame sectarian tensions” because it would “drive more Sunnis into ISIS’s ranks, empower the most radical Shiite militias, deepen the Iraqi government’s dependence on Iran, alienate US allies and partners in the region, and set back the prospects of national reconciliation.”

Obama said in a statement he delivered at the White House Friday that any US action targeting ISIS and in support of the Iraqi government would be contingent upon Mr. Maliki shifting from an adversarial stance toward the country’s minority Sunni population to reconciliation efforts and moves toward a unity government.

Kerry emphasized in his comments Monday, which he made on Yahoo News, that the US would be open to talking with Tehran about Iraq “if there is something constructive that can be contributed by Iran, if Iran is prepared to do something that is going to respect the integrity and sovereignty of Iraq and ability of the government to reform.”

Kerry’s string of “ifs” indicate the administration is unlikely to jump capriciously into cooperation with Iran on Iraq – indeed they suggest the administration has some of the same concerns as McCain.

But some advocates of better US-Iran relations say that not only should the US and Iran work together on addressing the Iraqi crisis, but that a functioning relationship between Washington and Tehran would be a stabilizing force in the region more broadly.

“The real value of a functioning US-Iran dialogue on regional matters is that crises like this in Iraq can be prevented even before they erupt,” says Trita Parsi, president of the National Iranian American Council, a Washington-based group that advocates an end to US-Iranian belligerence.

Had the US and Iran “collaborated rather than competed’ in the region, and in particular on Iraq and Syria, Mr. Parsi says, “ISIS would likely never have managed to pose this challenge.”

Get the Monitor Stories you care about delivered to your inbox. By signing up, you agree to our Privacy Policy

It’s hard to see how the US and Iran might have “collaborated” on Syria, given that the two countries sit on opposite sides of the ring where Syrian President Bashar al-Assad is in mortal battle with opponents ranging from the US-supported moderate opposition to ISIS.

But given that the two powers are on the same side in Iraq, the idea of at least some temporary entente seems less fanciful.