Iran has struck a historic agreement with the US and five other world powers, accepting strict constraints on its nuclear programme for the first time in a decade in exchange for partial relief from sanctions.

The deal, signed at 4.30am on Sunday morning, marks arguably the most significant foreign policy achievement of Barack Obama's presidency, amounting to the most significant agreement between Washington and Tehran since the 1979 Iranian revolution.

The move is intended as the first step in a six-month process aimed at a permanent resolution to the decade-old global impasse over Iran's nuclear programme, and heading off the threat of a new war in the Middle East.

"While today's announcement is just a first step, it achieves a great deal," President 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."

The Geneva 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 it has agreed to:

• stop enriching uranium above 5%, reactor-grade, and dilute its stock of 20%-enriched uranium or convert it to oxide, which makes it harder to enrich further. The medium-enriched uranium, in its hexafluoride gas form, is relatively easy to turn into weapons-grade material, so it is a major proliferation concern.

• not to increase its stockpile of low-enrichment uranium.

• 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.

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

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 that 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.

Iran's Gulf Arab adversaries, nervous of the rehabilitation of their long-standing regional rival, were tight-lipped about the agreement. Not so Israel, which warned that the agreement had made the world more dangerous.

"Today the world has become a much more dangerous place because the most dangerous regime in the world took a significant step towards obtaining the world's most dangerous weapon," the prime minister, Benjamin Netanyahu, told a weekly cabinet meeting.

The US secretary of state, John Kerry, and his Iranian counterpart, Mohammad Javad Zarif, spent much of the three rounds of negotiations since September, closeted together in intense discussions, a dramatic break from the previous 34 years when there was barely any official contact between the two countries.

"This is only a first step," Zarif told a news conference. "We need to start moving in the direction of restoring confidence, a direction in which we have managed to move against in the past."

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.

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 British prime minister, 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".

The difficulties facing the negotiators in the coming months were highlighted by the different interpretations Kerry and Zarif took on the fiercely disputed issue of whether the deal represented a recognition of Iran's right to enrich uranium in principle. Zarif was insistent that it did because it was based on the nuclear non-proliferation treaty (NPT), which guarantees the right to a peaceful nuclear programme. Kerry said that neither the NPT nor Sunday's deal specifies a right to enrichment. That, he said, was a matter for negotiation in the coming six months.

News of the deal united Iranians from across the political spectrum in celebration, reflecting widespread hope that it would reduce the threat of war and ease punishing sanctions. Hundreds of thousands of people stayed up through the night to follow the minute-by-minute coverage of negotiations on satellite television, Facebook and Twitter.

The first announcement that a deal had been reached, by Ashton's spokesman Michael Mann, and the confirmation by Zarif, were both made on Twitter – a first for a major global accord.

"Day five, 3am, it's white smoke," tweeted the deputy Iranian foreign minister, Seyyed Abbas Araghchi, referring to the terminology used in Vatican for the announcement of a new pope.