Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

LONDON — President Donald Trump’s decision to pull out of the Iran nuclear deal has left foreign firms with a choice: Stop doing business in Iran or run the risk of U.S. sanctions.

Multinational companies have billions of dollars tied up in Iran.

In 2016, the European Union exported more than €8.2 billion ($9.7 billion) worth of goods to Iran, while importing almost €5.5 billion ($6.5 billion) from there, according to the European Commission.

But Richard Grenell, the U.S. ambassador to Germany, warned firms that continue to do business there would face consequences.

“U.S. sanctions will target critical sectors of Iran’s economy. German companies doing business in Iran should wind down operations immediately,” he tweeted Tuesday night.

The Federation of German Industries said any attempt to prevent firms from dealing with Iran is contrary to international law. It called on the European Union to “effectively protect European companies from the effects of illegitimate and one-sided implementation of U.S. sanctions.”

Carl Bildt, the former leader of Sweden who is now co-chair of the European Council on Foreign Relations, highlighted that the sanctions would have the biggest impact beyond America's borders.

"U.S. Iran sanctions are hardly hitting any U.S. companies, but aim primarily at European ones," he said in a tweet.

Under the nuclear deal, formally known as the Joint Comprehensive Plan of Action (JCPOA), the United States committed to ease a series of sanctions on Iran and has done so under a string of “waivers” that effectively suspend them.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Virtually all multinational corporations do business or banking in the U.S., meaning any return to pre-pact sanctions could torpedo deals made after the 2015 agreement came into force.

“It’s a huge challenge,” said Dr. Sanam Vakil, a professor in the Middle East studies department at the Johns Hopkins School of Advanced International Studies in Bologna, Italy. “The U.S. economy is 10 times that of Iran in terms of size and value, so it makes more sense to do business with the U.S. than the Islamic Republic [of Iran].”

Among U.S. companies, the plane-maker Boeing has signed the biggest deals, and Treasury Secretary Steven Mnuchin said Tuesday that its existing licenses — as well as those of its European competitor, Airbus Group — would be invalidated.

In December 2016, Airbus signed a deal with Iran's national carrier, IranAir, to sell it 100 planes for around $19 billion at list prices. Boeing later struck its own deal with IranAir for 80 aircraft with a list price of some $17 billion, promising that deliveries would begin in 2017 and run until 2025. Boeing separately struck another 30-plane deal with Iran's Aseman Airlines for $3 billion.

Boeing has yet to deliver any aircraft to Iran under those deals and said that it will "continue to follow the U.S. government's lead."

Airbus, which is subject to the U.S. license because it makes at least 10 percent of its aircraft components in the U.S., says it will abide by the new U.S. sanctions but it could take "some time" to determine the full impact on the industry. It has already delivered two A330-200s and one A321 to Iran.

French oil company Total SA has been the most aggressive Western oil company to move back into Iran, signing a $5 billion, 20-year agreement with Iran in July. A Chinese oil company also has a deal to develop the country's massive South Pars offshore natural gas field. Total did not respond to requests for comment.