Iran and six powers agreed to continue talking for four more months after failing to meet a July 20 deadline to reach a deal on curbing the Iranian nuclear programme in exchange for ending sanctions, enabling Tehran to access $2.8 billion of frozen cash.

But US officials warned that most sanctions against the Islamic Republic would remain in place.

The announcement came in the early hours of Saturday after nearly three weeks of marathon talks in a 19th century Viennese palace, where senior officials from Iran, the United States, Britain, France, Germany, Russia and China were holed up in negotiating rooms struggling to reach an agreement.

Iran will be allowed to access in tranches an additional $2.8 billion of its frozen assets during the period of extended talks, senior US officials told reporters in Vienna.

"Iran will not get any more money during these four months than it did during the last six months, and the vast majority of its frozen oil revenues will remain inaccessible," U.S. Secretary of State John Kerry in a statement released in Vienna on Saturday.

"We will continue to vigorously enforce the sanctions that remain in place."

It remains uncertain whether four more months of high-stakes talks will yield a final deal, since major underlying differences remain after six rounds of meetings this year.

The six powers want Iran to significantly scale back its nuclear enrichment programme to make sure it cannot yield nuclear bombs. Iran wants sanctions that have severely damaged its oil-dependent economy to be lifted as soon as possible.

After years of rising tension between Iran and the West and fears of a new Middle East war, last year's election of a pragmatist, Hassan Rouhani, as Iran's president led to a thaw in ties that resulted in November's diplomatic breakthrough.

A senior US official told reporters Washington would make clear to countries around the world that "Iran is not open for business" during the four months of extended talks.

In exchange for the $2.8 billion, Kerry said, Iran has agreed to continue neutralizing its most sensitive uranium stocks - uranium that has been enriched to a level of 20 percent purity - by converting it to fuel for a research reactor in Tehran that is used to make medical isotopes.

Kerry said the future of Iran's enrichment programme was one of the most divisive topics.

"There are very real gaps on issues such as enrichment capacity at the Natanz enrichment facility," he said.

"This issue is an absolutely critical component of any potential comprehensive agreement. We have much more work to do in this area, and in others as well."

'SIGNIFICANT GAPS'

Iranian Foreign Minister Mohammad Javad Zarif told reporters earlier this week that Tehran would be willing to delay development of an industrial-scale uranium enrichment programme for up to seven years and to keep the 19,000 centrifuges it has installed so far for this purpose.

But Kerry said after several face-to-face meetings with Zarif it was "crystal clear" that for Iran to keep all of its existing centrifuges was out of the question.

EU foreign policy chief Catherine Ashton and Zarif spoke of "significant gaps" in a joint statement they issued in the early hours of Saturday.

Another difficult issue in the talks, diplomats said, is how to address Iran's suspected past atomic bomb research and the duration of any long-term restrictions on its nuclear programme. The negotiations began in February in Vienna.

"We will reconvene in the coming weeks in different formats with the clear determination to reach agreement on a Joint Comprehensive Plan of Action (long-term agreement) at the earliest possible moment," Ashton and Zarif said.

The extension begins on July 21 and runs through Nov. 24. US officials said the talks would resume in some format next month.