Iran is to curb its nuclear activities in return for limited relief from sanctions.
Iran and six world powers meeting in Geneva say they have reached a deal on Tehran's nuclear programme.
Iran is to curb its nuclear activities, initially for six months, in return for limited relief from sanctions.
US President Barack Obama welcomed the deal, saying it included "substantial limitations which will help prevent Iran from building a nuclear weapon".
But Iran's Foreign Minister Mohammad Javad Zarif has insisted Iran retains its right to enrich uranium.
Tehran denies repeated claims by Western governments that it is seeking to develop nuclear weapons. It insists it must be allowed to enrich uranium to use in power stations.
Continue reading the main story
Analysis
James ReynoldsBBC Iran correspondent
The first announcement of the most important agreement between Iran and the West in more than a decade was made on Twitter. Shortly before three in the morning in Geneva, the EU posted: "We have reached agreement between the E3+3 and Iran." Minutes later, Iran's chief negotiator, Mohammad Javad Zarif followed: "We have reached an agreement."
The immediate origins of this deal date to 14 June 2013, when Hassan Rouhani was elected President of Iran. Mr Rouhani promised to end his country's repeated confrontations with the outside world, beginning with the argument over its nuclear programme.
To bring about a deal, Mr Rouhani pursued two key policies. Firstly, he secured the public backing of Supreme Leader Ayatollah Ali Khamenei for his diplomatic efforts. Secondly, the new president and his foreign minister broke precedent and pursued direct high-level contact with Iran's long time enemy, the US.
If there is to be a lasting nuclear agreement, it may spring from a reconciliation between these two countries.
'Reciprocal measures'
After four days of negotiations, representatives of the so-called P5+1 group of nations - the US, the UK, Russia, China, France and Germany - reached an agreement with Iran in the early hours of Sunday.
A final text of the deal has yet to be released, but EU foreign policy chief Baroness Catherine Ashton said it included "reciprocal measures by both sides".
She said the deal would be co-ordinated by the International Atomic Energy Agency (IAEA).
US Secretary of State John Kerry said the agreement would "make our partners in the region safer".
"It will make our ally, Israel, safer," he said.
But the Israeli government said it was a "bad agreement" that Israel did not feel bound by.
Continue reading the main story
What is the deal?
- Iran will halt uranium enrichment above 5%; neutralise stockpile of medium-enriched uranium
- Halt further development of heavy-water plant at Arak
- Increased monitoring by IAEA inspectors, including daily access at Natanz and Fordo nuclear sites
- In return, there will be no new nuclear-related sanctions for six months
- Some sanctions on precious metals and airlines to be suspended
- Allow purchases of Iranian oil to remain at their currently levels, giving Iran access to get access to $4.2bn in foreign exchange if it fulfils its commitments
Source: White House Press Office
"This is a bad agreement that gives Iran what it wanted: the partial lifting of sanctions while maintaining an essential part of its nuclear programme," said a statement issued by the office of the prime minister, Benjamin Netanyahu.
The Israeli comments came as it was revealed that the United States and Iran had held a series of secret, face-to-face talks over the past year.
According to the AP news agency, the US deputy secretary of state, William Burns, and Jake Sullivan, the senior foreign policy adviser of vice president Joe Biden, had met Iranian officials at least five times since March, with some of their talks taking place in Oman.
It said the discussions were kept hidden from America's allies, including its negotiating partners and Israel, until September. The talks were personally authorised by the US President Barack Obama, it said, as part of his effort to reach out to Iran.
Reacting to the deal in a televised address from Washington, President Obama said the measures agreed would "help prevent Iran from building a nuclear weapon".
Mr Obama outlined what the deal contained, including a commitment by Iran to halt "certain levels of enrichment and neutralising part of its stockpiles" - an apparent reference to uranium enrichment above 5% purity, which is needed to create a nuclear bomb.
In return, he said Iran would "halt work at its plutonium reactor and new inspections will provide extensive access to Iran's nuclear facilities and allow the international community to verify whether Iran is keeping its commitments".
In his news conference in Geneva, Iran's Foreign Minister Mohammad Javad Zarif said it was an opportunity for the "removal of any doubts about the exclusively peaceful nature of Iran's nuclear programme".
But he insisted that Iran had not given up its right to enrich uranium.
"We believe that the current agreement, the current plan of action as we call it, in two distinct places has a very clear reference to the fact that Iranian enrichment programme will continue and will be a part of any agreement, now and in the future," he said.
UK Foreign Secretary William Hague said the agreement was "good news for the whole world".
'Significant agreement'
Restrictions on Iran's petrochemical exports and some other sectors would be suspended, bringing in $1.5bn in revenue.
No new sanctions would be imposed for six months, the State Department said.
Separate US, EU and UN sanctions have targeted Iran's energy and banking sectors, crippling its oil-based economy.
But Mr Obama warned that if Iran fail to keep its commitments, "we will turn off the relief and ratchet up the pressure".
This deal may be the most significant agreement between the world powers and Iran for a decade, says the BBC's James Reynolds in Geneva.
Negotiators had been working since Wednesday to reach an agreement that was acceptable to both sides.
As hopes of a deal grew stronger, foreign ministers of the P5+1 joined them in Geneva.
But it only became clear that a breakthrough had been made in Geneva early on Sunday.