Deadline for deal moved to 30 June but British foreign secretary says aim is to reach broad accord within three months

Negotiations over Iran’s nuclear programme have been extended until the end of June next year in the hope that the broad outlines of a deal can be agreed within three months.

The extension was announced on Monday after nine months of negotiations culminated in a week of talks in Vienna that failed to close gaps between Iran and a six-nation negotiating group over the scale of a future Iranian nuclear programme and the speed with which international sanctions would be lifted.

The US secretary of state, John Kerry, claimed “progress was made on some of the most vexing challenges that we face.”

“Today we are closer to a deal that would make the entire world … safer and more secure,” Kerry said. Is it possible that in the end we just won’t arrive at a workable agreement? Absolutely. We are certainly not going to sit at the negotiating table for ever. But given how far we have come … this is certainly not the time to get up and walk away.”

Iranian President Hassan Rouhani also sounded an upbeat note. “During the talks in Vienna many gaps were narrowed and our positions with the other side got closer,” Rouhani was quoted as saying by Iranian state television.

Talks will resume next month to try to consolidate progress made in the Austrian capital and to continue the search for ways to bridge the remaining differences.

Twelve years after Iran’s nuclear programme was first revealed, the Vienna talks marked the latest in a long line of failed attempts to negotiate lasting curbs on Iranian activities so that the international community can be confident Tehran is not trying to build a weapon. Last November, when military action by Israel appeared to be looming, an interim deal was agreed in Geneva that froze the Iranian programme and sanctions, significantly defusing tensions. The terms of that interim deal, in which Iran continues to abide by restrictions and can draw on some of its frozen assets around the world, will remain in force until June 30. Kerry argued that alone would make the world a safer place.

“I think we’re all clear that we need to take the momentum that has been generated over the last month or so and we need to keep moving with it. We can’t afford to stop now,” Britain’s foreign secretary, Philip Hammond, said. “There will be further meetings in December and our clear target is to reach a headline agreement, an agreement on substance in the next three months or so.”

Iranian officials said the Vienna talks appeared to be making good progress as late as Sunday morning and that the negotiators were beginning to draft the text of an agreement, but by the afternoon western positions hardened. “There was a change of course on Sunday. We don’t know why,” an official said.

Emerging from the hotel that was the venue of the week’s talks, the French foreign minister, Laurent Fabius said: “In the course of the past few days, some new ideas came up. They clearly require a very detailed technical assessment because these are complex concepts.”

His German counterpart, Frank-Walter Steinmeier, said: “Nobody came out of these negotiations feeling depressed.”

Steinmeier also hinted that the demands of other Middle East states, which were not represented in Vienna, could have added to the complexity and difficulty of the talks. “We bear responsibility not just for us six but for many states in the world … that have legitimate security concerns about the development of the Iranian nuclear programme,” he said.

An extension could be perilous for the long and complex diplomatic effort to resolve the 12-year standoff over that programme. A new US Congress is scheduled to take office on 6 January. It will be dominated by Republicans who criticise the diplomacy as an excuse for Iran to fend off new sanctions while keeping its nuclear infrastructure intact. The Republicans have threatened to impose new sanctions, which could trigger a backlash from hardliners in Tehran who have been equally critical of the negotiations.

Addressing the press after the talks, Kerry said he hoped Congress “will come to see the wisdom of leaving us the equilibrium for a few months to be able to proceed. We certainly stand prepared to work with Congress in every way possible.”

He added that it was “premature” to talk about a presidential veto.”

An escalation could reverse the progress made in last November’s interim deal, the terms of which have been extended until the end of June. Hammond said those arrangements would be extended until June 30, with Iran continuing to draw $700 million a year.

“I think we are beginning to understand each other and each others positions and the challenges that we all face. Everyone is going to have to show some flexibility to get an agreement,” he said.

Ali Vaez, an Iran analyst at the International Crisis Group, said: “Both sides now know what their real positions, incentives of success, and disincentives of failure are. The window between now and when the new Congress takes power is the best opportunity to clinch the elusive deal.”