The deal to curb Iran's nuclear weapons programme came at the end of two years of an intricate ballet, involving United States President Barack Obama and leaders of six other countries.
As the debate moved from the negotiating tables of Vienna to the halls of the US capital, Obama faced a new and complicated task: protect the agreement from opponents who would undermine it in Washington over the next two months.
For the agreement to survive, he must prevent two-thirds of either house of Congress from voting against the deal. "I will veto any legislation that prevents the successful implementation of this deal," Obama said. "Tough talk from Washington does not solve problems."
It would take two-thirds of both the House and Senate to over-ride such a veto.
Most congressional Republicans remained deeply sceptical, some openly scornful, of the prospect of relieving economic sanctions while leaving any Iranian uranium-enrichment capability intact. Even Democrats offered only cautious endorsements of the deal that represents a cornerstone of Obama's foreign policy as Congress begins a two-months review of the agreement.
House Speaker John Boehner accused Obama of abandoning his own objectives for the negotiations and called the agreement "unacceptable".
"It's going to hand a dangerous regime billions of dollars in sanctions relief while paving the way for a nuclear Iran. If it's as bad a deal as I think it is at this point, we'll do everything we can to stop it."
Senate Majority Leader Mitch McConnell said the deal "appears to fall well short of the goal we all thought was trying to be achieved, which was that Iran would not be a nuclear state".
Democratic leaders, meanwhile, mainly offered pledges to closely review the deal, rather than outright endorsements of it.
The deal caused fury in Israel and consternation around the region at the likely increase in influence and resources of a newly enriched Iran.
Most telling was the loudest expression of support. "I am happy that the Islamic Republic of Iran has achieved a great victory by reaching an agreement," President Bashar al-Assad of Syria said.
Israel and the Sunni Arab world have set aside old grievances to stand together against the West's engagement with Iran. Benjamin Netanyahu, the Israeli Prime Minister, said the country would not be bound by what he called a "stunning historic mistake".
"Israel is not bound by this deal with Iran. Iran continues to seek our destruction and we will defend ourselves."
Iranians reacted with delight and relief at news of a deal with world powers that will end years of bruising economic sanctions. President Hassan Rouhani called the pact a "new chapter" for his country.
"We were never after charity but we were after a fair exchange through talks," Rouhani said.
On the streets, the mood was upbeat, with hopes raised that the country's isolation may be at an end.
Giti, a 48-year-old engineer, said young people were optimistic the deal would boost the economy and lead to better living and more jobs.
"I moved back from the US three years ago and every business I've tried to set up has just hit a dead end, and I was thinking about going back. With the news today, I'm definitely staying."
The key points
• Iran reaffirms that it won't develop or acquire nuclear weapons.
• The IAEA will monitor and verify Iran's compliance.
• Iran and six world powers will monitor the implementation.
• Iran has agreed to eliminate 98 per cent of its enriched uranium.
• For 15 years, Iran will carry out its uranium-enrichment activities exclusively at its • Natanz facility, which will be under IAEA inspection. For the same period, it won't keep any nuclear material at Fordow. It will rebuild a modernised research reactor at Arak.
• If the IAEA identifies a suspicious site, it can ask to inspect it. And if Iran refuses, an arbitration panel will decide whether it has to open up the site to inspection within 24 days.
• Tehran won't receive any relief until it complies with the terms of the agreement, which could take months.
• Iran stands to receive more than US$100 billion in frozen overseas assets.
- AP, Telegraph Group Ltd