During his presidency thus far, Donald Trump has repeatedly criticized the nuclear deal with Iran signed in 2015 by his predecessor, to the point of pressuring intelligence officials to find Iran in violation of the agreement in order to justify walking out on it. In Trump’s mind, the deal is facilitating a nuclear-armed Iran, giving its leaders breathing room as they trick the international community and secretly accelerate the production of a nuclear weapon.

But if Trump is concerned about Iran reneging on the deal and obtaining a nuclear weapon — or any other governments getting their hands on and stockpiling WMDs — there’s something else that is much more likely to hasten that along: attacking North Korea.

US foreign policy over the last few decades has essentially served as one long, multi-decade advertisement for why a government — particularly one with a history of animosity with the United States — ought to acquire nuclear weapons as a deterrent, or at least a bargaining chip.

Let’s start with Iraq and Saddam Hussein. Hussein, who infamously used chemical weapons on his country’s civilians, possessed massive stockpiles of biological and chemical weapons by the end of the first Gulf War. In fact, the conflict had actually led him to embark on a “crash program” to develop a nuclear weapon as soon as possible, as the IAEA found when it began doing inspections in the country.

Over the course of the 1990s, however, the UN and the IAEA conducted dozens of inspections in the country, successfully removing many of the components of Iraq’s chemical, biological, and nuclear weapons programs, and destroying hundreds of tons of such weapons, even if Saddam resisted their efforts and eventually expelled them in 1998.

In the lead-up to the Iraq War, Blair and Bush conspired to use renewed demands for inspections to goad Saddam into doing something foolish — such as refusing to let them in, or hampering their efforts — and thus provide a pretext for the Iraq War. To Blair’s dismay, Saddam didn’t fall for it. UN inspectors were allowed back in, their work went unobstructed, and they found no evidence of WMDs to justify a war.

Bush and Blair invaded Iraq anyway.

For Saddam, this chain of events culminated with him being forced to hide in a hole in the ground, with footage of him, dirty and disheveled, broadcast around the world before he was executed.

Or take a look at Muammar Gaddafi, the former dictator of Libya. Around the time the US was at war in Iraq, Gaddafi was convinced to end Libya’s WMD program, handing over more than $100 million in bomb-making technology, including weapons stockpiles, upwards of four thousand centrifuges, and blueprints for creating a nuclear bomb. In return, he was promised a variety of things, including diplomatic recognition and economic benefits from reintegration into the world economy.

Eight years later, the Obama administration helped remove Gaddafi from power, with its original mission of protecting civilians seamlessly morphing into a regime change operation. The US military stepped up air attacks on Libyan government targets, covertly supplied the rebels with arms, and sent in predator drones.

Before that point, the civil war was considered to be in a “stalemate,” with then-director of national intelligence James Clapper stating that “over the longer term . . . the regime [would] prevail” over the poorly trained and equipped rebel forces.

Instead, with US help, Tripoli fell, and a predator drone bombed Gaddafi’s convoy, after which he was captured by the rebels and lynched. As the New York Times had reflected months earlier in light of US intervention: “the success of a joint American-British effort to eliminate Libya’s capability to make nuclear and chemical weapons has never, in retrospect, looked more important.”

The North Korean leadership watched these episodes closely. At the time of the Libyan intervention, the North Korean foreign ministry put out a statement pointing to events in Libya as proof that

‘Libya’s nuclear disarmament’ much touted by the U.S. in the past turned out to be a mode of aggression whereby the latter coaxed the former with such sweet words as ‘guarantee of security’ and ‘improvement of relations’ to disarm itself and then swallowed it up by force.

“It proved once again the truth of history that peace can be preserved only when one builds up one’s own strength,” the statement concluded.

Years later, in January 2016, as North Korea conducted another nuclear test, it specifically cited both wars to justify its actions.

“The Saddam Hussein regime in Iraq and the Gaddafi regime in Libya could not escape the fate of destruction after being deprived of their foundations for nuclear development and giving up nuclear programmes of their own accord,” the country’s state news agency said.

Given such history, it’s no wonder North Korea’s missile tests and threats are becoming increasingly hostile, in response to similarly bellicose actions and rhetoric by the Trump administration.

Compare how non-nuclear armed countries like Iraq and Libya were treated to the treatment a nuclear power like Pakistan receives. Pakistan’s military intelligence agency, the Inter-Services Agency (ISI), has long been accused of being a sponsoring terrorism, not just in neighboring states like India and Afghanistan, but in Western countries like the United Kingdom, according to a leaked 2006 paper produced by a think tank run by the British Ministry of Defence.

The country is a safe haven for terrorists who openly recruit there, and Osama Bin Laden was mysteriously able to hide in Pakistan for five years in a large, conspicuous compound less than a mile from the country’s top military academy. It later came out that Bin Laden had been communicating with two of the ISI’s top militant allies while hiding there. And yet, just as mysteriously, Pakistan has never been subjected to the kind of threats or regime change that the North Korean leadership now fears.

North Korea isn’t the only country that’s observed this lesson. At the same time that Trump is ratcheting up tensions with North Korea, Iran — another country Trump is openly hostile toward and seemingly deliberately provoking — must be wondering if it’s next. While Iran’s current president, Hassan Rouhani, is a moderate, his hardline opponent in the election had warned the nuclear deal “was like a check that the government has been unable to cash,” that Iran mustn’t “show any weakness in the face of the enemy,” and that Rouhani had bet mistakenly on rapprochement with the West. Any attack on North Korea will only serve to buttress those arguments, strengthening the position of hardliners in Iran.

And this isn’t to mention any other states that may look at these unfolding events and decide their best shield against the capricious hand of the Trump administration is to get their hands on WMDs.