The election of Hassan Rouhani, who will be inaugurated today as Iran's seventh president, opens intriguing possibilities. Since 2005, the world has known an Iranian president who spoke the language of provocation and seemed to delight in keeping his country isolated. That is about to change.

Finding a way to bring Iran back into the world's mainstream will be Rouhani's principal challenge. His power is limited, though in the fluid world of Iranian politics, he is likely to accumulate more. His adversaries, most notably supporters of Prime Minister Benjamin Netanyahu in Israel and the United States, ridicule him as a puppet of repressive mullahs.

President Obama told an interviewer in reply that he was open to "a whole range of measures" if Iran would "show the international community that you're abiding by international treaties and obligations, that you're not developing a nuclear weapon."

That was an encouraging exchange, but far more will be required to thaw an icy relationship that has been disfigured by passionate emotions. They prevent the two countries from pursuing common strategic interests, which include stabilizing Iraq and Afghanistan, fighting militant Sunni groups like the Taliban and al-Qaeda, controlling the Afghan drug trade, and calming Syria.

On the American side, hostility is the product of the deeply traumatic hostage crisis of 1979-80 and Iran's long and sometimes bloody campaign to undermine US interests around the world. Iran's hostility springs from deeper history. A nuclear deal with Iran will only be possible if the West finds a way to calm Iranian fears that the deal is just another repeat of a cycle they have seen over generations.

Americans should explicitly say that they will never interfere in Iran's domestic affairs … should acknowledge all our undeniable rights and … set aside unilateral and bullying policies.

These are three ways of expressing the same fear, which grips Iranians across political and social lines: that the outside world is determined to control Iran, limit Iran's growth and prevent Iran from fulfilling its national potential.

During the 19th century, Iranians lost vast territories in disastrous wars and corrupt monarchs sold everything of value in the country to foreigners. Iranians finally rose up and proclaimed a constitution, but Russian forces bombed parliament and re-imposed royal dictatorship. In 1907, Britain and Russia signed a treaty dividing Iran between them; no Iranian was at the negotiations or even knew they were taking place.

Iran's most formidable modern leader, Reza Shah Pahlavi, was obsessed with the idea of building a steel mill, but in 1941, soon after he assembled all the components, Allied armies invaded Iran and the project had to be abandoned. A decade later, Prime Minister Mohammad Mossadegh nationalized the Iranian oil industry, but was overthrown in a coup sponsored by the US and Britain. More recently, Iranians have suffered under an escalating series of Western sanctions.

Many Iranians see the Western campaign against their country's nuclear program as the latest chapter in this story. Any accord between Washington and Tehran will have to couch Iranian concessions in terms shaped to address Iran's deep-seated historical fears.

Over the past 34 years, whenever Iran has made a conciliatory offer to the United States, Washington was in the hands of militants who were only interested in war or regime change. When an American administration reached out, Iran was in a rejectionist phase. Washington and Tehran are still full of people wedded to the paradigm of hostility.

The emergence of Rouhani, especially at a time when President Obama no longer needs to worry about re-election, makes imaginable what for years has been unimaginable. Reconciliation would allow the world to stop fearing a Persian Gulf conflagration and hope instead for Iran's return to the global economy, a responsible role in the Middle East, and even some form of partnership with the United States. It will only be possible if both sides delicately confront the ghosts of history.