To Americans, Iran's actions over the last two weeks may have seemed not merely surprising, but also contradictory.
Iran rushed to meet its obligations under last year's landmark nuclear agreement, dismantling the machinery it could have used to make atomic bombs. At the same time, officials insisted that they would continue to test ballistic missiles in apparent violation of another United Nations resolution.
Iran quickly released 10 American sailors whose boats had drifted into Iranian waters and said they had been treated with "Islamic hospitality." Then the Revolutionary Guard released a video showing the sailors on their knees, and a general boasted: "The Americans humbly admitted our might and power."
Iran's intelligence agencies quietly negotiated a deal to swap five American prisoners for seven Iranians — then haggled over allowing the wife and mother of one of the Americans to leave the country. And a hardline official claimed that Washington's $1.7-billion settlement of an Iranian legal claim was actually paid as ransom for the prisoners. (Not so, the White House said.)
The message from Iran-watchers is: Get used to it.
"Iran is a complicated country," Abbas Milani of Stanford's Hoover Institution told me last week. "On one level, they are simply using an old-fashioned good cop-bad cop strategy. On a deeper level, there's a struggle under way over the future of the country, and we don't know how that's going to turn out."
The underlying problem is that Iran still hasn't made the choice Henry Kissinger described several years ago: whether it is a country or a cause — a normal state, or a revolutionary one.
In practical diplomacy, Iran has been behaving more like a normal state: complying with agreements, releasing sailors, resolving old disputes. But — strangely to us, perhaps — the Iranians find symbolic steps more difficult.
The hardline Supreme Leader, Ayatollah Ali Khamenei, grudgingly approved deals with the United States as the price of freeing the country from economic sanctions. (U.S. officials say Khamenei personally approved the release of the sailors and the prisoners as well as the nuclear deal.)
And Iran's opening to the West has expanded well beyond the nuclear deal. U.S. officials say Tehran is supporting international efforts to arrange ceasefire talks in Yemen's civil war (where Iran is backing Shia Muslim rebels against a government supported by its rival, Saudi Arabia). Iran has also endorsed a U.S.-led drive for peace talks in Syria's civil war.
"There already has been a broad turn in Iranian foreign policy, at least in terms of dealing with the United States," noted John Limbert, a former U.S. diplomat (and former hostage) in Iran. "Three years ago," he added, "it was inconceivable that Iran and the United States would be talking directly with each other so often, and about so many issues."
On the other hand, the Iranians have repeatedly rejected proposals for normal diplomatic relations with the U.S. (an offer floated by George W. Bush before Barack Obama). They even rejected a U.S. proposal for a hotline between the two countries' armed forces, even though that could avert unnecessary clashes.
This resistance to formal normalization is partly about preserving Iran's revolutionary self-image.
"Khamenei's whole political platform has been based on anti-Americanism. He can't admit that his basic idea has collapsed," Milani said.
So even as he has authorized a de facto rapprochement with the United States, Khamenei has released an uninterrupted flow of statements denouncing the Great Satan and warning against Western subversion.
The resulting policy, said Karim Sadjadpour of the Carnegie Endowment for International Peace, could best be described as "contained antagonism."
The two-sided nature of Iranian foreign policy also reflects the political struggle between the hardliners and reformist president Hassan Rouhani, with Khamenei usually (but not always) backing the hardliners.
The nuclear deal, a victory for Rouhani, has sharpened that rivalry. Rouhani hoped the deal would give his reformist coalition a boost heading into parliamentary elections scheduled for Feb. 26. But last week, the country's Guardian Council disqualified thousands of reformists from running — prompting an unusually sharp and public debate between Rouhani (who protested the order) and Khamenei.
Note to Americans: A lot of this isn't about us. It's about them. Just as in any other country — even ours — foreign policy is often a continuation of politics by other means.
Indeed, U.S. officials and Iran-watchers warn almost unanimously that they expect new U.S.-Iranian conflicts ahead — not only because the two countries still disagree on many issues, but also because Tehran's hardliners want to reassert their influence.
It would be nice if Iran's mullahs stopped leading chants of "Death to America." But that's not going to happen for a long time, and that's OK.
There's a historical precedent in U.S. foreign policy for how to deal peacefully with a hostile or threatening power.
American presidents managed their way through a half-century of global rivalry with the Soviet Union and almost a half-century of disagreements with China without going to war. We can manage conflict with Iran too.