BEIJING - North Korea's third nuclear test presents China under its new leader Xi Jinping with an unwelcome choice -- confront its defiant ally or accept having an uncontrollable atomic state on its border.
Beijing is the North's most important backer, providing its neighbour with trade and aid that have enabled the regime to survive since the 1950-53 Korean War, which historians estimate killed as many as 400,000 Chinese troops.
In China's strategic thinking, North Korea is a "buffer zone" that prevents the 28,500 US troops stationed in South Korea encroaching on its own border.
But with Kim Jong-Un's government again the subject of international fury, the relationship risks increasingly becoming an irritant for Beijing, analysts say.
"More and more people realise that North Korea is more like a security liability than a security asset to China," said Jia Qingguo, an expert on China's foreign relations at Peking University.
"China treasures stability in the Korean peninsula. But the problem is, North Korea's action is very destabilising."
He added that Beijing's thinking on the North would not "change overnight" and that Xi's ascent -- he now heads the Communist Party, and is due to become state president next month -- was unlikely to drive a new approach in itself.
Many social media users in China want a tougher line against North Korea. One this week likened Pyongyang to a "crazy dog" that had humiliated Beijing.
But while expressing "firm opposition" to Tuesday's blast, China's foreign ministry reiterated calls for calm and restraint and did not mention potential reprisals, echoing its statements after the North's tests in 2006 and 2009.
As then, it stated its support for denuclearisation on the Korean peninsula and backed a six-party dialogue that groups China, the United States, both Koreas, Japan and Russia. However, the forum has been moribund since 2009.
Meanwhile the official Xinhua news agency said in a commentary that the latest blast was an attempt by a "desperate DPRK" (North Korea) to keep a perceived external threat at bay, stressing its "strong sense of insecurity".
"I think China probably needs to act somehow, at least do something to show that this time China is serious," said Jing-Dong Yuan, an Asia security expert at the University of Sydney.
"There also needs to be serious discussion within Chinese leadership" about the strategic value of their wayward neighbour, he added.
Relations with the North are largely the preserve of the Communist Party's international liaison department and the People's Liberation Army. Both are believed to back the longstanding policy of support, despite the strains.
As Pyongyang's primary energy supplier, any move by Beijing to turn off the taps, even partially and temporarily, would have immediate impact.
But China fears that a crisis in North Korea would bring refugees flooding across the border, a US-backed escalation in the region, or even ultimately a unified Korea with a US military presence on its doorstep.
Authorities might only feel compelled to act if tensions escalated dramatically, for example, if Japan and South Korea began to consider their own nuclear options, Yuan said.
Yet seeking to wind down the situation at such a late stage might prove too little too late, he continued, and in the meantime Beijing was effectively giving Pyongyang a green light on its nuclear ambitions.
"It has issued strong statements but it has not really seriously followed up with specific actions," he said.
"North Korea knows pretty well that China is concerned about instability and uncertainty, so they basically continue with their own policy, disregarding Chinese pleas or whatever internal message they send to the North Korean leaders."
Beijing voted for a resolution last month by the UN Security Council, where it has a veto, expanding sanctions against Pyongyang for a rocket launch in December, but only after lengthy negotiations to soften the punishment.
Jia said support in China for a tougher line on North Korea was growing, and he expected Beijing to show more backing for international measures against Pyongyang, but it would still look to balance that with stability.
"The international community should not expect too much from China," he said.
© 1994-2013 Agence France-Presse