It also could put European allies in a bind over whether to continue the economic dealmaking they launched with Iran since the accord was implemented in early 2016. The allies have stood firmly behind the accord, which was negotiated between Iran and six world powers: the United States, Russia, China, Britain, France and Germany.
The allies could also suffer penalties under renewed US sanctions, removing incentives to continue to invest in Iran.
The leaders of Britain, Germany and France urged the US to refrain from taking action that prevents other signatories from continuing to implement it.
In a joint statement, British Prime Minister Theresa May, German Chancellor Angela Merkel and French President Emmanuel Macron urged Iran to "show restraint" and continue fulfilling its own obligations such as cooperating with inspection requirements.
They called on Washington to "ensure that the structures of the (deal) can remain intact, and to avoid taking action which obstructs its full implementation by all other parties to the deal."
In his speech, Trump accused Iran of destabilising the Middle East through its support of militant groups such as Lebanon's Hizbollah, and he charged that Tehran seeks to build "nuclear-capable" ballistic missiles.
"If I allowed this deal to stand, there would soon be a nuclear arms race in the Middle East," Trump asserted. "We cannot prevent an Iranian nuclear bomb under the decaying and rotten structure of the current agreement," he added. "The Iran deal is defective at its core."
As part of the nuclear deal, Iran pledged never to "seek, develop or acquire any nuclear weapons." Iran's supreme religious and political leader has declared nuclear weapons to be un-Islamic, saying that its nuclear programme is aimed solely at producing energy and conducting medical research.
Iranian leaders said that the country would stand united in the face of any new sanctions or threats from the United States.
Iran "could face some problems" if Trump restores sanctions, Iranian President Hassan Rouhani said at a petroleum conference in the capital, Tehran, before Trump announced his decision. "But we will move on."
"If we are under sanctions or not, we should stand on our feet," the Reuters news agency quoted him as saying.
Rouhani's first vice-president, Eshaq Jahangiri, said the Government has "a plan for managing the country under any circumstances."
In remarks reported by Iran's Tasnim News Agency, Jahangiri, a popular reformist, said it would be "naive" to enter into negotiations with the US again.
The comments underscored a growing debate among political factions in Iran over what to do if after the US withdrawal. Some politicians have urged the government to continue to work with Europe to salvage the accord, which lifted key international sanctions in exchange for curbs on Iran's nuclear programme.
"If the Europeans are willing to give us sufficient guarantees, it makes sense for us to stay in the deal," the deputy speaker of Iran's Parliament, Ali Motahari, said in remarks carried by the Iranian Students' News Agency.
Motahari said Iran should wait several months to see whether Europe plans to resist US pressure to disengage from the Iranian economy, where European companies have invested in sectors ranging from auto manufacturing to oil exploration and tourism.
If Europe succeeds, "this is a victory for Iran, because it will have created a gap between the United States and Europe," he said.
But others have been less forgiving, urging Iran's leaders to immediately withdraw and restart suspended elements of the country's nuclear programme if the US left the deal. Fliers circulating online called for a rally in Iran's northeastern city of Mashhad to "set the JCPOA on fire." The nuclear deal is also known as the JCPOA, or Joint Comprehensive Plan of Action.
The Iranian parliament's Nuclear Committee published three actions that the Government could take if Trump leaves the deal, including installing more centrifuges and enriching uranium beyond the levels allowed under the accord. Enriched uranium can be used as fuel for nuclear power plants or - if enriched at much higher levels - as fissile material for nuclear weapons.
If Trump confronts Iran, "we will not remain passive," the head of the National Security Council, Ali Shamkhani, said in an interview with the Hamshahri newspaper.
He said Europe made a mistake when its leaders appeased Trump by attempting to extract further concessions from Iran, including a potential halt to its ballistic missile programme. The nuclear deal was the result of painstaking negotiations over two years between the Rouhani Administration and the world powers, including the Obama Administration.
While Iran accepted severe limits to its nuclear programme, including inspections, critics said the deal failed to address other problematic aspects of Iranian policy, including its missile development and support for militant groups in Iraq and Syria.
"The Islamic Republic will stand firmly against this threat," Shamkhani said of the Trump Administration's stance.
Even as Iranian leaders vowed to weather the storm, Iran's economy was already feeling the strain. The Iranian rial was trading at near record lows against the dollar, as Iranians looked to buy hard currency, economists said.
According to Pratibha Thaker, an Iran expert at the Economist Intelligence Unit, a risk analysis group, Trump's withdrawal from the pact would accelerate regional insecurity, cause a dip in global oil supplies and plunge the Iranian economy into recession.
Worsening economic woes could spell trouble for Rouhani, a moderate cleric who championed the nuclear deal as a way to jump-start Iran's economy and end the country's isolation.
Rouhani staked much of his political credibility on the nuclear deal with world powers. But even as oil exports picked up in the wake of the agreement, ordinary Iranians have said they felt few tangible benefits from the accord.
Widespread economic unrest, currency fluctuations and a recent judicial ban on the popular messaging app, Telegram, have all weakened the president, analysts said. A collapse of the nuclear pact could weaken Rouhani further, giving room for hardline opponents of the accord to exert more influence.
"Rouhani is already under huge pressure," said Saeid Hasanzadeh, an Iranian analyst based in Istanbul.
He said that Iran's supreme leader, Ayatollah Ali Khamenei, who wields ultimate religious and political authority in Iran, has distanced himself enough from the nuclear deal that its failure would be blamed on Rouhani.
The supreme leader "did not take direct responsibility for the deal," Hasanzadeh said. "So the responsibility falls entirely on Rouhani's shoulders."
- additional reporting AP