Iran and major global powers sealed a landmark deal to curb Tehran's nuclear program in exchange for sanctions relief, taking a giant step to end a confrontation that has poisoned ties, isolated the Islamic nation, and raised the specter of a new war in the Middle East.
"With courage, political will, mutual respect, and leadership, we delivered what the world was looking for," European Union foreign policy chief Federica Mogherini said, formally announcing a deal reached on July 14 after more than a decade of negotiations and a grueling, 18-day final push in Vienna.
U.S. President Barack Obama said the deal would cut off every pathway to a nuclear weapon for Iran, which Western governments have long suspected of seeking the capability to build a bomb, and vowed to veto any legislation in the U.S. Congress that would prevent its implementation.
"We have stopped the spread of nuclear weapons" in the Middle East, Obama said in an address in Washington that was broadcast on Iranian television.
He said the deal offered a chance to "move in a new direction" in ties with Tehran, which have been severely strained since Iran's 1979 Islamic Revolution and aggravated by its nuclear activities. "We should seize it," he added.
Iranian Foreign Minister Mohammad Javad Zarif, who was at Mogherini's side for the joint announcement, said earlier that the "historic" agreement would be a "win-win solution."
Mogherini said the deal could "open the way to a new chapter in international relations and show that diplomacy, coordination, cooperation can overcome decades of tensions and confrontation."
"I think this is a sign of hope for the entire world," she said.
After nighttime talks, diplomats said a formal agreement had been reached between Iran and six powers -- the United States, Russia, China, Britain, France, and Germany -- that have been negotiating for years to rein in activities the West fears are aimed at creating a nuclear weapon.
Iranian foe Israel swiftly denounced the deal as a dangerous mistake that would enrich and embolden Iran, and Republican opponents of Obama also criticized it, potentially setting the stage for a showdown in the U.S. Congress.
U.S. Secretary of State John Kerry, who met with Zarif nearly every day for nearly three weeks as deadlines for a deal came and went, told a news conference in Vienna that the agreement was "the good deal that we sought."
"We were determined to get this right and I believe our persistence paid off," Kerry said.
The new United Nations special rapporteur on human rights and international sanctions, Idriss Jazairy, welcomed the nuclear agreement and urged an immediate lifting of sanctions and "unilateral coercive measures" on Iran, which he said had hurt the Iranian people’s right to food, health, and development.
The Associated Press cited a senior diplomat as saying an agreement was reached after negotiators cleared final obstacles in talks that a German delegation member said at times reached the "boiling point."
WATCH: EU, Iranian Negotiators Welcome 'Historic' Nuclear Deal
Shortly before the announcement in Vienna, Rohani said on Twitter: "#IranDeal shows constructive engagement works."
"With this unnecessary crisis resolved, new horizons emerge with a focus on shared challenges," Rohani said in an apparent reference to Islamic State militants -- a common enemy of Iran, the United States, and other nations.
In a televised address to the nation, Rohani said the deal protects Iran's nuclear achievements -- a source of pride in the country, which says it is not seeking atomic weapons -- and annuls "illegal" sanctions.
He also said that if the nuclear deal “is implemented correctly...we can gradually eliminate distrust."
Russian President Vladimir Putin, whose country has been Tehran's strongest supporter in the UN Security Council and vocally opposes U.S. and EU sanctions against Iran, said the deal would contribute to combating terrorism in the Middle East.
Putin also said the deal would bolster civilian nuclear cooperation between Iran and Russia, which built the Middle Eastern nation's nuclear power plant, at Bushehr, and is planning more.
Zarif said the deal was "not perfect" for any of the sides, but added that "it is what we could accomplish, and it is an important achievement for all of us. Today could have been the end of hope on this issue. But now we are starting a new chapter of hope."
French Foreign Minister Laurent Fabius said that negotiators had reached "a sufficiently robust agreement, at least for the period of the first 10 years," and that France would watch over its implementation in spirit of "constructive firmness."
Fabius said that if Iran adheres to the deal its "breakout time" -- defined as how long it would take it to produce fissile material for one nuclear weapon, if it decided to do so -- would remain at 12 months for a decade and would be "significant" for the next five years after that.
The diplomat who spoke to the AP said the deal includes a compromise between Washington and Tehran that would allow UN inspectors to press for visits to Iranian military sites as part of their duties monitoring Iran's nuclear activities.
But access at will to any site would not necessarily be granted and could be delayed -- a situation that would open the door to disputes and is likely to be seen by critics as a sign that the global powers were not tough enough on Tehran.
According to the AP, Tehran would have the right to challenge the UN request and an arbitration board composed of Iran and the six powers would have to decide on the issue.
Citing what it said was the text of the deal, Reuters reported that it included a mechanism under which the UN nuclear watchdog, the International Atomic Energy Agency (IAEA), could get access to suspect nuclear sites within 24 days.
On other divisive issues, Reuters cited diplomats as saying sanctions limiting Iran's ballistic missile program would not be lifted for eight years under the deal, and that a UN weapons embargo would remain in place for five years.
Iran had pressed for the immediate removal of the arms embargo, with support from weapons trade partner Russia, while the United States and other Western countries wanted it in place for a longer period of time.
A U.S.-drafted UN Security Council resolution setting out timelines for Iran’s compliance with a nuclear deal could be introduced “probably as soon as next week,” a senior U.S. administration official told AFP on condition of anonymity.
The resolution is expected to enable economic retaliation if the deal is breached but is not likely to include any reference to military consequences.
However, another senior administration official said that military action will exist as a last resort.
Russian Foreign Minister Sergei Lavrov told journalists that while the arms embargo remains in place, weapons deliveries will be possible "if they clear a notification and verification process in the UN Security Council." He called it a "compromise."
Lavrov also said he hopes that in light of the deal, the United States will abandon the European anti-missile shield it is putting in place, which Washington says is meant largely to counter a potential threat from Iran. The Kremlin claims it is aimed to undermine Russia's security, and the issue is a source of persistent tension.
Another thorny issue in the talks was the pace of the removal of sanctions, and the mechanism for putting them back in place should Tehran violate the agreement.
Obama said that "sanctions will snap back into place" if Iran violates the deal, saying that means there is "incentive" for Tehran to comply.
Reuters reported that Iran had accepted a "snapback" plan that allows for the restoration of sanctions within 65 days in the event of noncompliance.
Iran's nuclear program has been a source of tension for over two decades between the West and the Islamic country, which says its atomic activities are for purely peaceful purposes including power generation.
The UN Security Council has imposed four rounds of sanctions on Iran over activities such as uranium enrichment, and the United States and EU have slapped additional punitive measures on Tehran.
The sanctions have limited energy-rich Iran's oil exports, harming its economy and increasing its anger at the West, but years of intermittent negotiations on its nuclear program bore little fruit until an interim agreement was reached in November 2013.
U.S. Secretary of State John Kerry and Zarif have met nearly every day since Kerry arrived in Vienna more than two weeks ago ahead of an initial June 30 deadline for a final deal.
They missed that deadline and three more amid nearly constant talks before reaching what the diplomats said was a formal agreement.
In another step toward ending the confrontation over Iran's nuclear program, Iran and the IAEA agreed on a "road map" aimed to clear up questions about Tehran's past nuclear activity.
The document, signed in Vienna on July 14 by IAEA head Yukiya Amano and Iran's nuclear chief, Ali Akbar Salehi, aims to resolve by the end of 2015 "all past and present outstanding issues that have not already been resolved by the IAEA and Iran."
Amano said that future international access to Iran's Parchin military site, which the IAEA had repeatedly sought, is part of a separate "arrangement." Salehi said Iran's "red lines" on access to Parchin had been respected, the Iranian news agency ISNA reported.
The deal is the biggest breakthrough in relations between Tehran and the West since the U.S.-backed shah was chased from Iran in the Islamic Revolution 36 years ago, but strong tensions are expected to persist nonetheless.
"Our differences are real. The difficult history between the nations cannot be ignored. It is possible to change," Obama said of U.S.-Iranian ties. "This deal offers an opportunity to move in a new direction. We should seize it."
WATCH: Israel's Netanyahu Slams Iran Deal
Israeli Prime Minister Benjamin Netanyahu, who has vocally opposed a deal, swiftly denounced it as "a bad mistake of historic proportions."
"Iran is going to receive a sure path to nuclear weapons. Many of the restrictions that were supposed to prevent it from getting there will be lifted," Netanyahu said. "Iran will get a jackpot, a cash bonanza of hundreds of billions of dollars, which will enable it to continue to pursue its aggression and terror in the region and in the world."
Israeli Deputy Foreign Minister Tzipi Hotovely called the deal "a historic surrender by the West to the axis of evil headed by Iran."
French Foreign Minister Fabius, asked whether he was concerned that Iran could use income from the removal of sanctions to seek to destabilize the region, told the daily Le Monde: "It will be one of the tests and we will be extremely vigilant."
Syrian President Bashar al-Assad, whose government has crushed pro-democracy protesters and is fighting both rebel opponents and IS militants, said he is confident that Iran -- his strongest regional backer -- will support "just causes" with greater drive following the nuclear deal.
Reuters quoted a Saudi official as saying the deal will be bad if the reduction of sanctions allows Iran to "wreak havoc" in the region.
The hard-won deal to rein in the nuclear program of a nation whose officials sometimes call the United States the "Great Satan" is a major foreign policy victory for Obama, but Republican opponents have warned it could be a hard sell in Congress.
"The deal they have struck is looking like a tough sell," Ed Royce, the Republican chairman of the U.S. House of Representatives Foreign Affairs Committee, said in a statement. He was convening a hearing on the deal on July 14.
"Instead of stopping the spread of nuclear weapons in the Middle East, this deal is likely to fuel a nuclear arms race around the world," House speaker John Boehner, also a Republican, said in a statement.
Boehner also told reporters that “if in fact it's as bad a deal as I think it is at this moment, we're going to do everything we can to stop it.”
In words he addressed to U.S. lawmakers in anticipation of such criticism, Obama said that the lack of a deal would mean "a greater chance of more war in the Middle East," and warned he would veto any legislation that would block implementation.
Congress will have 60 days to assess the deal, requiring Obama to await that review before easing some sanctions. During that time, lawmakers could try to assemble a veto-proof majority to back legislation that could impose new sanctions on Iran or keep existing ones in place.
A deal could also give a big boost to Rohani, a relative moderate who was elected in 2013 on promises to lessen the country's isolation, but it will put him under pressure to deliver economic improvements and make him even more of a target for criticism from hard-line members of the ruling establishment.
With reporting by Hanna Kaviani of RFE/RL's Radio Farda in Vienna, Reuters, AP, AFP, and TASS