By Jack Kim and Terril Yue Jones

SEOUL/BEIJING (Reuters) - North Korea formally rejected a U.N. Security Council resolution on Saturday that demands an end to its nuclear arms program, as China called for calm, saying sanctions were not the "fundamental" way to resolve tensions on the Korean peninsula.

Pyongyang said it would pursue its goal of becoming a full-fledged nuclear weapons state, despite the sanctions which were unanimously imposed on Friday by the Security Council.

The sanctions aim to tighten financial restrictions and crack down on North Korea's attempts to transport banned cargo.

The resolution, the fifth since 2006 aimed at stopping the North's nuclear and ballistic missile program, coincides with a sharp escalation of security tensions on the Korean peninsula after Pyongyang's third nuclear test on February 12.

"The DPRK, as it did in the past, vehemently denounces and totally rejects the 'resolution on sanctions' against the DPRK, a product of the U.S. hostile policy toward it," the North's foreign ministry spokesman said in a statement.

DPRK is short for the North's official name, the Democratic People's Republic of Korea.

"The world will clearly see what permanent position the DPRK will reinforce as a nuclear weapons state and satellite launcher as a result of the U.S. attitude of prodding the UNSC into cooking up the 'resolution.'"

The North's sole major ally China has said it wants sanctions fully implemented, but Chinese Foreign Minister Yang Jiechi told a news conference on Saturday the best way to resolve the problem was still through dialogue.

"We always believe that sanctions are not the end of Security Council actions, nor are sanctions the fundamental way to resolve the relevant issues," Yang said, urging all sides to exercise calm and restraint.

"The only right way to resolve the issue is to take a holistic approach and resolve the concerns of all parties involved in a comprehensive and balanced manner through dialogue and consultations."

AVOIDING INSTABILITY

The sanctions are designed to make punitive measures more like those used against Iran, which Western officials say have been surprisingly successful.

Analysts say China's leaders have become increasingly irritated with North Korea and its recent actions have sparked policy debate within China, but caution that Beijing is not likely to give up on its old friend any time soon.

"The calculus in China is changing to the point where it is starting to ask the question: Is North Korea more of a liability than a benefit?" said Paul Haenle, former China Director on the U.S. National Security Council and White House representative to the Six Party Talks.

"What Yang Jiechi said today is a reflection that it will not be taking actions with respect to North Korea that will cause more instability. It will not change its policy overnight and abandon North Korea."

The United States warned North Korea it will achieve nothing by repeating threats of provocative actions and will only drive itself deeper into international isolation.

"The United States of America and our allies are prepared to deal with any threat and any reality that occurs in the world," U.S. Defense Secretary Chuck Hagel said ahead of his visit to Afghanistan on Friday. "We are aware of what's going on. We have partnerships in that part of the world that are important."

North Korea defied international warnings and conducted a third nuclear test in February, setting off a device that yielded a stronger blast than its previous test in 2009. It claimed it had made progress in miniaturizing an atomic weapon.

Experts are skeptical of such a claim, and the threat this week to attack the United States, seeing them more as an attempt to boost its security leverage in the face of deepening diplomatic isolation and growing military pressure from the United States and South Korea, which are conducting joint military drills to deter any armed aggression from Pyongyang.

North Korea has accused the United States of using military drills in South Korea as a launch pad for a nuclear war and declared on Tuesday it would scrap the armistice with Washington that ended hostilities in the 1950-53 Korean War.

The two Koreas are technically at war because the armistice and not a formal peace treaty ended their 1950-53 conflict.

(Additional reporting by Phil Stewart in KABUL and Ben Blanchard and John Ruwitch in BEIJING; Editing by Michael Perry)