Negotiators are racing to complete an elusive deal on the Iranian nuclear programme before conservatives in the US and Iran can close down the talks.

The discussions have been extended until the end of June after the failure of Iran and six world powers to achieve a breakthrough in Vienna, with the aim of reaching an agreement in principle by March.

The lead negotiators, the US secretary of state, John Kerry, and the Iranian foreign minister, Mohammad Javad Zarif, emerged from the talks claiming that serious progress had been made and an accord was possible within the time allowed.

“All of us are insisting that we don’t need seven months to strike a deal, because the negotiators are going to get down to work immediately,” Zarif said.

Until Monday, the last day of negotiations, Zarif had insisted that the remaining gaps between the sides could be bridged if the midnight deadline was pushed back by a day or two. He had been encouraged by US proposals to limit Iran’s output of enriched uranium by means other than cutting centrifuge numbers, a highly political and symbolic issue in Iran and the US. Among the ideas on the table were cutting Iran’s uranium stockpile, slowing the speed of the centrifuges or reconfiguring them.

In view of the progress, Zarif was said to be surprised when the western states in the six-nation negotiating group (made up of the US, UK, France, Germany, Russia and China) suggested the seven-month extension on Sunday. According to sources close to the negotiations, the extension was proposed by France, and won backing from the White House, which overruled Kerry’s instincts to keep negotiating.

The decision to extend the talks for such a long period is a gamble. The reaction of hardliners in the US and Iran to the extension served as a reminder that the political obstacles to agreement will increase significantly.

Senator Mark Kirk, a Republican who has been one of the main promoters of congressional sanctions on Iran, claimed the prolongation of talks allowed the Iranians to continue their nuclear programme without the threat of sanctions. “The one thing the Iranians didn’t have was time, and now they have 219 days,” he said.

In Iran, hardline newspapers characterised the talks as a failure. Vatan-e Emrooz’s large one-word headline read: “Nothing”; the headline in the conservative Keyhan declared: “The sheriff [the US] is not to be trusted. Sanctions are extended.”

The extension agreement signed on Monday night gives negotiators up to four months to agree a framework, according to which Iran would accept limits on its nuclear industry in return for sanctions relief, and then a further three months for experts to work out the details so an accord can be signed.

However, diplomats at the Vienna talks said a more immediate deadline was 6 January when the new US Congress convenes for the first time since elections this month, at which Republicans won control of the Senate. After that date, the Democratic leadership will no longer be able to stop a new Iran sanctions bill from going to a vote. Furthermore, Republicans would have to win over only 12 Democrats to override a presidential veto.

Largely for this reason, Zarif has said he would like to conclude a framework deal before the end of the year.

Ilan Goldenberg, a Middle East policymaker in the State Department until last month, said if the negotiations fell short of a comprehensive deal, a second-best option would be an enhanced version of the current freeze on nuclear development and sanctions.

“The optimal solution is a comprehensive deal, but if that is not possible negotiators may opt for a more robust interim agreement with additional sanctions relief for more steps to freeze the nuclear problem,” said Goldenberg, now the Middle East security director and the Centre for a New American Security.

“Congress may try to scuttle such a deal but more likely it will pass sanctions that only kick in if the new deal is violated. This would lead to some real consternation from Iran, but probably not derail the agreement.”