VIENNA/Washington - Major powers clinched a historic deal aimed at ensuring Iran does not obtain the nuclear bomb, opening up Tehran’s stricken economy and potentially ending decades of bad blood with the West.

Reached on day 18 of marathon talks in Vienna on Tuesday, the accord is aimed at resolving a 13-year standoff over Iran’s nuclear ambitions after repeated diplomatic failures and threats of military action.

It was hailed by Iran, the United States, the European Union and others but branded a “historic mistake” by the Islamic republic’s archfoe Israel.

US President Barack Obama said the deal meant “every pathway to a nuclear weapon is cut off”.

“This deal demonstrates that American diplomacy can bring real and meaningful change,” he said in an address to the nation, with Vice President Joe Biden by his side.

“This deal offers an opportunity to move in a new direction. We should seize it. It’s built on verification, not trust.”

He vowed to veto any Congressional effort to block the deal, reached between Tehran and the United States, Russia, China, Britain, France and Germany.

Underscoring the tectonic shift in relations, Iranian state television broadcast Obama’s statement live, only the second such occasion since the Islamic revolution of 1979.

Iranian President Hassan Rouhani said in his own live televised address that “God has accepted the nation’s prayers”.

Rouhani told Iranians that “all our objectives” have been met by a nuclear deal agreed Tuesday after epic talks with world powers.

EU foreign policy chief Federica Mogherini described the deal as “a sign of hope” around the globe, while Russian President Vladimir Putin said the world had “breathed a huge sigh of relief”.

Syrian President Bashar al-Assad, a close ally of Iran, also offered his congratulations.

The deal puts strict limits on Iran’s nuclear activities for at least a decade and calls for stringent UN oversight, with world powers hoping this will make any dash to make an atomic bomb virtually impossible.

In return Iran will get sanctions relief although the measures can “snap back” into place if there are any violations.

The international arms embargo against Iran will remain for five years but deliveries would be possible with special permission of the UN Security Council, Moscow said.

Tehran has accepted allowing the UN atomic watchdog tightly-controlled “managed access” to military bases, an Iranian official said.

Tehran will slash by around two-thirds the number of centrifuges from around 19,000 to 6,104, an Iranian “fact sheet” confirmed.

Iranian Foreign Minister Mohammad Javad Zarif acknowledged that the agreement was “not perfect for anybody” but described it as “an important achievement”.

Painful international sanctions that have slashed the oil exports of OPEC’s fifth-largest producer by a quarter and choked its economy will be lifted and billions of dollars in frozen assets unblocked.

The deal - which was built on a framework first hammered out in April - is Obama’s crowning foreign policy achievement six years after he told Iran’s leaders that if they “unclench their fist, they will find an extended hand from us”.

It also the fruit of Rouhani’s attempts since his election in 2013 to end Iran’s isolation 35 years after the Islamic revolution.

The agreement may lead to more cooperation between Tehran and Washington at a particularly explosive time in the Middle East with the emergence last year of the Islamic State group, a common enemy, which controls swathes of Syria and Iraq.

Erasing decades of hostility will be tough, though, as seen in Iranian supreme leader Ayatollah Ali Khamenei’s July 11 comments about US “arrogance” and the burning of US and Israeli flags last week.

The prospect of better US-Iran relations alarms Saudi Arabia and other Sunni-ruled Gulf Arab states, which are deeply suspicious of Shiite Iran and accused it of stoking unrest in Syria, Yemen and elsewhere.

Israel, widely assumed to be the region’s only nuclear-armed state and which has never ruled out bombing Iran, is also unsettled, seeing the deal as too weak to stop its archfoe getting the bomb.

Israeli Prime Minister Benjamin Netanyahu on Tuesday called the deal “a historic mistake for the world”.

“We did commit to preventing Iran from acquiring nuclear weapons, and this commitment still stands,” he added in what was seen as a thinly veiled threat of pre-emptive strikes against Iranian nuclear sites.

Many in the United States agree, not least Obama’s Republican opponents who control Congress, which will have 60 days to review the agreement.

During this time Obama cannot waive Congressional sanctions, which for Iran are the most painful.

The opponents, backed by legions of lobbyists, are set to launch an intense campaign to try and secure a two-thirds majority to override a presidential veto and scupper the deal.

Even if the agreement gets past Congress - the Iranian parliament and the UN Security Council also have to approve it - implementing the accord could be a rough ride.

France said it expected UN Security Council approval “within days”.

The UN nuclear watchdog will have to verify that Iran does indeed scale down its facilities, clearing the way for the complex choreography of untangling the web of UN, US and EU sanctions.

In his press conference, President Obama said he will veto any actions by Congress to stop the agreement.

“Today, because America negotiated from a position of strength and principle, we have stopped the spread of nuclear weapons in this region.” “Because of this deal,” the president added, “the international community will be able to verify that the Islamic Republic of Iran will not develop a nuclear weapon.” “Put simply,” the president said, “no deal means the chance of more war in the Middle East.”

To opponents of the agreement in Congress, Obama said that “we don’t make deals like this with our friends.” He invoked American arms-control deals with the Soviet Union decades ago.

One of the opponents of the Iran deal, Republican Senator Tom Cotton of Arkansas, told MSNBC, an American television network, immediately after Obama spoke that the deal was dangerous. He said he believed Congress would kill the agreement.

Secretary of State John Kerry, speaking from the site of the talks in Vienna, called it “the good deal that we sought.”

“We were determined to get this right, and I believe our persistence paid off,” he said.