The U.S. and five other world powers sealed a sweeping accord with Iran on Tuesday to curb Tehran's nuclear activities in exchange for easing of oil and economic sanctions, setting the stage for a bitter fight in Congress and a potential transformation of the Middle East.
At the heart of the historic deal lies a harsh trade-off: If it succeeds, Iran will be blocked from building a nuclear bomb for more than a decade, easing a major security threat to the U.S. and its allies, but Iran's economic and conventional military clout will almost certainly grow in a turbulent region.
The 109-page agreement is designed to strictly limit Iran's ability to enrich uranium, prevent any production of weapons-grade plutonium and give United Nations nuclear inspectors broad powers to detect any secret nuclear activities.
The accord is one of the most consequential and controversial diplomatic achievements in decades. It brings to a close nearly two years of negotiations, capped by a 17-day marathon of intense and sometimes acrimonious bargaining that lasted into Monday night.
Critics in Congress and virtually all Republican presidential hopefuls warned that the deal will serve to empower Iran, not defang it. Israeli Prime Minister Benjamin Netanyahu, long an opponent of the diplomacy, called the agreement "an historic mistake for posterity."
If Iran meets its commitments, it will gain access to about $100 billion in frozen assets, perhaps as soon as January. Although it says it will use the money for domestic infrastructure, America's allies in the Middle East and some U.S. experts fear Tehran will boost support for its proxies and allies in Syria, Yemen, Lebanon and elsewhere.
Over time, Iran also will be free to import and export conventional arms and ballistic missiles, and see several notorious Iranian officials, including the head of the elite Quds Force of the Revolutionary Guard, removed from a United Nations blacklist.
President Obama, who has made a nuclear deal a priority for his administration, said the risk of a nuclear-armed Iran is too great and must take precedence over other concerns. He said strict monitoring will ensure that "every pathway to a nuclear weapon" is cut off.
"This deal is not built on trust," Obama said in the East Room at the White House. "It is built on verification."
Obama vowed to veto any legislation in Congress that could scuttle the accord, saying it "would be irresponsible to walk away from this deal."
The alternative, he warned, means "a greater chance of more war in the Middle East."
That's precisely the danger his critics say the Islamic Republic will present if the deal goes forward. They fear that Iran, once it is free of sanctions and other restrictions, will emerge stronger than ever and will resume its quest for nuclear weapons.
Obama later spoke by phone with Netanyahu and King Salman of Saudi Arabia, as well as President Francois Hollande of France, Chancellor Angela Merkel of Germany, Prime Minister David Cameron of Britain and other key leaders.
In Tehran, where Obama's remarks were televised live before Iranian President Hassan Rouhani announced the deal, people poured into the streets, waving flags, chanting "Freedom!" and honking horns to celebrate.
Gathering after the beginning of Iftar, the daily breaking of the Ramadan fast, many people said they hoped for an end to Iran's years of isolation and the sanctions that have caused widespread hardship.
"It's another revolution! Be happy!" a group of girls shouted, music blaring from their car.
The final talks proved more difficult than expected as officials from Iran and the six-nation diplomatic bloc — the U.S., Britain, France, Germany, Russia and China — wrangled over the U.N. Security Council resolution that will set out a blueprint for the new agreement, including easing of sanctions.
The Security Council is expected to approve that resolution within weeks.
The last-minute haggling dealt with Iran's demand — backed by Russia — for the end to U.N. embargoes on its trade in ballistic missiles and conventional arms. Under the agreement, the arms embargo will be lifted in five years, and the missile embargo in eight.
Both embargoes could be eliminated early if the U.N. nuclear watchdog agency, the International Atomic Energy Agency, determines Iran's nuclear program is entirely peaceful and in compliance with international rules. But such determinations take time.
The final accord was built on concessions by both sides. The Obama administration dropped its opposition to Iran's production of any enriched uranium, abandoned demands that Iran roll back its missile program and stopped calling for complete dismantling of Iran's nuclear infrastructure.
Iran, in turn, gave ground by agreeing to give the IAEA wide access to nuclear sites and scientists. It also acceded to restrictions that will last years longer than it was originally willing to accept, and settled for a smaller inventory of uranium-enriching centrifuges than it had demanded.
The restrictions and inspections are designed to lengthen the so-called breakout period, the time Iran would need to build a nuclear bomb if its leaders decided to do so.
U.S. intelligence agencies believe Iran's current breakout time is two to three months. The deal would extend that to at least a year, which Obama says is enough time for the U.S. to respond — militarily, if necessary.
During the final talks, the U.S. and its allies won significant battles over how to resolve disputes over inspectors' access to nuclear facilities and the ability to "snap back" sanctions if Iran tries to cheat.
Those trade-offs won support from some nonproliferation experts who had remained undecided or skeptical until now.
Robert Einhorn, a former top administration advisor on Iran, who had been uncommitted on the deal, said the agreement will reduce Iran's key nuclear infrastructure and allow unprecedented monitoring of nuclear activities.
"Taken as a whole, the deal will achieve the administration's stated objective of preventing a nuclear-armed Iran for a 10-to-15-year period," said Einhorn, now with the Brookings Institution.
The deal will shrink the number of centrifuges Iran has installed by two-thirds, require it to give up 98% of its stockpile of low-enriched uranium, and halt production of medium-enriched uranium, which can be turned into bomb fuel.
Iran also pledged not to undertake activities associated with nuclear weapons development, such as computer modeling of nuclear explosions and experiments with certain sophisticated detonators.
The U.S. and its allies in the talks gained ground in a tough struggle over U.N. inspectors' access to Iran's military sites.
The agreement sets up a system under which the IAEA can turn to a joint commission to adjudicate disputes if Iran refuses to allow inspectors in.
That commission will have eight members, representing Iran, the six powers and the European Union. A simple majority will rule on access questions so that the U.S. and European allies will be in a strong position to prevent Russia, China and Iran from blocking inspections.
Disputes over access must be decided within 24 days under the agreement. U.S. officials say that doesn't give Iran enough time to hide major infractions, such as attempts to build a uranium enrichment plant.
The sanctions will not be eased until Iran has complied with its obligations under the agreement. The Iranians had demanded sanctions relief at the outset.
Another key battle involved how to put sanctions back into place if Iran is caught in clear violation of its commitments.
The Security Council resolution that will lay out the deal will suspend, but not terminate, U.N. sanctions once Iran comes into compliance with the terms of the deal.
If a Security Council member believes Iran has violated the agreement, it can force a vote within 65 days on whether to continue the suspension. The U.S. or another Security Council member could veto that vote, however, and reinstate the sanctions.
That is "an effective snap-back mechanism that the Russians and Chinese can't block," said Ilan Goldenberg, a former Obama administration official now with the Center for a New American Security, a think tank in Washington.
The group also worked out a compromise on the sensitive issue of Iran's suspected research on nuclear weapons.
Iran has not wanted to confess to previous violations of nuclear agreements. Under the deal, it will have to perform a list of specified tasks to give the IAEA more information about its efforts.
The sanctions won't be lifted until the IAEA certifies that Iran has fulfilled its requirements. The specified tasks are limited, however, and won't require Iran to fully come clean on its past activities, diplomats acknowledge.
Once the IAEA has verified that Iran has met its obligations, the United States and European Union will quickly suspend sanctions that have cut 1 million barrels a day from Iran's oil sales and severed it from the international financial system.
On this "implementation day," Iran will be able to sell oil, rejoin the international financial system and gain access to tens of billions of dollars in overseas accounts.
U.S. officials have said it may take Iran six months to get to that point. But a senior Iranian official told reporters that the country could do it all in "a matter of weeks."
As details of the agreement became public, congressional reaction fell quickly along expected lines.
House Speaker John A. Boehner (R-Ohio), who bypassed the White House this year by inviting Netanyahu to criticize the deal in an address to Congress, promised a fight.
"This isn't about Republicans versus Democrats," Boehner said. "We will fight a bad deal that is wrong for our national security and wrong for our country."
Congress will have 60 days to review the deal, and the Republican majorities in both houses will try to pass a resolution disapproving it.
But Republicans will need some Democratic support to get a disapproval measure through the Senate and may not have the votes. In any case, they are not expected to have the votes to override Obama's promised veto.
After Democratic presidential front-runner Hillary Rodham Clinton expressed support for the deal, few Democrats stood up publicly to oppose it.
Obama has authority to waive most U.S. economic sanctions without congressional approval, although the restrictions would remain on the books unless Congress votes to remove them.
Times staff writers Christi Parsons and Lisa Mascaro in Washington and Sarah Parvini in Los Angeles and special correspondent Ramin Mostaghim in Tehran contributed to this report.