The aim of the deal is to ensure that Iran is unable to process enough uranium for a single bomb. The negotiations have been ongoing for 18 months, with the final days of negotiations in Switzerland extended after Tuesday's deadline was missed. What has finally come out of the talks is a framework agreement which was welcomed by US President Barack Obama as a significant breakthrough.
Iran and six world powers have agreed on the number of centrifuges that can be used to enrich uranium, and Iran will have to redesign a power plant so that it cannot produce weapons-grade plutonium. It will also be subject to regular inspections.
But the devil is in the detail. As hard as it was to reach this preliminary agreement, it will be even harder to draft a final deal by the end of June.
Reaching out to Iranian hardliners who have opposed any agreement which could curb Tehran's nuclear activities, Iran's chief negotiator and foreign minister, Javed Zarif, stressed that the country will continue to have nuclear facilities.
"We are proud because we will never surrender ... but in return for the advantages that we gain, we will give things in return so we can move on," he said.
Tehran residents lined the streets as Zarif drove away from the airport in Tehran, some carrying Iranian flags, with the minister emerging from the sunroof of his car and waving to the crowd.
But Zarif is walking a very thin tightrope between satisfying the P5+1 and the hardliners in his own government.
Predictably, Israeli Prime Minister Benjamin Netanyahu is furious about the deal.
His spokesman quoted him as saying the emerging agreement takes "a very, very dangerous direction" as "it would not block Iran's path to the bomb. It would pave it".
He is worried that this accord will threaten the very existence of Israel. Even before the agreement was announced, the Israeli leader reiterated accusations that Iran has backed Shiite Muslim militants in unrest in Syria, Yemen, Iraq and Lebanon.
Netanyahu has convened an emergency meeting of security chiefs.
The other important regional player is Saudi Arabia.
Saudi King Salman told US President Obama that he hoped a final nuclear deal between world powers and Iran would strengthen regional and world security.
The Sunni Kingdom of Saudi Arabia will be nervous due to Iranian influence in Middle Eastern conflicts. Saudi Arabia has recently reasserted its own influence, leading a coalition of Gulf countries in airstrikes in Yemen against Shiite rebels there.
Future for Iran
Russia announced Friday that it is ready to provide Tehran with new reactor fuel and process spent rods.
Last November, Moscow signed accords with Iran to build two new reactors at its Bushehr plant, which was officially delivered to Tehran in 2013. It also signed protocols to construct an additional four reactors on other sites.
In terms of economic sanctions, the deal would free Iran from US trade restrictions as well as European Union sanctions which froze the assets of Iran’s central bank, banned interaction with the Iranian banking system and prevented EU members from purchasing Iranian oil.
Iran was really starting to feel the pinch due to the restrictions. Between 2011 to 2013, Iran's oil exports dropped by two-thirds. Its gross domestic product fell, inflation rose by more than 40 per cent and necessities such as food and gas became increasingly expensive for the nation’s citizens.
The lifting of sanctions could allow Iran to recoup nearly 100 billion euros in frozen oil profits.