Since Sunday, Ukraine’s new, built-in-chaos government has been chasing its ex-President Viktor Yanukovych around the country. He might be in Crimea; there was a helicopter and a convoy of cars, and, as the Times noted, “he was believed to have access to at least one yacht that might ferry him out of Ukraine.” He hasn’t been found yet; nor has the white Pomeranian dog in whose company he was last seen as he was leaving his very large home. This is the man who, when the weekend began, had been in charge of the country and its military. The catalogue of vehicles in which he may have fled brought to mind the closely watched trains that, twenty years ago, carried almost two thousand strategic nuclear warheads out of Ukraine, then a new country. They were being sent to Russia to be destroyed. The deal that made that exodus happen wasn’t easy; it took American brokering and a lot of money, and the burned-out barricades in Kiev and the uncertainty about who’s in charge makes one profoundly grateful for it. Better a loose President than loose warheads.

It’s worth looking back at how all this came about, and why the situation in Ukraine, as scary as it is, could be a whole lot worse. When the Union of Soviet Socialist Republics fell apart, not all of its nuclear weapons were within what’s now Russia. A lot of them were scattered in the republics that were spinning away. The Russian military (as it soon became) grabbed back the tactical, battlefield weapons, but the strategic missiles and their installations were trickier. And so Ukraine became the world’s third-largest nuclear power. Kazakhstan became a nuclear power, too; so did small, broke Belarus, which somehow found itself with eighty-one intercontinental ballistic missiles. (Kazakhstan also got the Baikonur Cosmodrome, which is why the country now has a space industry.)

It was not obvious where all these missiles would end up, particularly not in the case of Ukraine, which was stronger than the others and more sharply at odds with Russia; it thought it might find better friends. (Steven Pifer, of the Brookings Institution, has a useful review.) The new Ukrainian government also thought that Russia was not negotiating in good faith (from a certain perspective, it had absconded with Ukraine’s tactical warheads). Russia, meanwhile, suggested that the Ukrainians were not decent stewards of the weapons: they didn’t know how to take care of them, and they would deteriorate and turn into public hazards—“much worse than Chernobyl,” the Russian Foreign Minister said at the time. The disaster at Chernobyl had given the Ukrainians a look at a nuclear accident; it had also underscored a sense that Moscow was neglectful and mendacious. They also knew that I.C.B.M.s, even if they had no use for them, contained highly enriched uranium that was extremely valuable. And Ukraine needed money. In September, 1993, the negotiations between Russia and Ukraine fell apart.

The United States could have approached this in any number of ways. One might have been heedlessly, without a full understanding of the danger—gleeful about the spectacle, and glad to see the inheritors of the Soviet Union dispossessed of a few more bombs. We could have helped keep Ukraine a nuclear power, thinking that it would make the country, in some way, ours. Or we could have been excessively fearful, and supported Moscow’s contention that the Ukrainians had no right to these things, anyway, encouraging them to just go in and take them. This might have made the dissolution of the Soviet Union look a lot more like a civil war, in which our position was ambiguous. We could have postured, and lost the Cold War peace.

Instead, we offered two things. One was the Soviet Nuclear Threat Act of 1991, which was renamed Cooperative Threat Reduction two years later but is better known as Nunn-Lugar, after its sponsors. The program provided help and money—four hundred and forty million dollars the first year, a number that grew but never, compared with most defense programs, got all that big: a billion a year at most, and now it’s back to around where it started. It helped, for example, to pay the Ukrainians for the value of the uranium, fit up the train cars to carry the missiles, and destroy the silos. Throughout the former Soviet Union, it helped get nuclear scientists new jobs and security, so they wouldn’t end up working for whoever paid them. About seventy-six hundred warheads were eliminated with the help of Nunn-Lugar. These were potential strays. It is hard to think of money that has ever been better spent on defense.

But you don’t accomplish what Nunn-Lugar did just by waving dollar bills. For one thing, other actors have money, too. (“They’re broke, and these warheads were their best, their only chance to get hard currency quickly,” someone “close to the negotiations” told the Times during the talks with Ukraine in early 1994, in what could easily have been a description of why a terrorist ended up with a bomb.) Getting a deal closed between Ukraine and Russia took careful diplomacy. In January, 1994, Bill Clinton flew to Kiev, and then to Moscow, to sign a Trilateral Statement with Boris Yeltsin and Leonid Kravchuk, then the Presidents of Russia and Ukraine. It also helped that there were international structures Ukraine could accede to, and did, such as the Nuclear Non-Proliferation Treaty.

The Nunn-Lugar program is still active—it provided the umbrella under which Libya’s chemical weapons were destroyed—though Putin opted out about two years ago. As Stars and Stripes noted earlier this month, “The refitted U.S. merchant vessel MV Cape Ray is steaming toward the Mediterranean Sea to receive 560 tons of Syria’s most toxic chemical weapons. On board is a chemical-neutralizing hydrolysis system installed with funding from Nunn-Lugar.” There is, needless to say, a lot to be done.

What are the lessons for the current crisis, other than to be abjectly relieved that we don’t live in a world where nuclear weapons are even more loosely held than they are? One is to not disparage diplomacy, or treat it as a lesser form of foreign policy, or to think that there is no place for a calm middle. Another is to remember how human and fallible the actors are, and how much listening and getting a sense of their interests can help. Last week, President Obama said that it would be a mistake to see Ukraine and Syria as “some Cold War chessboard.” John McCain called him “naïve”—as if simply rushing in and talking loudly will keep either us or the Ukrainians safe. This is not a game, as fun as it can be for politicians to treat it as one. One of the frustrating elements of McCain’s complaints is his willingness to hand over weapons to people we don’t really know. Where do weapons end up when the people in control of them jump in a helicopter, a car, or a yacht and sail away to somebody else’s harbor?

Above: Ukrainian soldiers at a missile-launch facility in 1995. Photograph via Reuters.