China warned North Korea on Tuesday that its nuclear test would harm relations and called on the United Nations to take "appropriate measures" to get North Korea to relinquish its nuclear weapons.

China's Foreign Ministry vented its anger against its communist ally over the test for a second day, with a spokesman saying relations had been harmed.

"The nuclear test will undoubtedly exert a negative impact on our relations," the spokesman, Liu Jianchao, said at a routine media briefing. He said Monday's test was done "flagrantly, and in disregard of the international community's shared opposition."

But Liu urged diplomatic efforts to resolve the crisis and said that the time was not right for punishment, much less military action.

"What we should discuss now is not the negative issue of punishment," Liu said. "Instead, the international community and the United Nations should take positive and appropriate measures that will help the process of de-nuclearization on the Korean peninsula."

CountryWatch: China

Beijing holds a decisive say over how stern a punishment the international community may hand North Korea. As a permanent member of the U.N. Security Council, China wields a veto that could scuttle or stall sanctions. At the same time, China has shown its patience with North Korea is wearing thin.

China joined other Security Council members in unanimously condemning the North's decision to carry out a test. The council was weighing a U.S. draft resolution to impose potentially crippling sanctions on the impoverished country.

A South Korean envoy, returning to Seoul from Beijing, said Tuesday that China had dropped its previous opposition to tough sanctions.

"China seems to have different position than it had before on a Chapter 7 resolution," Chun Young-woo said, referring to the section of the U.N. Charter that deals with threats to international peace and acts of aggression.

CountryWatch: North Korea

If the U.N. Security Council endorses sanctions, China would have little choice but to impose them, said Zhang Liangui, North Korea watcher at the Central Party school, a Communist Party training academy in Beijing.

"China needs to keep in lockstep with the international community," said Zhang.

Liu, the foreign ministry spokesman, however, did not directly answer repeated questions on whether China would block or endorse U.N. sanctions against Pyongyang. He said that China was conferring with other Security Council measures over possible next steps.

In the past, Beijing has opposed to sanctions, or even the threat of sanctions, to get North Korea to relinquish its nuclear programs and has insisted that the six-country negotiations it has hosted are the best path to a resolution.

Click here to go to FOXNews.com's North Korea Center.

Liu defended the talks, saying Pyongyang's nuclear test "should not be regarded as a failure of China's foreign policy or a failure of the six-party mechanism."

He called for a resumption of negotiations and said China was "firmly against" taking any military action toward North Korea.

"The Chinese government calls on all parties to be cool-headed in their response and stick to negotiations and consultation and dialogue to seek a peaceful solution of the issue," he said.

North Korea, he said, also needs to step back and return to the six-party talks.

Should the United Nations and China go along with sanctions, Zhang, the North Korea watcher, said that only the broadest sanctions would likely have an impact, and even then they are unlikely to rattle North Korea's leadership.

"North Korea doesn't have much contact with the rest of the world. If sanctions don't include food and fuel, they won't be very meaningful," Zhang said. "Kim Jong Il and the people around him won't see their lifestyles affected. Only the common people will suffer."