Before conducting his nuclear test on Sunday, Kim Jong Il offered only one country a warning he was about to explode a nuke: Roughly 20 minutes before the test, Pyongyang told Beijing that it was about to transform the security landscape of Asia, add another country to the small club of nuclear powers, and terrify its neighbors.

Kim's warning to Beijing demonstrates both the strength and weakness of China's position on North Korea. As North Korea's major ally, its source of energy, and its key economic partner, China is the only nation in the region with any kind of substantial relationship with Kim's regime; the United States, Japan, and even South Korea have limited ties to the North. In 2005, Chinese trade with North Korea topped $1.5 billion, making China the North's biggest trading partner. According to South Korea's Korea Trade Investment Promotion Agency, China's grants to North Korea for technical assistance and other aid projects rose from $108 million in 2003 to $145 million the following year. And, over the last five years, China has built its diplomatic prestige in Asia by hosting the six-party talks on North Korea and taking other measures to lead dialogue on the North Korean nuclear program. But, now that Kim has responded to the talks with a boom, does China have the strength to use its leverage over Pyongyang as a stick, not a carrot?

Since 2002, when North Korea first revealed it had violated past agreements and was building a clandestine nuclear program, China has steadily increased its diplomatic outreach to the North, beginning to appear like a great power capable of mediating conflicts. Besides hosting the six-party talks on North Korean nukes, Chinese leaders have shuttled to Pyongyang in attempts to convince Kim to drop his program. Chinese officials have also led the North Korean dictator on tours of booming southern China, presumably to offer him an example of how to reform his backwards, Stalinist economy. And Beijing wasn't shy about taking credit for its diplomacy. "With respect to the nuclear issue on the Korean Peninsula, China has worked tirelessly with the other relevant parties, and succeeded in convening and hosting [the talks]," noted a 2005 Chinese government white paper on China's foreign policy. Even some impartial observers agreed. "I think we should really focus on the positive aspects of [the six-party talks], including the absolutely rightful role of China," said Aleksandr Ilitchev, a U.N. expert on North Korea.

In the current crisis, Beijing has initially said all the right things. The Chinese government called the nuclear test a "flagrant and brazen" violation of global norms, said Pyongyang "defied the universal opposition of international society," and immediately joined a U.N. condemnation of the North. In the past, China has occasionally used harsher pressure on North Korea. Beijing reportedly shut off an oil pipeline to Pyongyang in 2003--North Korea has few other sources of fuel than China--and then cracked down on North Korea's banking in the Chinese territory of Macau. But those sticks were basically designed to get North Korea back to the six-party bargaining table--talks that would have preserved Kim's regime while also dealing with his weapons of mass destruction.

Now the situation is different. Taking stronger action now, like much tougher multilateral sanctions or even a military strike, would be Chinese sticks designed to eventually topple Kim's regime, not to preserve it. Yet China has made "noninterference" in other countries' internal affairs a centerpiece of its global foreign policy. By promising not to interfere--whether in Sudan, Iran, or Zimbabwe--Beijing can position itself as a direct contrast to the United States and win friends around the globe.

This time, however, the rogue nation is on China's own border, and though no nation controls erratic North Korea--Beijing had previously warned Pyongyang not to test--China has far more influence than anyone else. If Beijing wants to become a great power in the world, it has to look beyond its own narrow interests (like its fear that floods of North Korean refugees could swarm into China if Kim collapses) and instead begin to consider broader global interests (like preventing the spread of weapons of mass destruction and forestalling a nuclear arms race in Asia). China's new diplomacy now faces its first major test. Tough sanctions on Pyongyang--about which the Chinese have so far been noncommittal--would be a first sign that Beijing intends to pass.

This article was originally published in The New Republic (online), October 9, 2006.