On May 25, Pyongyang carried out its threats to void past agreements on denuclearization with a substantial nuclear-weapons test and the firing of several short-range missiles. Those actions continued a trail of brazen confrontation since at least August, when paramount leader Kim Jong-il suffered a stroke. North Korea's statements indicate that soon it will undertake further efforts to foment tensions on the peninsula.

Officials in Washington do not pretend to understand what is happening in the inner circles of the North, and the truth is, neither do their counterparts in Beijing. The North's recent behavior could have less to do with its relations with the outside than with demonstrating the leaders' reliance on and confidence in the military or security forces and their desire to assure an effective nuclear deterrent as part of a bargain for the regime's survival. Mr. Kim is demonstrably ill; his designated successor appears to be a 24-year-old son with no apparent preparation. The nuclear and missile tests could be about this or about extorting aid from the United States.

Pyongyang in effect is trying to force the United States to back down embarrassingly or China to get tough uncharacteristically. In recent weeks, the Chinese have signaled that they are increasingly uncomfortable in this position. Having refused for years to discuss potential contingencies, such as regime collapse in North Korea, with other parties, Chinese officials and scholars lately have been talking openly about ways of managing their forces, and those of the United States and South Korea, in the event of several possible outcomes in the North.

If the North collapses, what will happen to its nuclear facilities? Will there be a race between China and the United States to get there first? Can China abide U.S.-based South Korean forces on its borders? These are vital questions. Beijing may be serious about discussing end-of-regime contingencies or simply may be sending Pyongyang a message that its support is no longer unlimited.

Beijing broke precedent in 2006 when it approved United Nations Security Council Resolution 1718 condemning the North's first nuclear test, but since then it has failed to impose sanctions on luxury goods to the North, as required by the resolution. Beijing instead has continued to maneuver between its twin and incompatible needs to preserve stability in North Korea while insisting that Pyongyang abandon its nuclear capabilities.

China's middle way has been to encourage the United States and North Korea to reach a direct agreement to buy an end to the nuclear program and reduce tensions. Twice before, in 1994 and 1995, Beijing was relieved that a diplomatic solution to the situation seemed to have been found.

Given that the United States has twice before thought it had agreements with North Korea to denuclearize the peninsula, it will be difficult for President Obama to try to start a new round of negotiations to achieve the same failed objective. The immediate focus will be on persuading China to get serious with the North.

The Obama administration responded quickly to the North Korean test with tough language and a call for further U.N. sanctions. In anticipation of the provocation, Mr. Obama had placed calls to the region's leaders, including China's, in the previous two weeks. He called them again May 25 to ask their support for sanctions that go beyond denying luxury goods to the North and aim to upset its trade, arms sales and financial services arrangements with other countries.

Beijing will, as it indicated late last month, try to get the United States and North Korea to negotiate directly. After a while, probably several months, the North may again be willing to agree to this, to alleviate the pressure. First, however, there must be pressure, and that will depend on China taking its commitments seriously, sanctioning the North and agreeing to additional sanctions.

The near-term outlook suggests rising but manageable tensions. The United States will seek to reassure Japan and South Korea that extended deterrence still applies to their alliances. Consultations and deployments may be stepped up to signal resolve to counter the North's provocations. South Korea may have to contend with North Korean troop movements and probes of the territorial seas' Northern Limit Line, west of the Demilitarized Zone.

The key element to watch, however, is the degree to which China is willing to squeeze the North into more constructive behavior. For now, the potential for cooperation between China and North Korea is poorer than ever. From Washington's perspective, that's progress.