As a member of the U.S. National Security Council staff in the later 1990s, I worked with colleagues on plans for responding to the potential collapse of the North Korean government. As a self-induced famine ravaged the country, we considered what we might do when the regime finally succumbed to the inevitable consequence of its own insanity. Almost twenty years later, the Democratic People’s Republic of Korea is still there and those predicting its imminent collapse have continually been proven wrong. But today, the North Korean madness may well be nearing its endgame. I predict it will be gone within a decade.

The continued survival of North Korea’s government is based on its ability to harness absolute terror against its population, its possession of nuclear weapons, and its access to economic resources. Although North Korea requires all three of these to survive, contradictions between what it takes to secure each will make the regime’s demise all but inevitable over time.

Terror against its people stands at the core of the North Korean system. The UN Commission of Inquiry on Human Rights in the DPRK reports “systematic, widespread and gross human rights violations” including torture, murder, rape, and mass gulags containing over 120,000 people in what the Commission believes constitute “crimes against humanity.” Without deploying terror to control every aspect of people’s lives, the regime would collapse.

(Recommended: North Korea's Deadly Chemical Weapons)

After witnessing the first Gulf War, where Saddam Hussein was more vulnerable to invasion because Iraq did not possess nuclear weapons, Pyongyang accelerated its own nuclear program. North Korea has now conducted three nuclear tests, fired a ballistic missile from a submarine, and is racing forward with nuclear miniaturization and weaponization.

The further development of North Korea’s nuclear weapons program, however, will ultimately put it at odds with China, its essential benefactor. North Korea’s only meaningful trading partner, China provides Pyongyang with 90 percent of its energy imports and most of the food going to its military. Beijing has carefully struck a balance between gently pressuring North Korea to slow its nuclear program and maintaining the DPRK through aid, primarily because China fears U.S. troops on its border in case of collapse.

(Recommended: North Korea's Deadly Chemical Weapons Shop of Horrors)

But because North Korea’s continued nuclear weapons push will justify the U.S. military’s ongoing rebalancing to the Asia-Pacific, the acceleration of missile defenses in South Korea and Japan that will undermine China’s nuclear deterrent, and Japan’s active reconsideration of its military capabilities, China’s need to keep a lid on North Korea’s nuclear program will ultimately conflict with the DPRK’s nuclear drive. Moreover, China will rightly come to perceive the North’s nuclear program as being designed primarily to limit Beijing’s influence over Pyongyang. This will likely prove unacceptable to the Chinese, who will be forced to increase economic pressure on North Korea by reducing aid, making China-DPRK relations decline even more than they have since the 2013 execution of Jang Song-Taek, Kim Jong-Un’s uncle and the then-point person in North Korea-China ties.

Recognizing the potential for reduced Chinese assistance, Pyongyang has begun looking for other financial options. Its longtime friend Russia, relishing these days in poking the West, would be a good choice but for its ongoing financial crisis. South Korea, which once provided significant aid to the North for little in return under former President Kim Dae Jung’s “Sunshine Policy,” will not be fooled again without significant concessions. With few options for aid, economic reform will by default become the North’s only real choice.

In fact, North Korea’s leaders have recently come to this realization and minor economic reforms allowing managers to set wages and farmers to keep more of their harvest have begun. Economic reform, however, cannot work in North Korea without political reform. Greater access to information and freer movement of people and goods are essential underpinnings of a reforming economy. These same reforms would also undermine the legitimacy of the regime and ultimately force it to choose between shutting down economic reform to maintain totalitarian control or allowing the spark of political change to ignite that will, over time, become inextinguishable. With no logical path forward, the DPRK government will collapse under the weight of its own contradictions, as we may already be seeing in the recent wave of high-level executions.

The good news is that this collapse has the potential to be a win-win for nearly everyone. The North Korean people will end their terrible suffering, North and South Korea will be reunified under South Korean law, potentially following a UN-administered transitional period and referendum, the specter of a rogue nuclear nation at the heart of Asia will be removed, and China will gain a valuable trading partner in a unified Korea and access to Seoul’s high tech economy and northern Korea’s natural resources through high quality rail, road, and communications links. American troops could even be maintained below the 38th parallel to ease China’s fears of encirclement, with the long-term international relations of a unified Korea being up to the Korean people.

North Korea is a historical relic, destabilizing force, and human rights abomination. The Korean people and the world will be far better off without it.

Jamie Metzl is author of Genesis Code and a Senior Fellow of the Atlantic Council. He served in the U.S. National Security Council, State Department, and Senate Foreign Relations Committee. Follow him on Twitter @JamieMetzl.