For years, Iran has been an archenemy of the United States. Now, with alliances blurred in the Mideast, the two countries are talking about how to stop an offensive in Iraq by al-Qaeda-inspired insurgents.
How is it that adversaries that haven't trusted each other for 35 years could cooperate on Iraq today?
They are strange bedfellows, to say the least.
In the Syrian civil war, the U.S. backs the opposition. Iran supports Syrian President Bashar Assad.
The U.S. for three decades has considered Iran a "state sponsor of terrorism." The U.S. says Iran bankrolls anti-Israel terrorist groups and other extremists intent on destabilizing the Middle East.
The U.S. has threatened Iran with military action if Tehran approaches the capacity to develop nuclear weapons.
But despite all the differences, the U.S. and Iran are more engaged diplomatically at this moment than in years.
After a breakthrough interim agreement last year, the U.S., Iran and other nations are hoping to wrap up a deal within the next month that would curb Iran's nuclear program. Progress on nuclear talks is leading American officials to explore whether Iran can be a useful partner on interests long viewed as shared, such as fighting Sunni extremism and ensuring the stability of Iraq.
Iran, like the Iraqi government, is Shiite. The insurgent group leading the assault in Iraq, the Islamic State of Iraq and the Levant, or ISIL, is Sunni.
But there is worry that Iran is trying to leverage its helpfulness on Iraq into better terms in the nuclear negotiations.
"I would be skeptical that cooperating with Iran — particularly sharing sensitive intelligence information — would be in our overall interest," Sen. Mitch McConnell, the Senate Republican leader, told The Associated Press.
"In fact, it's hard for me to conceive of any level of Iranian cooperation that doesn't lead to future demands for concessions on the nuclear program, or foment the return of Shia militias and terrorist groups, which is harmful to resolving the sectarian disputes within Iraq," McConnell said. "Remember, the Iranians are working aggressively to keep Assad in power in Syria."
His concern was highlighted by the comments this past week by Mohammad Nahavandian, chief of staff to Iran's president, Hassan Rouhani. The aide suggested nuclear talks and Iraq's crisis were connected. The State Department rejected any linkage.
Secretary of State John Kerry, heading to the Mideast this weekend to discuss Iraq's stability, has fueled talk about U.S.-Iranian cooperation. He said early last week that the Obama administration was open to discussions with Tehran if the Iranians help end the violence in Iraq and restore confidence in the Baghdad government.
American and Iranian diplomats talked about Iraq on the sidelines of nuclear negotiations in Vienna in recent days. U.S. officials have rejected military cooperation with Iran and thus far, legislative aides said, the understanding in Congress is that no intelligence-sharing mechanism with Tehran has been finalized.
But the comments had officials and lawmakers in Washington and the Middle East abuzz.
At a breakfast this past week with the Senate Foreign Relations Committee, Kerry steered away from questions about how specifically the U.S. might cooperate with Tehran, according to aides, who weren't authorized to speak about private meetings and demanded anonymity.
They said the administration has given no impression it will provide anything to Iran revealing intelligence sources or methods. Congress' intelligence committees also are keeping tabs on what the administration decides to do. So far, the State Department is not reporting any other recent meetings between the U.S. and Iran beyond the one in Vienna.
There are reasons both might be interested in continuing the dialogue.
Iran, as a Shiite powerhouse, has considerable influence over Iraqi President Nouri al-Maliki, a Shiite who spent years in exile from Saddam Hussein's regime in Iran.
Iran also is threated by the Sunni extremists who have taken over Syrian and Iraqi territory and are pressing toward Baghdad. Iran has called ISIL "barbaric."
But the U.S. doesn't want to simply side with al-Maliki for fear of seeming to favor Shiite over Sunni.
President Barack Obama stressed the need for an inclusive government in Iraq, and several lawmakers have called for the Iraqi leader al -Maliki to step down.
Obama said Thursday that Iran could play a "constructive role if it is helping to send the same message to the Iraqi government that we're sending, which is that Iraq only holds together if it's inclusive and that the interests of Sunni, Shia and Kurd are all respected."
If Iran comes to prop up Shiite domination, he said, "that probably worsens the situation."
The notion of intelligence cooperation with Iran, however limited, has prompted a variety of reactions on Capitol Hill, cutting across party lines and traditional splits on foreign policy between hawks and doves.
Among Republicans, House Speaker John Boehner, Sen. John McCain, a leading hawk, and Sen. Ted Cruz of Texas, a leader of the ultraconservative tea party movement, are opposed, though not all for the same reasons.
McCain describes ISIL as among the "gravest" post-Cold War threats. Cruz says the danger from Sunni militants "pales by comparison to a nuclear-armed Iran."
But Sen. Lindsey Graham of South Carolina, a usual partner of McCain, doesn't see talking to Tehran as such a bad idea.
"We're going to probably need their help to hold Baghdad," Graham said this past week as ISIL insurgents approached Baghdad after taking several northern Iraqi cities and battled for an oil refinery near the capital.
Democrats also are divided.
Rep. Nancy Pelosi of California, the House minority leader, and Sen. Bob Menendez of New Jersey, the Senate Foreign Relations Committee chairman, are among those against reaching out to Iran.
The two countries have cooperated before, notably when Washington twice invaded Saddam Hussein's Iraq. They've also collaborated on combating drug flows.
James Dobbins, the State Department's special representative for Afghanistan and Pakistan, says perhaps the most constructive period of U.S.-Iranian diplomacy since the fall of the shah in 1979 occurred right after the Sept. 11 attacks. Then, the U.S. worked with Iran on forming a post-Taliban Afghan government.
Relations soured when President George W. Bush lumped Iran with Iraq and North Korea in his "axis of evil," brushing aside Iranian offers to help train a new Afghan army and the possibility of more extensive cooperation in Iraq.
In 2007, Ryan Crocker, then-U.S. ambassador to Iraq, met his Iranian counterpart in Baghdad in a bid to calm Iraq's violence. The process quickly bogged down, but U.S. intelligence believed Iran reduced its support for Shiite militias targeting U.S. troops following the contacts.
Said Trita Parsi, president of the National Iranian American Council: "With the region roiling as it is, the reality that Iran and the United States might end up on the same side is simply the new normal."