Patrick Pouyanné, the chairman and chief executive of the French energy giant Total, worried for months that a breakthrough deal to invest in Iran might not be finalized.

He fretted in particular that the Trump administration would try to scrap the 2015 international agreement over Tehran’s nuclear program. “If one party is going out of the treaty, then we will not be able to invest,” he said in an interview in February.

On Monday, though, Mr. Pouyanné was comfortable enough with the risks to sign an agreement in Tehran committing his company to lead a natural gas project in the Persian Gulf that could open Iran’s huge petroleum reserves to international players.

The decision has far-reaching implications, not least setting a path that other Western energy companies could soon follow, and possibly giving Total an inside track for future contracts in Iran. But it also exposes the company to risk if Mr. Trump reneges on the Iran nuclear deal, or if the United States imposes further sanctions against Tehran.