A deal to salvage the Iran nuclear accord is possible in the coming weeks before the Islamic republic holds elections in June, a senior State Department official said Thursday, a day before talks were due to resume in Vienna.

The official also confirmed “there are active discussions, indirect discussions,” underway with Tehran to secure the “immediate” release of US citizens being held in Iran, but did not say if that was a condition for a US return to the accord.

Indirect negotiations began at the start of April in Vienna between Washington and Tehran, with the other signatories to the 2015 deal (Britain, China, France, Germany, Russia and the European Union) acting as intermediaries.

ALSO READ | G7 ends talks with criticism of China, Russia, Iran

The goal is to find a way back to the accord known by its acronym JCPOA, which former US president Donald Trump walked away from and which his successor Joe Biden wants to revive.

For that to happen, the United States and Iran must agree on the lifting of the sanctions reinstated by Trump and on Tehran’s commitment to follow the terms of the deal.

Once Trump walked away, the Islamic republic started to abandon the constraints on its production of nuclear material.

The three initial rounds of talks were described as “serious” and “productive” by the US official, who asked not to be named.

Russia has said it wants an agreement concluded in a fortnight, before the campaign for Iran’s June 18 presidential election overshadows the talks. Washington has not ruled out this possibility.

“Is it possible to get a deal before the Iranian elections? Absolutely,” said the State Department official.

“It’s doable because this is not rocket science — it’s not inventing a new deal, it’s reviving one that has been undermined,” the official said.

The official admitted the main variable in the equation was how much Iran’s leadership really wants to achieve an agreement.

ALSO READ | US denies reports of Iran potentially releasing 4 detained Americans

“If Iran makes a political decision that it genuinely wants to return to the JCPOA as the JCPOA was negotiated, then it could be done relatively quickly and implementation could be relatively swift,” he said.

“We don’t know if Iran has made that decision,” the official said.

That question may be answered in Friday’s talks, the official said, noting: “We’ll just have to see whether the next round actually moves things forward or whether we still are faced with unrealistic demands by Iran.”