As US President Donald Trump lashes out at "the worst deal ever", those involved in crafting the landmark 2015 agreement may well be thinking of the blood, literally, and sweat they poured into it.
The agreement, designed to ensure that Tehran does not develop a nuclear bomb, was the culmination of a diplomatic drive bringing together seven countries; Iran, the United States, Russia, China, France, Britain and Germany.
Iran's nuclear programme had been a topic of heated international debate since 2003, but early talks with Europe skidded off track as international powers heaped sanctions on Tehran.
But in 2012 the US, whose president Barack Obama had made improved relations with Tehran a priority, began secret talks with Iran in Oman.
And the election in 2013 of a moderate Iranian president, Hassan Rouhani, opened the way for world powers to start more formal negotiations.
Diplomats began shuttling from Geneva to New York to Vienna, an exhausting saga punctuated by psychodramas and mutual suspicions.
Simple on paper, the objective was to limit Iran's use of nuclear technology strictly to civil and peaceful purposes in exchange for the lifting of sanctions.
In reality there were a host of complex technical issues that needed to be resolved.
Ministers attending the talks would soon find themselves experts on questions such as how many uranium centrifuges Iran should be allowed to have.
"I've seen them talk about uranium hexafluoride and heavy-water reactors without even blinking," a Western diplomat said at the time.
The negotiations inched forward, sometimes in a climate of deep mistrust, unsurprising given the long enmity between the United States and the Islamic Republic.
"There is no trust. We think they're lying to us, they think we're lying to them," a European source said in September 2014.
'Never threaten an Iranian'
The talks pitted the indefatigable John Kerry, the US secretary of state at the time, against his smiling but steely Iranian counterpart Mohammad Javad Zarif, a former UN ambassador considered a master of diplomacy.
As the talks dragged on in Vienna and in Lausanne, Switzerland, the opposing sides slowly got to know one other.
Zarif and Kerry were soon on a first-name basis; a photo of them out on a stroll together in Geneva sparked fury among Iranian hardliners.
"We have two countries that haven't talked to each other for 35 years passing all this time together. It's gratifying to see how much trust has been built," a senior European official said.
But there were furious fights and slammed doors during the all-nighters in Swiss palaces.
Depending on the day, a deal was judged either imminent or impossible.
"It's hard, there's no compromise. There are moments of great fun and high tension," a European negotiator said.
One particularly testy outburst from Zarif, when he shouted "never threaten an Iranian" at EU diplomatic chief Federica Mogherini, sparked a rash of internet memes.
There were even physical injuries when Kerry, taking a break from a session in Geneva in June 2015, broke his leg in a bike accident on a mountain road.
His chief negotiator Wendy Sherman broke her nose in several places, spraying blood everywhere, after walking into a glass door. She also twisted an ankle and broke a finger during the talks.
She later confessed, after all the trips to Vienna, that it would be a long time before she fancied another plate of wiener schnitzel, the breaded veal that is an Austrian speciality.
There were many clashes of ego -- notably between Kerry and France's foreign minister at the time, Laurent Fabius, who suspected his American counterpart of being too willing to make concessions.
Kerry for his part accused Fabius of sabre-rattling.
After finally clinching the deal in 2015, Kerry admitted to CNN that the negotiations had been "very tough, very intense at times, sometimes emotional and confrontational".
But he has spoken repeatedly of his respect for Zarif, a "very capable negotiator, a patriot all the time, who fought hard for his nation's interests".