A paramilitary solider stands guard at the main gate of North Korea's embassy in Beijing Jan. 6, 2016. North Korea said it had successfully conducted a test of a miniaturized hydrogen nuclear device on Wednesday morning. REUTERS/Kim Kyung-Hoon

SHANGHAI — China, which is seen as North Korea’s only major ally, has condemned the country’s alledged hydrogen bomb test. A spokeswoman for China’s foreign ministry said Wednesday that Beijing “expressed its firm opposition” to the nuclear test, and called on Pyongyang to stop undermining attempts to denuclearize the Korean peninsula. She called on North Korea to return to stalled six-party talks, which also involve the U.S., Japan and South Korea, on the nuclear issue.

“Any practice that disrupts stability in northeast Asia is undesirable and unwise,” China’s official Xinhua News Agency said in a commentary. “If the peninsula is in chaos it won’t be good for anyone.”

While the two countries are traditional socialist allies, Chinese analysts say Beijing has become increasingly frustrated with North Korea under what is seen as the erratic leadership of Kim Jong Un. In October China sent a senior official, Liu Yunshan, to Pyongyang for talks, in what was seen as an attempt to improve communications with Kim’s leadership. However, South Korea’s Yonhap state news agency said China had not been informed in advance of the latest test.

The Xinhua News Agency suggested there was still some uncertainty about whether a hydrogen bomb test had actually taken place. It first quoted a military expert as saying he had yet to confirm that such a test had taken place, but soon after quoted other experts as saying North Korea “may have conducted” a hydrogen bomb test.

China’s seismological agency did report a “shallow earthquake” of magnitude 4.9 on the Richter Scale in North Korea early Wednesday, however. And Xinhua also said that tremors had been felt close to the two countries’ shared border in northeastern China, and students in the border town of Yanji had been evacuated as a precaution, apparently after cracks appeared in the grounds of their school. Analysts said China had not given such detail when nuclear tests had taken place in the past, and the reports could reflect Beijing’s dissatisfaction at the latest development.

“China will be strongly opposed to such a test, as it is totally unhelpful to bilateral ties and regional stability,” Shen Dingli, associate dean of international relations at Shanghai’s Fudan University, told International Business Times.

Observers had previously noted that Kim had not mentioned North Korea’s nuclear program, which has long been the target of U.N. sanctions, in his recent new year’s message — leading to some speculation that this omission might be designed to placate China. However, analysts say Pyongyang has in the past routinely used threatening language and tests of missile and other military technology to send a message if it feels it is being ignored by the international community.

But the move may prove to have backfired — analysts said it could be seen as an embarrassment for Beijing, which has in the past sought to use its influence over Pyongyang, and its calls for it to hold talks on the nuclear issue, to prove to the U.S. and other countries that it is a responsible and influential member of the international community.

Fudan’s Shen told IBT that North Korea was now seen as “more a liability than an ally” by China — and he suggested that Beijing would support further sanctions against Pyongyang at the U.N. Security Council.

And some Chinese internet users expressed frustration and concern at the test.

“As a resident of Dandong [another city close to North Korea] I express my worries”, wrote one reader on the comment pages of Shanghai-based news website, the Paper.

Others asked whether there was a risk of radiation contamination from the test, and expressed concern at potential environmental damage. “How can they use this kind of strategic weapon — I hope they will have a sense of responsibility to the whole of humanity,” wrote one reader.

Some Chinese internet users, however, simply poured scorn on Kim Jong Un, describing him by his Chinese nickname “San Pang” or “Fat Guy Number 3” — a reference to his being the third member of his family to lead North Korea (after grandfather Kim Il Sung and father Kim Jong Il), and to the fact that North Korea's leaders are considered to look well-fed, in a nation where many citizens are reported to be short of food.

“If San Pang keeps making such a fuss he will bring about his own downfall,” wrote one reader on the Paper’s website, while another even suggested that China “should quickly intervene militarily before the peninsula is nuclearized.”

But in a reminder of the tense security relationships in East Asia, one reader expressed concern that North Korea’s “irresponsible action” would “give the U.S. an excuse to interfere in Asia-Pacific affairs.”