Iran’s attitude to the United States is like someone pining for a former, perhaps abusive lover. It has declared its contempt but also longs to again be a partner. And as is often the case, the line dividing hate and love is a thin one.

Take for instance the hostage crisis in 1979, when militant students stormed the US embassy and imprisoned diplomats in Iran for 444 days. Though it led to a breakdown of diplomatic relations, the two sides started talking behind closed doors to resolve the crisis.

Those secret bilateral talks in Algiers led to an agreement in 1981 to set up the US-Iran Claims Tribunal in The Hague to reach settlements over American assets confiscated by the revolutionaries. Iran saw the tribunal as a means to reduce tension. And while the US has yet to unfreeze Iranian assets in America, put by Tehran at over $1bn, it has promised to do so once all the cases have been settled, as most now have been.

I worked as an interpreter at the Hague Tribunal for seven years, and was impressed by the level of professionalism at the arbitration panels, frequented by high-caliber American and Iranian lawyers.

The Iranians would spend handsomely to hire British lawyers to defend them. In the end, they accepted the results of the arbitration, frequently settled against them, and paid out hefty sums in damages to US citizens and corporations.

Furthermore, regardless of our perceptions about Iran’s leaders, it has been my experience that they all wanted to restore ties with the United States. I was also an interpreter to four of Iran’s presidents, and witnessed first-hand how hard each tried to realize this goal.

Famously Ali Akbar Rafsanjani, president from 1989 to 1997, initiated secret contacts with the Americans to receive arms during the 1980-88 Iran-Iraq war, provoking the so-called Iran-Contra affair. After the 1991 Gulf War between the US and Iraq, I interpreted for him at a conference in Tehran when Rafsanjani told an audience of foreign security experts that “Iran could accept the reality of the presence of US military forces in the Persian Gulf”, although in public Iran was completely opposed to their presence.

When the reformist president Mohammad Khatami (1997-2005) visited New York in 1997, he showed sensitivity to American history by talking about the Pilgrim Fathers settling in Plymouth, Massachusetts, in the 17th century. Khatami wanted to stress that both the US and Islamic republic had roots in religious beliefs.

Khatami’s successor, Mahmoud Ahmadinejad (2005-2013), went as far as to hold a Quran and a Bible in his hands at the UN General Assembly in September 2010 to show the common religious heritage of America and Iran. Ahmadinejad often spoke in belligerent terms, especially over Israel, but he reduced his hype of the nuclear programme at the time of the election of Barack Obama.

Like Khatami, Ahmadinejad unsuccessfully requested a visit to the site of the World Trade Center in New York in remembrance of the victims of the al-Qaeda attacks of 2001. His letter to president George W Bush calling for improved relations in 2006 referred warmly to the Bible. Later, Ahmadinejad referred to president Barack Obama as “his excellency” during a UN speech, and I remember an aide thanking me specifically for translating the phrase accurately.

When Hassan Rouhani became president in 2013, he asked to speak to Obama by telephone and raised the prospect of a handshake. The phone call was granted, but not the handshake. Meanwhile, a Rouhani aide asked me if I knew whether any of the US president’s staff were Muslims, clearly showing he sought a bond with the American leadership.

Rouhani has long signalled to Washington his desire to settle the nuclear issue, and not just as president. When he led Iran’s nuclear negotiations with the European Union as secretary of the Supreme National Security Council up to 2005, Rouhani asked the then IAEA chief, Mohamed ElBaradei, to liaise with the Americans, whose shadow hovered over the talks.

Mohammad Javad Zarif, Iran’s foreign minister, told me that the famous faxed letter of 2003, when Iran proposed to the US talks aimed at a comprehensive settlement of US-Iran disagreements, came after Tehran was told by a third party that Richard Armitage, then deputy secretary of state, was ready for talks on a basis Iran would see as “mutual respect”.

What Zarif told me means that previous accounts that Iran was taking a lone initiative in sending the letter are not entirely correct. Zarif told me Iran’s fax was intended as a reply, and it was only later, as the US failed to respond, that it realised it had been misled by the third party.

Zarif refused to reveal to me who the third party was. Perhaps we can speculate it was one of the Arab states in the Persian Gulf. Ahmadinejad once told me Iran had been approached several times by third parties claiming to speak for the Americans and that some had been Gulf Arabs.

What do all these gestures mean, when chants of “death to America” in Iran have not stopped?

Clearly, Iran and the US have a convoluted relationship going back to the overthrow of the democratic government of Mohammad Mossadegh by a CIA-led coup in 1953. Iran has deep reservations over US policy in the Middle East, particularly due to its long support for Egypt’s Hosni Mobarak while it opposes Iranian allies like Syria’s Bashar al-Assad in the name of “democracy”.

Now as nuclear talks between Iran and the United States teeter on the brink of success or failure, politicians in Tehran sense the looming culmination of a long process testing whether the US is serious over reducing enmity with the Islamic republic.