In all these scenarios, the United States will be seen as undermining the deal and provoking Iran to walk away from its obligations. The sympathy of the rest of the world in this case will be with the Iranians.

It will be Mr. Trump, as president, who will have to deal with these repercussions. Because the international coalition that previously supported sanctions on Iran will not be put back together, America’s economic leverage on Iran will be much weaker, increasing the likelihood that Iran will ramp up its nuclear program, and in turn, increasing the risk of American military action.

On Nov. 14, 28 European leaders unanimously reiterated their “resolute commitment” to the deal regardless of the outcome of the American election. Heads of state from the other five countries that negotiated the agreement with Iran would undoubtedly feel personally betrayed by the American president’s withdrawal. This is likely to put the United States in a confrontation with Russia, China and Europe not just on Iran but on other issues where Mr. Trump will need their cooperation, like the Syrian war.

If the United States president or Congress is viewed as sabotaging the deal, the European Union, together with Russia and China, must attempt to salvage its key nuclear restrictions by offering meaningful sanctions relief to Iran. This will need to include the continued lifting of European banking sanctions and the oil embargo that was once imposed because of Iran’s nuclear program. It will also require bold, but not unprecedented actions to protect European companies against the enforcement of American sanctions by the Treasury Department aimed at prohibiting business with Iran.

There are steps that can be taken now to avoid the need to resort to such measures. International leaders should immediately convey to the incoming administration the importance of preserving the deal.

There is also a window before Mr. Trump’s inauguration during which world powers can cement the gains made under the agreement by resolving banking and regulatory hurdles now faced by companies seeking to execute major deals already made with Iran.

European countries, in particular, should work with Iran and the Obama administration to develop channels of communication between Tehran and Washington that will outlive President Obama’s tenure, and to send firm signals of their continued political commitment to the deal. Business leaders, too, must make clear that the nuclear deal serves both American and global security interests.

Mr. Trump’s immediate position on the Iran deal will be one of the first critical tests for his presidency. It will also test the legitimacy of the United Nations Security Council. The American public, like international leaders, should make clear to the president-elect that they do not want to become entangled in yet another military crisis in the Middle East, especially one that the world has already worked so hard to avoid.