Little more than four years ago, the North Korean nuclear weapons program was largely under lock and key, the threat seen as a fleeting crisis of a previous decade.
North Korea's main nuclear center at Yongbyon, 55 miles north of Pyongyang, was monitored 24 hours a day by U.N. surveillance cameras. International inspectors lived near the site. Seals were in place over key nuclear installations and a nuclear reactor at Yongbyon was gathering dust.
So what went wrong?
The story of Sunday night's announcement of a nuclear test is one of failed policies, neglect and missed opportunities by the Bush administration and its predecessors.
It is also the story of how a cagey dictator, Kim Jong Il, took advantage of the United States entanglement in Iraq to advance his nuclear agenda.
North Korea's founder Kim Il Sung, well aware that the United States had considered using nuclear weapons in the 1950-1953 Korean War, first began a nuclear energy program in the 1960s with help from his patrons in the Soviet Union. His son, the present leader, accelerated the program to the point where in the early 1992, the Clinton administration grew concerned.
In 1994, the United States struck a deal known as the "agreed framework" under which North Korea agreed to place its nuclear facilities at Yongbyong under a U.N.-monitored freeze in return for energy assistance and help building light-water nuclear reactors, which are harder to use for military purposes.
Relations warmed to the point that in 2000 then-Secretary of State Madeleine Albright traveled to Pyongyang to meet Kim Jong Il and normalization of relations appeared imminent.
All that changed when George W. Bush became president. Bush quickly made public his loathing for Kim Jong Il and the regime. The Republicans were particularly scornful of their predecessor's agreement to give energy assistance to North Korea and looked for ways to void the pact.
The opportunity presented itself during the first visit by a Bush administration envoy to Pyongyang in October 2002. Assistant Secretary of State James A. Kelly was told by a North Korean official that the North was cheating on its nuclear freeze obligations by conducting secretive research into highly enriched uranium. As fuel for a nuclear weapon, highly enriched uranium is an alternative technology easier to keep hidden than a plutonium-based program which requires a reactor such as the one at Yongbyong.
The Bush administration moved hastily to punish North Korea by cutting off shipments of fuel oil that had been pledged under the agreed framework.
Within weeks, the North Koreans put tape over the surveillance cameras at Yongbyon and broke the seals on their nuclear installations. By New Year's Eve, the U.N. inspectors were escorted out of North Korea.
Once the U.N. inspectors were gone, North Korea wasted no time. By mid-2003, North Korea had repaired its mothballed nuclear reactor and had cranked up the reprocessing plant where weapons-grade plutonium was extracted from spent fuel rods.
The United States issued shrill warnings to the North Koreans, but they sounded increasingly hollow given the entanglement in Iraq. The North Koreans continually appeared to be calling the United States' bluff.
And if the Bush administration expected the removal of Saddam Hussein to deter Kim Jong Il from forging ahead, in fact it had just the opposite effect. The North Koreans claimed they needed nuclear weapons to prevent the United States from exercising the doctrine of prevention on their territory.
Cry for attention
North Korea trumpeted each and every step toward completing its nuclear weapon.
Usually regimes develop weapons of mass destruction in secret. North Korea's boastfulness led analysts to speculate that perhaps this was Pyongyang's cry for attention from Washington.
Yet as North Korea plowed ahead with its nuclear program, the Bush administration refused to meet directly with its adversary. Instead, it insisted on a rather clunky diplomatic initiative known as the six-party talks. Basically, the U.S. refused to meet with the North Koreans unless China, Russia, Japan and South Korea also participated.
Donald Gregg, a U.S. ambassador to South Korea under President Bush's father and now head of the New York-based Korea Society, says the crisis could have been averted if the current Bush administration had talked to the North Koreans directly. He visited Pyongyang in late 2002 and brought back a written offer from the North Koreans to negotiate one-on-one.
"We were told at the White House that the offer would not be accepted as it would be "rewarding bad behavior," Gregg recalled. "The basic problem is that Bush & Co. see diplomacy as something you give to a country as a reward for good behavior, ... not as a tool to be used which may bring better behavior on the part of an antagonist."