But on May 8 last year, US President Donald Trump pulled the United States out of the breakthrough agreement and announced he was reimposing sanctions.
Here is some background on the accord:
Negotiations start in June 2013 between Iran and the five permanent members of the UN Security Council -- Britain, China, France, Russia and the United States -- plus Germany.
The final deal is reached on July 14, 2015 after 21 months of tough discussions.
The goal of the deal is to render it practically impossible for Iran to build an atom bomb, while at the same time allowing it to pursue a civilian nuclear programme.
As part of the agreement, Tehran pledges to reduce its nuclear capacities for several years.
It agrees to slash the number of centrifuges, which can enrich uranium for nuclear fuel as well as for nuclear weapons, from more than 19,000 to 5,060 and to maintain that level for a decade.
It also accepts to modify its heavy water reactor in Arak, under the control of the international community, to make it impossible to produce plutonium at the reactor for military use.
The deal comes into effect on January 16, 2016.
The International Atomic Energy Agency (IAEA) is charged with regular inspections of facilities such as uranium mines and centrifuge workshops for up to 25 years.
In August 2018, the IAEA says Tehran is sticking to the terms of the deal, but emphasises the importance of Iran's "timely and proactive cooperation in providing such access" to sites and locations.
The accord paves the way for a partial lifting of international sanctions on Iran, opening the door to foreign investors -- French energy giant Total and carmakers PSA and Renault all strike deals.
UN embargoes on the sale of conventional arms and on ballistic missiles to Iran are however maintained up to 2020 and 2023 respectively.
Pakistan stands by Iran on nuclear deal issue
In October 2017, Trump refuses to certify that Iran is respecting its commitments on the agreement, but stops short of re-imposing sanctions or abandoning the deal.
Trump again waives sanctions in January, but demands that European partners "fix the terrible flaws" in the accord.
On May 8, he announces the United States is pulling out of the agreement and will reimpose sanctions on Iran as well as all companies with ties to the Islamic republic.
Iran's Rouhani urges unity in face of US 'war on hope'
On August 7, Washington reimposes the first set of "the most biting sanctions ever" -- although they are in fact simply a reimposition of sanctions in place prior to the nuclear deal.
They target access to US banknotes and key industries such as cars and carpets.
A second tranche of sanctions kicks in on November 5, this time targeting Iran's vital oil sector and central bank transactions.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ