FRANKFURT — European companies moved quickly to invest in Iran after it agreed in 2015 to mothball its nuclear weapons program in return for an end to economic sanctions.

Automakers like Daimler and PSA Peugeot Citroën linked up with Iranian partners to sell vehicles. Siemens of Germany struck a deal to deliver locomotives. Total of France began a project to explore offshore natural gas.

Yet even before President Trump pulled out of the agreement with Iran, many companies had already tempered their expectations and limited their investment. Now their prospects look murkier as European leaders try to determine whether there is a path forward without the United States.

Officials in Europe want to protect its companies by finding ways to shield them from American sanctions while they continue doing business in Iran.