There are two reasons to worry that President Trump might drag us into violent conflict with North Korea. First, his bouts of rage are intensifying (and his adversary, Kim Jong-un, isn’t an island of calm either). Second, he completely misunderstands the history of U.S.-North Korean relations, in a manner that moves him away from diplomacy toward war.

For instance, in the middle of the day on Saturday, Trump tweeted:

Presidents and their administrations have been talking to North Korea for 25 years, agreements made and massive amounts of money paid … hasn’t worked, agreements violated before the ink was dry, making fools of U.S. negotiators. Sorry, but only one thing will work!

Everything about this statement is wrong.

First, one of those agreements—President Clinton’s Agreed Framework of 1994—worked quite well, as far as it went, keeping nuclear weapons out of North Korea’s hands for eight years.

Second, that agreement collapsed in large part because we violated its terms.

Third, North Korea made its biggest advancements—successfully testing an atom bomb, a long-range ballistic missile, and possibly a hydrogen bomb—precisely in the years when U.S. presidents (first George W. Bush, then Trump) rejected diplomacy as a matter of principle.

Finally, if Trump thinks the “one thing” that “will work” to rid North Korea of its nukes is a military strike, it’s worth noting that it has never worked before—or, in any case, nobody has figured out how to make it work without sparking retaliation, which would kill hundreds of thousands, maybe millions, of civilians in South Korea and possibly Japan.

Let’s parse these points one by one. In 1993, the United States and North Korea nearly came to blows. North Korea was preparing to reprocess fuel rods into weapons-grade plutonium. President Clinton warned that removing the rods from storage would be a cause for war and started mobilizing forces in the region. In part at the prodding of former President Jimmy Carter, who was sent to Pyongyang as an informal envoy, Clinton and Kim Jong-il (then the leader of North Korea and the present leader’s father) signed the Agreed Framework. Under its terms, North Korea would sign the Non-Proliferation Treaty—the international agreement preventing new states from developing nuclear weapons—keep the fuel rods locked up, and permit the International Atomic Energy Agency to keep cameras and inspectors at the nuclear reactor where the plutonium would have been processed. In exchange, the U.S. would give North Korea two light-water reactors (good for electrical power but not for making weapons); the first would be delivered within three months; upon delivery of the second, the North Koreans would ship the fuel rods out of the country. Meanwhile, the two countries would initiate diplomatic relations, including the setting up of embassies.

North Korea kept its side of the bargain; the United States did not. No light-water reactors were provided. (South Korea and Japan were supposed to pay for the reactors; they didn’t, and the U.S. Congress didn’t step in.) Nor was any progress made on diplomatic recognition.

Around 1997, the North Koreans secretly struck a deal: They would give Pakistan missile technology; Pakistan would give them centrifuges and other materials to enrich uranium—another, though slower way to build an atom bomb. Many journalists and analysts have since written that, through this end run, North Korea “cheated” on its deal with the U.S., but this isn’t accurate. The Agreed Framework covered only North Korea’s plutonium program; it said nothing about uranium enrichment. North Korea maneuvered around the agreement but didn’t violate it. (One of the U.S. negotiators on the Agreed Framework, Wendy Sherman, learned her lesson from the experience. When she later became the chief negotiator at the Iran nuclear talks, she made sure that the deal blocked Iran from all paths to a bomb.)

Even then, the North Koreans didn’t evade the Agreed Framework “before the ink was dry,” as Trump charged. They waited four years—and then took the course they did, at least in part, because they weren’t getting the benefits that the agreement promised.

U.S. intelligence had detected signs of their secret uranium-enrichment program around 2000, during the last year of Clinton’s presidency; but rather than go to war, Clinton intensified diplomacy, starting talks to prohibit North Korea from developing or exporting ballistic missile technology. The talks were proceeding well, and at a very high level—Secretary of State Madeleine Albright and her team met with Kim Jong-il at length—but then Clinton ran out of time. In his final months, he faced a choice of how to spend his limited remaining time and political capital: push hard on the North Korean missile ban or try to get a Middle East peace treaty. He went for the latter, and couldn’t pull it off.

During the transition period, Clinton officials briefed President Bush’s incoming secretary of state, Colin Powell, on the Korean missile talks, and Powell was very intrigued. Barely a month into his term, Powell told reporters that he would resume those talks where Clinton had left off. The White House chewed him out, and Powell had to backpedal. Not only did Bush not resume talks, he formally canceled the Agreed Framework. Vice President Dick Cheney explained the move: “We don’t negotiate with evil, we defeat it.”

They ended up doing neither. In response, the North Koreans booted the IAEA inspectors out of the reactor, abrogated the Non-Proliferation Treaty, resumed processing plutonium, and stepped up the enrichment of uranium. In 2006, they tested their first atomic device. Bush, realizing his mistake, reopened talks with North Korea and even signed a deal, but it was too late: Negotiated hastily and filled with loopholes, it had no effect.

When President Obama took office, he explored the possibility of talks with North Korea, but he had other priorities—ending the war in Iraq, rethinking the one in Afghanistan, heading off an economic depression. In 2011, Kim Jong-il died and was replaced by his son, Kim Jong-un, who pumped up the Kim family’s rhetoric of fury and fire to new heights. Realizing any initiatives on North Korea’s bomb would be futile, Obama slapped sanctions on Kim and his family but otherwise declared a policy of “strategic patience”—a euphemism for kicking the can down the road, though also an acknowledgment, which Clinton and Bush had reached during their terms as well, that there were no good military solutions to the problem.

Still, the Obama administration maintained back channels with all the parties involved, if just to keep track of what was happening. When Trump entered office, he fired every U.S. ambassador, replaced only a few, and left key positions at the State and Defense departments unfilled. Policy wasn’t so much changed as let adrift.

Secretary of State Rex Tillerson initiated his own back channels with North Korean contacts, working through China, at first very quietly, but then he made the rookie’s mistake of revealing the overtures publicly—which spurred Trump to disavow them publicly. Hence, Trump’s Sunday morning tweet of Oct. 2: “I told Rex Tillerson, our wonderful Secretary of State, that he is wasting his time trying to negotiate with Little Rocket Man,” followed by: “Save your energy, Rex, we’ll do what has to be done!”

In his blistering Monday interview with the New York Times, Sen. Robert Corker, chairman of the Senate Foreign Relations Committee, said that, “in several instances,” Trump’s tweets have “hurt us as it relates to negotiations that were underway.” Among those negotiations were the ones Tillerson was conducting with North Korea. “A lot of people think that there’s some good cop, bad cop act underway,” Corker went on, speaking of Trump’s putdown of Tillerson, “but that’s just not true. That’s just not true. … You have people out there working hard to bring some—to solve problems, and those kinds of statements set us back. They just do.”

Maybe diplomacy wouldn’t work with North Korea at this point. 2017 is not 1994. For one thing, North Korea has some nuclear weapons now, and Kim is very unlikely to give them up. He sees them as assets that are protecting him and his regime from an attack by his enemies—and he’s not wrong. He reads the news: Saddam Hussein and Muammar Qaddafi gave up their nuclear programs, either through force or voluntarily—and now they’re dead. Lesson learned.

The attempt to keep North Korea from getting nuclear weapons has failed. We need to face up to that fact; it’s dangerous to pretend otherwise. The task now is to deter their use, block their export, and limit their numbers. This will demand ceaseless attention, a thoughtful strategy, and a shrewd mix of forceful displays and calculated overtures. The problem—as Corker (hardly a liberal softie) has revealed publicly and many others have been saying privately—is this president isn’t up to it, and there aren’t enough competent people around him to fill this alarming gap.