It marks a major breakthrough in a 12-year standoff between Iran and the West, which has long feared Tehran wants to build a nuclear bomb.
US President Barack Obama welcomed the “historic understanding” with Iran but cautioned more work needed to be done.
“If Iran cheats, the world will know it,” he said in a televised address from the White House.
After eight days of talks that sometimes went through the night, Iran agreed to curtail its nuclear programme in return for the lifting of punishing sanctions, said EU foreign policy chief Federica Mogherini.
HUGE thanks to our terrific team of U.S. diplomats and experts. Simply could not do #IranTalks without them.
— John Kerry (@JohnKerry) April 2, 2015
The main outlines agreed at the negotiations in the Swiss city of Lausanne now have to be finalised in a highly complex agreement by June 30.
US Secretary of State John Kerry hailed a “big day”, saying on Twitter that the global powers and Iran “now have parameters to resolve major issues on nuclear program. Back to work soon on a final deal”.
Iranian President Hassan Rouhani said the drafting of a full agreement would begin immediately with the aim of completing it by the June 30 deadline.
Iranian media said the deal will include Iran slashing by two-thirds, to 6,000 from 19,000, the number of centrifuges, which can make fuel for nuclear power but also the core of a nuclear bomb.
Mogherini said the United States and the EU will lift all nuclear-related sanctions on Iran once the UN atomic agency has verified that Tehran has stuck to the ground-breaking deal.
Mogherini, in a joint press statement with Iranian Foreign Minister Mohammad Javad Zarif, also said that the design of a new reactor will be changed so that no weapons-grade plutonium can be produced.
The Fordo facility, built deep into a mountain, will remain open but will not be used for enrichment but for research and development.
The so-called P5+1 group — the United States, Britain, China, France and Russia plus Germany — hope that the deal will make it virtually impossible for Iran to make nuclear weapons under the guise of its civilian programme.
Sanctions ‘can be reimposed’
France warned that the sanctions could be reimposed if Tehran does not fully keep its side of the bargain.
“Sanctions that are lifted can be reimposed if the deal is not applied,” the office of President Francois Hollande said in a statement, adding that Paris would watch closely to ensure a “credible” and “verifiable” final agreement that prevents Iran from developing a nuclear weapon.
A successful implementation could put Iran and the United States on the road to better relations after 35 years of animosity.
In addition, the powers and Iran hope will finally silence all talk of military action by the United States and Israel against Iran.
Israeli Intelligence Minister Yuval Steinitz, whose country is widely assumed to have the bomb, warned before Thursday’s announcement that the “military option is on the table”.
Brigadier General Hossein Dehghan, the Iranian defence minister, said that similar comments Tuesday by Pentagon chief Ashton Carter were “designed to affect the rational atmosphere” of the nuclear talks.
The White House had said overnight that it was prepared to walk away from the talks in Lausanne.
Iranian negotiators had been under pressure from domestic hardliners not to give too much away — while also delivering on Rouhani’s promise to win the lifting of sanctions.
Obama needs a deal which he can sell to hostile Republicans in Congress, who remain sceptical of Iran’s pledges and are threatening to push for new sanctions from April 14.
Republicans and US allies like Israel and Saudi Arabia fear that if too much of Iran’s nuclear programme is left intact, it will still have the ability to obtain a nuclear bomb.
The sanctions sent the economy of OPEC member state Iran into recession but it is now reporting growth again.
With the world’s fourth biggest oil and second biggest gas reserves, the energy industry is the cornerstone of Iran’s economy, but it was hit hard by the American and European embargo imposed in 2012.