Iranian Foreign Minister Mohammad Javad Zarif said Sunday that clinching a final nuclear deal with world powers is still "possible", despite a tough round of talks this week.
"Agreement is possible. But illusions need to go. Opportunity shouldn't be missed again like in 2005," Zarif wrote on Twitter, referring to Iran's long-stalled dispute with world powers over its suspect nuclear programme.
Iran and six world powers ended a fourth round of nuclear talks in Vienna on Friday with "no tangible progress".
Britain, China, France, Russia, the United States and Germany -- known as the P5+1 group -- want Iran to radically scale back its nuclear activities, making any dash for an atomic bomb virtually impossible and easily detectable.
The parties want to clinch an accord by July 20, when a November interim deal expires, under which Iran froze certain activities in return for some relief from crippling Western sanctions.
In return for further concessions, the Islamic republic, which denies seeking an atomic weapon, wants the lifting of all UN and Western sanctions, which have badly damaged its economy.
The fourth round of talks between Iran and the P5+1 ended on Friday with both sides complaining that major gaps remained ahead of the July 20 deadline.
"Huge gaps remain, there is really more realism needed on the other side," a Western diplomat said. "We had expected a little more flexibility on their side."
On Sunday, Iran's English-language Press TV cited the country's deputy foreign minister, Abbas Araghchi, as saying that the next round of talks were to be held in Vienna on June 16-20.
Ali Akbar Velayati, foreign policy adviser to Iranian supreme leader Ayatollah Ali Khamenei, was upbeat about the prospects of an agreement being reached.
"There is hope for a positive outcome in the talks, as long as other parties show their goodwill like Iran," he was quoted as saying by the reformist Sharq newspaper.
"I am hopeful that the talks will yield positive results."
Saeed Laylaz, a leading Iranian political analyst, also expressed optimism.
It is normal for a dispute that surfaced a decade ago "not to be completely resolved in just a few months," he told the Etemad daily.
"An agreement that is difficult to reach would be more sustainable than an easy one."
The failure of the latest round of talks was welcomed by hardliners in Iran, however.
The Kayhan daily ran a headline that said the talks "fortunately ended fruitless".
Its editorial criticised the West over the interim agreement that it said deceived President Hassan Rouhani into accepting "too many concessions for too little gain".
Failure to reach an accord by July 20 could have calamitous consequences, potentially sparking conflict -- neither Israel nor Washington rules out military action -- and creating a nuclear arms race in the Middle East.
Negotiators could in theory extend the deadline, but both US President Barack Obama and his Iranian counterpart could struggle to keep their respective sceptical and impatient hardliners at bay.