The Iranians had good reason to acquire nuclear weapons long before the present crisis, and there is substantial evidence they were doing just that in the early 2000s. The case for going nuclear is much more compelling today. After all, Iran now faces an existential threat from the United States, and a nuclear arsenal will go a long way toward eliminating it.

Nuclear weapons are considered the ultimate deterrent for good reason: Adversaries are unlikely to threaten the existence of a nuclear-armed state, especially one with a deterrent that can survive a first-strike attack, because that is the one circumstance in which a state is likely to use its nuclear weapons. It is hard to imagine, for example, Israel or the United States attacking Iran — even with conventional weapons — if Iran had the bomb, simply because there is some chance that escalation might lead to nuclear use. Moreover, if its survival was at stake, Iran could credibly threaten to use a few nuclear weapons to completely shut down the flow of oil in the Persian Gulf.

It might seem hard to imagine Iran using nuclear weapons first in a crisis, but history tells us that desperate states are sometimes willing to pursue exceedingly risky strategies — the Japanese decision to attack a far more powerful United States in 1941 and the Egyptian decision to strike mighty Israel in 1973 are the classic cases. The Trump administration would surely be aware of the dangers of provoking a nuclear-armed Iran. In short, nuclear weapons would profoundly alter Iran’s strategic situation for the better.

Of course, the last thing Washington, Tel Aviv and Riyadh want is for Iran to acquire the bomb. But it is hard to see how to avoid that outcome. The United States is certainly not going to invade and occupy Iran — forever — to ensure that it does not go nuclear. Hard-liners will instead advocate bombing Iran’s nuclear facilities, but the Iranians will go to great lengths to make them invulnerable to aerial attacks. Air power can delay a determined Iranian effort to get the bomb by a few years at most. It is also hard to imagine the United States bombing Iran year after year to prevent it from acquiring the bomb.

Furthermore, Mr. Trump’s policy has backed the United States into a corner, leaving no clear diplomatic offramp in sight. For obvious reasons, Iranian leaders do not trust Mr. Trump, and they surely recognize he might eventually walk away from any deal they strike with him. If Mr. Trump tries to lower tensions by easing the sanctions, which Tehran insists he must do before it will even agree to talk, he will be savaged at home by the Iran hawks, who are an important part of his political base. Israel, Saudi Arabia and the Gulf States will be equally critical.

One might argue that Iran can wait out the Trump presidency, hoping that a Democrat wins the November 2020 election. After all, virtually all the Democratic candidates are committed to returning the United States to the nuclear deal.