VIENNA - Washington and Tehran have set the stage for a heated last weekend of nuclear talks, with Iran's leader sticking to tough "red lines" and US Secretary of State John Kerry warning failure remains possible.
Whether or not Iran can satisfy the world that its nuclear programme is entirely peaceful "will be determined in the last days, by whether or not the outstanding issues that we've been very clear about are in fact addressed," Kerry said Wednesday.
"If they are not addressed there won't be a deal," said Kerry, who is due to leave on Friday for Vienna. His Iranian counterpart Mohammad Javad Zarif is expected Saturday in the Austrian capital, state media reported.
Iran and the "P5+1" -- the United States, China, Russia, Britain, France and Germany -- aim by June 30 to finalise a historic agreement definitively putting an Iranian nuclear bomb out of reach.
Several officials have said that the talks may be extended, but only by a few days.
Iran, which has engaged in something of a rapprochement with the West since the election of President Hassan Rouhani in 2013, denies wanting nuclear weapons, saying its nuclear programme is exclusively peaceful.
In April, Iran and the six powers agreed the main outlines of the deal in bruising talks in Lausanne, Switzerland. After two missed deadlines, this built on an interim deal struck in November 2013 in Geneva.
Under the Lausanne framework, Iran will downsize its nuclear activities by slashing the number of centrifuges enriching uranium, which can be used in nuclear power but also for a bomb when highly purified.
In return, UN and Western sanctions that have caused Iran major economic pain would be progressively lifted, although the six powers insist they can be easily "snapped back" if Tehran violates the accord.
The powers want the deal to ensure that Iran would need at least a year to produce enough highly-enriched uranium for one weapon, compared with several months at present and even less in 2013.
Tighter inspections by the International Atomic Energy Agency (IAEA), the UN nuclear watchdog, would give ample notice of any such "breakout", giving the international community sufficient time to react.
Spanners in the works
Since April, armies of diplomats and experts have been attempting to turn the one-page, 505-word joint Lausanne statement into a final document, which including several appendices will be 40-50 pages long.
It will be a highly complex accord, setting out an exact timetable of sanctions relief and reciprocal steps by Iran as well as a mechanism for handling possible violations by either side.
Tricky issues include how UN sanctions might be re-applied, the reduction of Iran's uranium stockpile and its future research and development into newer, faster types of centrifuges.
Amid unease in Iran's conservative-dominated parliament that Tehran is giving too much away, the supreme leader Ayatollah Ali Khamenei on Tuesday appeared to throw several spanners in the works.
Western powers have stressed that sanctions will not be lifted until the IAEA has confirmed that Iran has carried out key steps under the accord, something that Kerry said in April would take six months to a year.
But Khamenei, who will have the last word for Iran in the talks, said that banking and economic sanctions imposed by the United Nations and the US must be lifted immediately when the agreement is signed.
"Other sanctions can be removed gradually by a reasonable timetable," Khamenei said at a meeting that included Rouhani and hardline former president Mahmoud Ahmadinejad.
Khamenei also reiterated that Iran would not permit the IAEA, which he described as "neither independent or fair", to visit military sites or conduct "unconventional inspections" at other facilities.
For the P5+1, it is vital for the IAEA to go anywhere it sees fit in order to investigate any suspected attempts -- either in the past or the future -- to develop nuclear weapons.
"A robust agreement is one which includes an extensive verification element, including if necessary visits to military sites," French Foreign Minister Laurent Fabius said Sunday.
Khamenei also took issue with the length of time that some of the restrictions on Iran's nuclear activities would be in place for.
"The political will to reach a good agreement is there and many of the difficult political decisions have already been made," said Arms Control Association analyst Kelsey Davenport.
"It is certainly possible to wrap up the remaining issues in the eleventh hour and reach an agreement within a few days of June 30," she told AFP.