LONDON (Reuters) - Both Washington’s European allies and Tehran pledged on Tuesday to uphold the 2015 Iran nuclear deal despite President Donald Trump’s decision to pull the United States out and reimpose sanctions.

European leaders decried Trump’s decision to withdraw from the deal, which had lifted sanctions against Iran in return for curbs on its nuclear program. They called on Washington not to take steps that would prevent other countries from upholding it.

Iran’s President Hassan Rouhani said Tehran aimed to continue to comply with the deal’s terms, and would swiftly reach out to the its other signatories - Britain, France, Germany, Russia and China - to keep it in place.

“Together, we emphasize our continuing commitment to the JCPoA,” the leaders of Britain, France and Germany said in a joint statement, referring to the deal by an acronym. “This agreement remains important for our shared security.”

“We urge the U.S. to ensure that the structures of the JCPoA can remain intact, and to avoid taking action which obstructs its full implementation by all other parties to the deal,” said the statement, provided by British Prime Minister Theresa May’s office after she spoke by phone to France’s President Emmanuel Macron and Germany’s Chancellor Angela Merkel.

Macron said he regretted Trump’s decision. Germany’s Foreign Minister Heiko Maas said: “We will try to keep alive this important agreement, which ensures the Middle East and the world as a whole are safer.”

Moscow said it too would focus its efforts on maintaining the accord. It called Trump’s decision “deeply disappointing”.

“There are no - and can be no - grounds for breaking” the deal, the Russian Foreign Ministry said, adding the pact had shown its “full efficiency”. “The United States is undermining international trust in the International Atomic Energy Agency.”

EU leaders are concerned that Washington could use its influence over the world’s financial system to prevent businesses in other countries that have not reimposed sanctions on Iran from doing business there.

As if to hammer home that concern, Trump’s new ambassador to Germany, who presented his credentials in Berlin earlier on Tuesday, tweeted that German businesses should halt their activities in Iran immediately.

DECISION COULD HELP IRAN HARDLINERS

In Tehran, Rouhani, a relative moderate who faced down hardliners at home to reach the agreement with world powers as part of a policy to open up the country and its economy to the outside world, decried Trump’s decision, but said Iran would stick to the deal for now, provided it still works.

“If we achieve the deal’s goals in cooperation with other members of the deal, it will remain in place,” Rouhani said in a televised speech. “I have ordered the foreign ministry to negotiate with the European countries, China and Russia in coming weeks. If at the end of this short period we conclude that we can fully benefit from the JCPoA with the cooperation of all countries, the deal would remain.”

Iranian officials told Reuters that Trump’s decision would set the stage for a resurgence of political infighting within Iran’s complex power structure.

The U.S. exit from the deal, so closely associated in Iran with Rouhani, could tip the balance of power in favor of his hardline opponents, some Iran experts said.

“They will blame Rouhani ... They will continue their shenanigans at home and abroad. And they will have the U.S. to blame for the failure of the economy,” said Abbas Milani, director of the Iranian Studies program at Stanford University.

Supreme Leader Ayatollah Ali Khamenei, who has been in power since 1989 and outranks the elected president, had said Iran would “shred” the deal if the United States pulled out.

While most U.S. allies decried the Trump administration’s decision to unravel the principal foreign policy achievement of his predecessor Barack Obama, the decision was hailed by Washington’s two main Middle East allies, Israel and Saudi Arabia, both of which long opposed the deal.

The deal was “a recipe for disaster, a disaster for our region, a disaster for the peace of the world,” Israeli Prime Minister Benjamin Netanyahu said in praising Trump’s decision.

Saudi Arabia, a Sunni Muslim power that considers Shi’ite Iran to be its main regional foe, also hailed Trump’s move.

“Iran used economic gains from the lifting of sanctions to continue its activities to destabilize the region, particularly by developing ballistic missiles and supporting terrorist groups in the region,” said a Saudi Foreign Ministry statement.

But for major European allies, also at odds with Trump over a host of other issues from trade to efforts to tackle global warming, the decision represents a decisive setback.

Britain, France and Germany had lobbied the Trump administration hard in recent weeks to keep the deal in place, arguing that it had succeeded in preventing Iran from getting nuclear weapons and that to renege on it would damage the credibility of Western countries in future negotiations.

EU countries believe it was their decision to stand with the Obama administration and impose firm sanctions against Iran’s oil and gas industry in 2011 that pushed Tehran to the negotiating table in the first place.

“The European Union is determined to preserve it,” EU foreign policy chief Federica Mogherini said of the agreement with Tehran, which she helped negotiate as coordinator for the Western countries. “Together with the rest of the international community, we will preserve this nuclear deal.”

Since the deal was signed, the EU has effectively lifted all sanctions on Iran, but Washington has kept some in place over Iran’s missile program, which was not covered by the deal. That has slowed down a promised boon for the Iranian economy, scaring off foreign investors and making it difficult for Iranian banks to forge links with the outside world.