A year and half of nuclear talks between Iran and major powers were creeping towards the finish line on Friday as negotiators wrestled with sticking points including questions about Tehran's past atomic research.
Iran is in talks with the United States and five other powers – Britain, China, France, Germany and Russia – on an agreement to curtail its nuclear program in exchange for relief from economic sanctions.
"We are coming to the end," said a senior Western diplomat, who added there was no plan to carry on for long past next Tuesday. "Either we get an agreement or we don't," he said, adding that the process "remains quite difficult".
Iranian Foreign Minister Mohammad Javad Zarif told Iranian state television that "a lot of progress has been made, but still various technical issues remain that need the other party's political will".
Still, all sides say a deal is within reach. U.S., European and Iranian officials, including U.S. Under Secretary of State Wendy Sherman and Iranian deputy foreign ministers Abbas Araqchi and Majid Takhteravanchi, held a six-hour negotiating session that ended at 3 a.m. on Friday, a senior U.S. official said.
U.S. Secretary of State John Kerry and Zarif were due to hold a bilateral session on Friday, though that meeting was delayed several times.
Russia's chief negotiator Sergei Ryabkov said the text of the agreement was more than 90 percent complete. Chinese Foreign Minister Wang Yi voiced confidence that the parties would reach a mutually acceptable accord.
The negotiators missed a June 30 deadline for a final agreement, but have given themselves until July 7, and foreign ministers not already in Vienna are due to return on Sunday for a final push.
A deal, if agreed, would require Iran to severely curtail uranium enrichment work for more than a decade to ensure it would need at least one year's "breakout time" to produce enough highly enriched uranium for a single weapon, compared with current estimates of two to three months.
QUESTIONS ABOUT IRAN'S PAST
Western and Iranian officials said there were signs of a compromise emerging on one of the major sticking points: access to Iranian sites to monitor compliance with a future agreement.
A senior Iranian official in Vienna said on Thursday that Iran would sign up to an IAEA inspection regime called the Additional Protocol, which would be provisionally implemented at the start of a deal and later ratified by Iran's parliament.
The Protocol allows IAEA inspectors increased access to sites where they suspect nuclear activity is taking place, but U.S. officials say it is insufficient because Iran has in the past stalled by dragging out negotiations over access requests.
The Iranian official said Iran could also agree to a system of "managed access" – which is strictly limited to protect legitimate military or industrial secrets – to relevant military sites.
The issue of Iran's past nuclear research is more difficult.
Yukiya Amano, head of the International Atomic Energy Agency (IAEA), on Thursday met Iranian President Hassan Rouhani and other officials in Tehran to discuss the IAEA's unresolved questions.
But on Friday he said in a statement that there had been no breakthrough and "more work will be needed".
Western diplomats said they were not demanding a public confession that Iran had conducted research into building a nuclear warhead, but that the IAEA had to be satisfied it knew the full scope of past Iranian activity to establish a credible basis for future monitoring.
Officials close to the Vienna talks say the suspension of some sanctions will be tied to resolving this issue. "It's time to close this chapter," the senior Western diplomat said.
Other sticking points include the timing of the suspension of sanctions, and Iranian acceptance of a plan to restore U.S., European Union and United Nations sanctions if Tehran fails to comply with the terms of the agreement.
Another obstacle is Iran's determination to maintain the ability to continue research and development involving advanced centrifuges, machines that spin at supersonic speeds to purify uranium for use in power plants or weapons.
Analysts and diplomats say that if Iran runs many advanced centrifuges, this could shorten its breakout time to back under a year again.