As we watch with horror and sadness the extreme devastation associated with Russia’s ongoing attack on Ukraine — with perhaps 10 million displaced and up to 20,000  killed to date — another potential casualty of this conflict is the Nuclear Non-Proliferation Treaty and the general international effort to prevent the spread of nuclear weapons.

Alas, though some arms control advocates would like to argue that the only purpose of nuclear weapons is to deter a nuclear attack on one’s territory, recent world events confirm that nuclear weapons can have another plausible purpose for some countries. For smaller or weaker states, owning nuclear weapons helps ensure that a large country will not be able to attack them and overthrow their government. Or, at least, the converse is true — NOT having nukes clearly leaves one vulnerable.

Just ask Saddam Hussein, who did not have nuclear weapons, about the 2003 Iraq war. Or Moammar Gadhafi, who also did not have nuclear weapons, about the 2011 NATO air campaign launched against Libya after he threatened to exterminate domestic opponents. Of course, we cannot really ask them — because not only are their regimes gone, they are dead, as a direct consequence of wars that they could not deter with conventional arms alone.

Watching all this, Kim Jong Un had already made the calculation, long before the Ukraine war, that he would cherish the North Korean nuclear weapons that his grandfather and father had bequeathed him. Our efforts to persuade him to denuclearize have failed under U.S. President Joe Biden’s four immediate predecessors, and the Biden team itself appears to be putting little effort into the quest itself, perhaps out of recognition that the task is just too hard if attempted in absolutist terms.

North Korea is not alone. Twenty four years ago we tried to persuade Pakistan not to test nuclear weapons after India had done so. Deputy Secretary of State Strobe Talbott led a team to Islamabad to make the case. Then Pakistani Prime Minister Nawaz Sharif reluctantly said he had no choice, and, buoyed by Saudi money and his Chinese ally, Pakistan tested.

Now we watch a Ukrainian regime vilified as “Nazi” in nature by Russian propaganda fighting for its territory, as well as its existence as a country — and indeed the personal survival of its leadership. Can there be any doubt that Putin would prefer the dismemberment and annexation of Ukraine — Putin has repeatedly called into doubt the very concept of Ukraine as a sovereign state — and the capture or killing of its president, Volodymyr Zelenskyy, given the way Putin has demonized him? When aggressors have extremist, existential goals like these, nuclear theorists rightly argue that nuclear weapons alas CAN be relevant, for threatening unacceptable retaliation to any such attack and thereby deterring it.

At the end of the Cold War, Ukraine had the world’s third largest nuclear arsenal. The fact that, in 1994, Ukraine returned to Russia almost 2,000 nuclear weapons that it had inherited from the breakup of the Soviet Union — receiving in reply a guarantee, in the form of the Budapest Memorandum (also signed by the U.K. and U.S.) that Ukraine would not be attacked — adds insult to the injury. Presumably Kyiv would like to take that decision back, given Russia’s subsequent behavior.

Some countries will draw two lessons, neither in the interest of the United States, from this history. If you have nuclear weapons, keep them. If you don’t have them yet, get them, especially if you lack a strong defender like the United States as your ally, and if you have beef with a big country that could plausibly lead to war.

Thinking through similar hypothetical scenarios 60 years ago, President John F. Kennedy predicted that there would be at least 25 nuclear weapons powers in the course of the 20th century. Luckily, he was wrong, and today we still have only nine. But the reasons for Kennedy’s fears persist; in fact, recent events have exacerbated and magnified them.

There is no simple solution to this problem, and we certainly do not propose that the United States enter the Ukraine war and fight a nuclear superpower today to reduce the risks of nuclear nonproliferation tomorrow. That would be oxymoronic in the extreme.

However, there are other more practical implications of this analysis. One is clearly that the Biden team and U.S. government, more broadly, should be working as hard as possible, not only to help Ukraine defend itself, but to seek a diplomatic solution to the conflict that preserves intact most or all of Ukraine’s territory as well as its government. Otherwise, beyond the further damage done to Ukraine and its people, the resulting precedent will be terrible for the cause of nuclear nonproliferation. Second, we need to be more careful about promising alliance expansion when we don’t really mean it. NATO proposed, back in 2008, that Ukraine would someday be invited to join the alliance — but with no timetable and no interim security guarantee. That had the net effect of painting a bullseye on Kyiv’s back that Russia has now targeted. Third, where we do have allies and alliances, we need to be resolute and consistent in conveying our seriousness about defending them. Biden is doing this latter job well, but his predecessor did not.

If we fail in these efforts, Kennedy’s prediction about the spread of nuclear weapons may wind up just being premature, not wrong. That would be a very dangerous and regrettable outcome for the future of international security.