Iran and the global powers go into a key weekend of talks Saturday, after months of intense negotiations, amid signs they may be inching towards a historic nuclear deal to end a 13-year standoff.
While Iranian foreign minister Mohammad Javad Zarif warned there was still "no guarantee" of success, he said the world had "never been closer" to reaching an accord with his country.
In a rare move, Zarif offered the promise of greater cooperation to tackle other global problems, such as the rise of the Islamic State group, should the deal be sealed.
Global powers are trying to draw the curtain on almost two years of negotiations, which gathered fresh impetus after President Hassan Rouhani took power in late 2013.
The aim is to finalise a deal which would put a nuclear bomb beyond Iran's reach, in return for lifting a web of biting international sanctions slapped on the Islamic republic.
Speaking in English from the balcony of the Viennese hotel hosting the talks, Zarif said in a message posted on YouTube that at "this 11th hour, despite some differences that remain, we have never been closer to a lasting outcome".
"Getting to yes requires the courage to compromise, the self-confidence to be flexible, the maturity to be reasonable," he said.
But he added that Iran was ready to strike "a balanced and good deal" which could "open new horizons to address important common challenges".
"Our common threat today is the growing menace of violent extremism and outright barbarism," he said in a clear reference to the Islamic State (IS) jihadist group that has overrun parts of Syria and Iraq.
As Zarif met US secretary of state John Kerry for fresh talks Friday, the top US diplomat praised "the genuine effort" being made by all sides and insisted progress had been made despite "tough issues".
'Nothing until everything'
After missing several deadlines, the so-called P5+1 group -- Britain, China, France, Germany, Russia and the United States -- have now given themselves until Tuesday to conclude the deal.
"We're really in the endgame of all this," a senior US administration official told reporters.
"We're certainly making progress, there's no doubt about that... but it's also clear there are still big issues not resolved, which is why people are burning the midnight oil."
Some outstanding points of contention have been concluded in the past few days. But the official cautioned "nothing is agreed until everything is agreed," adding: "Eventually this is going to have to come down to some significant political decisions that can only be made at the level of ministers."
With teams of experts working around the clock to resolve some of the thorniest issues -- such as the extent and timing of sanctions relief, and how to win access to suspect Iranian nuclear sites -- many of the ministers are due back in Vienna on Sunday.
"It feels like the end," said one Western diplomat. "The technical work is advancing on the main text, on the appendices."
It will be up to the UN watchdog, the International Atomic Energy Agency (IAEA), to verify Iran is sticking to its side of the bargain through enhanced inspections of its nuclear facilities.
But the P5+1 also want the IAEA to be able to visit sites where there is no declared nuclear material to probe alleged efforts, before 2003 and possibly since, to develop a nuclear weapon in secret.
On Thursday the IAEA chief Yukiya Amano visited Tehran to meet Rouhani, hoping to jumpstart a stalled probe into the so-called "possible military dimensions" of Iran's activities.
But after he returned, an IAEA statement suggested there had been no breakthrough.
"I believe that both sides have a better understanding on some ways forward, though more work will be needed," Amano said.
He briefed Kerry Friday about his trip, but US officials refused to discuss the substance of their talks.