Mohammad Javad Zarif returned to Tehran for consultations on Sunday, but was expected to rejoin the negotiations in Vienna.

John Kerry, the US secretary of state, held four bilateral meetings with Mr Zarif in the Austrian capital on Saturday and Sunday. Their aim to is reach a final agreement that would settle the confrontation over Iran's nuclear ambitions.

The fact that Mr Zarif has returned to Iran for more instructions reflects the sensitivity of the issues under discussion. Privately, United States and Iranian diplomats acknowledged that the deadline would be overrun.

A senior US official said: "The parties are planning to remain in Vienna beyond June 30 to continue working."

Will

However, Federica Mogherini, the EU's High Representative for foreign policy, said that any delay would be no more than a "couple of additional days", adding that all sides had the "political will" to reach an agreement.

As he arrived in Vienna, Philip Hammond, the British Foreign Secretary, gave warning of "major differences" between the parties.

"We still have very big challenges if we are going to be able to get this deal done," said Mr Hammond. "I have said many times before and I will say it again today: no deal is better than a bad deal. There are red lines that we cannot cross and some very difficult decisions and tough choices are going to have to be made by all of us."

For years, the talks between Iran and the "P5 plus 1" - a contact group consisting of the Security Council's five permanent members plus Germany - have focused on how many centrifuges Iran should be allowed to operate. These machines could be used to make the fissile core of a nuclear weapon.

Yet this bitterly contentious issue was resolved in April when Iran agreed to place two-thirds of its 19,500 centrifuges in storage. Thanks to this progress - achieved during talks in Lausanne, Switzerland - the foreign ministers in Vienna will be relieved of the burden of arguing over centrifuges.

But that still leaves at least three crucial questions for them to settle. Perhaps the most difficult concerns Iran's past research into the technology needed to make nuclear weapons. In 2011, the International Atomic Energy Agency (IAEA) reported "credible" evidence that Iranian scientists had studied the problem of manufacturing nuclear warheads in the period before 2003 - and possibly more recently.

The IAEA asked Iran a series of questions covering 12 different subjects. Iran responded with partial answers on two areas, while ignoring the other 10.

America and its allies want Iran to come clean and provide more answers. The problem is that Iran has denied ever researching how to make nuclear weapons. Addressing the IAEA's concerns might require Iran to admit the falsity of these denials.

If, on the other hand, Iran is allowed to avoid the IAEA's questions, this would raise questions about whether it could be trusted to keep a final nuclear deal - and whether inspectors would be able to monitor its compliance.

Safeguard

The second outstanding issue concerns the rights of IAEA experts to enter sensitive locations. Iran already allows them to inspect declared nuclear plants, but not other facilities like the military sites where scientists are alleged to have studied how to make nuclear warheads.

In Lausanne, Iran agreed to apply the "Additional Protocol" safeguards agreement, which allows IAEA inspectors to enter "any location specified by the Agency". Last week, however, Iran appeared to renege on this promise when Ayatollah Ali Khamenei, the Supreme Leader, declared: "No inspection of military sites can ever be done."

The negotiators will find it hard to finesse this issue: either Iran will apply the Additional Protocol and allow the inspectors to enter "any location", or it will not.