"On the morning of May 25, many schools in northeast China were evacuated because of the earthquake caused by the North Korea nuclear test. The epicenter of the earthquake, registering 4.5 on the Richter scale, was just 180 kilometers away from those schools.
In Beijing, the Chinese government was shocked by the test. (Chinese officials reportedly were informed of it less than 30 minutes before the test took place.) Several hours afterward, the Chinese Foreign Ministry issued a strong rebuke, "On May 25, 2009, [North Korea] conducted another nuclear test in disregard for the common opposition of the international community. The Chinese government is firmly opposed to this act. . . . China strongly urges [North Korea] to honor its commitment to denuclearization, stop relevant moves that may further worsen the situation, and return to the Six-Party Talks." Beijing issued a similar statement in response to Pyongyang's first nuclear test in 2006 and strongly condemned it as "brazen." But this time, Beijing is more upset because Pyongyang has blatantly disregarded China's demand to denuclearize.
Moreover, because China is North Korea's largest trading partner and provides Pyongyang with most of its fuel and food aid, Washington and Tokyo are pushing Beijing to put pressure on Pyongyang. But China's leverage on North Korea is constrained by two main factors: (1) it believes the nuclear crisis is mainly the business of Washington and Pyongyang; and (2) it wants to avoid an abrupt collapse of the Kim Jong Il regime because such a collapse could create a massive flow of refugees into China and, in such an uncertain geopolitical realignment, possibly bring U.S. troops to China's border. So despite the harsh early words, Beijing later softened its stance regarding the test, calling on "all parties concerned to respond in a cool-headed and appropriate manner and persist in seeking a peaceful solution through consultation and dialogue."
All of this, of course, puts China in a tough diplomatic spot. For instance, while China supports U.N. discussions of sanctions on North Korea, it can't allow the sanctions to cripple Pyongyang so badly that it would cause another provocative military act or the collapse of Kim Jong Il's regime—for the reasons outline above. At the same time, Beijing, like Washington, Tokyo, and Seoul, wants a denuclearized and stable Korean Peninsula. Thus, it's likely that Beijing will support modest U.N. sanctions against North Korea (e.g., the way it did after the first North Korean test), but that it will not support the tougher sanctions the United States, Japan, and South Korea would like to enact. And any hardening of China's stance will exclusively be tied to facilitating negotiations about denuclearization, not regime change...."
The complete article can be read on the Bulletin of the Atomic Scientists website, listed below.
Zhang, Hui. “The North Korean Nuclear Test: The Chinese Reaction.” Bulletin of the Atomic Scientists, June 2, 2009
The full text of this publication is available via Bulletin of the Atomic Scientists.