A historic agreement on Iran's nuclear programme was made possible by months of unprecedented secret meetings between US and Iranian officials, in further signs of the accelerating detente between two of the world's most adversarial powers, it emerged on Sunday.

The meetings ran parallel to official negotiations involving five other world powers, and helped pave the way for the interim deal signed in Geneva in the early hours of Sunday morning, in which Iran accepted strict constraints on its nuclear programme for the first time in a decade in exchange for partial relief from sanctions.

The Obama administration asked journalists not to publish details they had uncovered of the secret diplomacy until the Geneva talks were over for fear of derailing them. The Associated Press and a Washington-based news website, Al-Monitor, finally did so on Sunday.

The nuclear agreement – arguably the most important foreign policy achievement of Barack Obama's presidency – was struck at 4.30am at a Geneva hotel on day five of the third round of intensive talks. It amounts to the most significant agreement between Washington and Tehran since the 1979 Iranian revolution.

The deal releases just over $4bn in Iranian oil sales revenue from frozen accounts, and suspends restrictions on the country's trade in gold, petrochemicals, car and plane parts. In return, Iran undertakes to restrict its nuclear activities. Over the next six months Iran has agreed:

• To stop enriching uranium above 5% reactor-grade, and dilute its stock of 20%-enriched uranium – a major proliferation concern.

• Not to increase its stockpile of low-enriched uranium.

• To freeze its enrichment capacity by not installing any more centrifuges, leaving more than half of its existing 16,000 centrifuges inoperable.

• Not to fuel or to commission the heavy-water reactor it is building in Arak or build a reprocessing plant that could produce plutonium from the spent fuel.

• To accept more intrusive nuclear inspections by the International Atomic Energy Agency, including daily visits to some facilities.

"While today's announcement is just a first step, it achieves a great deal," Obama said in an address from the White House. "For the first time in nearly a decade, we have halted the progress of the Iranian nuclear programme, and key parts of the programme will be rolled back."

Iran welcomed its negotiators as heroes at Tehran's Mehrabad airport. Its currency, the rial, which has been pulverised by a gruelling succession of economic sanctions, jumped more than 3%. "This is only a first step," Mohammad Javad Zarif, the foreign affairs minister, said. "We need to start moving in the direction of restoring confidence, a direction in which we have managed to move against in the past."

But there was silence from Iran's regional rival Saudi Arabia and dismal warnings from Israel that the deal would merely embolden its fiercest adversary. "Today the world has become a much more dangerous place because the most dangerous regime in the world has taken a significant step toward attaining the most dangerous weapon in the world," said Israel's prime minister, Binyamin Netanyahu.

David Cameron said the deal "demonstrates how persistent diplomacy and tough sanctions can together help us to advance our national interest". In a tweet from Downing Street, he said: "Good progress on iran - nowhere near the end but a sign pressure works".

Sunday morning's deal was agreed after a diplomatic marathon of three intensive rounds, culminating in a late-night session in the conference rooms of a five-star hotel in Geneva, chaired by the EU's foreign policy chief, Catherine Ashton, a former Labour peer and CND official, for whom the deal represents a personal triumph.

Last night, it was announced that Obama has phoned Netanyahu to discuss the deal with Iran. White House spokesman Josh Earnest told reporters travelling on Air Force One with Obama that the US "looks forward to consulting with its ally Israel on international negotiations with Tehran". Earnest says the White House understands Israel's scepticism.

Britain's foreign secretary, William Hague, the French foreign minister, Laurent Fabius, and their German, Russian and Chinese counterparts, Guido Westerwelle, Sergey Lavrov and Wang Yi, also took part in a six-nation group mandated by the UN security council to handle the nuclear negotiations since 2006. Some of the complications involved in coming to a deal stemmed from the need to keep the six powers together.

However, the key overnight sessions that clinched the deal involved Kerry, Zarif and Ashton alone.

"This deal actually rolls back the programme from where it is today," Kerry said. However, he added: "I will not stand here in some triumphal moment and claim that this is an end in itself."

The bigger task, he said, was to go forward and negotiate a comprehensive deal.

The six-month life of the Geneva deal is intended to be used to negotiate a comprehensive and permanent settlement that would allow Iran to pursue a peaceful programme, almost certainly including enrichment, but under long-term limits and intrusive monitoring that would reassure the world any parallel covert programme would be spotted and stopped well before Iran could make a bomb.

That agreement would lead to the lifting of the main sanctions on oil and banking that have all but crippled the Iranian economy, and the eventual normalisation of relations between Iran and the US for the first time since the 1979 Islamic revolution.

The difficulties facing the negotiators in the coming months were highlighted by the different interpretations that Zarif and his US counterpart, John Kerry, had over the fiercely disputed issue of whether the deal represented a recognition of Iran's right to enrich uranium in principle. Zarif pointed to a line in the preamble in the text which said that an eventual comprehensive settlement "would involve a mutually defined enrichment programme with practical limits and transparency measures". American argued that the phrase "mutually defined" implied Iran would still require international consent to pursue enrichment.

The Associated Press said preliminary and secret talks were held in Oman and other locations. The US envoys for the meetings were the deputy secretary of state, William Burns, and Jake Sullivan, a foreign policy adviser to Joe Biden. Al-Monitor reported that a senior national security council official, Puneet Talwar, also took part. AP said there had been five meetings since March, implying the first contacts came three months before the election of the reformist Hassan Rouhani as president. It is not clear which Iranian officials were involved in the talks.

The talks help explain why the US and Iran were able to strike a deal relatively quickly after Rouhani's election. But it also helps explain the irritation of the French foreign minister, Laurent Fabius, at the previous round of negotiations a fortnight ago when he was presented with an agreement that the US and Iran had worked out independently.