North Korea has conducted its third nuclear test in defiance of existing United Nations resolutions, drawing condemnation from around the world, including from its only major ally, China, which summoned the North Korean ambassador to protest.
The reclusive North said the test on Tuesday was an act of self-defence against United States ‘‘hostility" and threatened further, stronger steps if necessary.
It said the test had "greater explosive force" than the 2006 and 2009 tests. Its KCNA news agency said it had used a "miniaturised" and lighter nuclear device, indicating that it had again used plutonium which is more suitable for use as a missile warhead.
North Korean leader Kim Jong-un, the third of his line to rule the country, has presided over two long-range rocket launches and a nuclear test during his first year in power, pursuing policies that have propelled his impoverished and malnourished country closer to becoming a nuclear weapons power.
China, which has shown signs of increasing exasperation with the recent bellicose tone of its neighbour, summoned the North Korean ambassador in Beijing and protested sternly, the Foreign Ministry said.
Foreign Minister Yang Jiechi said China was "strongly dissatisfied and resolutely opposed" to the test and urged North Korea to "stop any rhetoric or acts that could worsen situations and return to the right course of dialogue and consultation as soon as possible".
China is a permanent member of the Security Council.
US President Barack Obama labelled the test a "highly provocative act" that hurt regional stability and pressed for new sanctions.
"The danger posed by North Korea's threatening activities warrants further swift and credible action by the international community. The United States will also continue to take steps necessary to defend ourselves and our allies," Obama said in a statement.
The Security Council was to meet later on Tuesday to discuss its reaction to the test, although North Korea is already one of the most heavily sanctioned states in the world and has few external economic links that can be targeted.
Japanese Prime Minister Shinzo Abe said the test was a "grave threat" that could not be tolerated. UN Secretary-General Ban Ki-moon said the test was a "clear and grave violation" of UN Security Council resolutions.
Russian Foreign Minister Sergei Lavrov urged North Korea to abandon its nuclear arms program and return to talks. Nato condemned the test as an "irresponsible act" that posed a grave threat to world peace.
New Zealand joined in condemning the nuclear test by North Korea and said it is ready to support "significant action" by the UN Security Council.
In a statement, Foreign Minister Murray McCully said North Korea continued to blatantly defy UN Security Council resolutions.
"That is of deep concern and represents a significant threat to peace and security in the region,” McCully said.
The test "was only the first response we took with maximum restraint", an unnamed spokesman for the North Korean Foreign Ministry, which acts as Pyongyang's official voice to the outside world, said in a statement carried by the official KCNA news agency.
"If the United States continues to come out with hostility and complicates the situation, we will be forced to take stronger, second and third responses in consecutive steps."
North Korea often threatens the United States and its "puppet", South Korea, with destruction in colorful terms.
North Korea told the UN disarmament forum in Geneva that it would never bow to resolutions on its nuclear program and that prospects were "gloomy" for the denuclearisation of the divided Korean peninsula because of a "hostile" US policy.
South Korea, still technically at war with the North after the 1950-53 civil war ended in a mere truce, also denounced the test.
The magnitude was roughly twice as large as that of 2009, Lassina Zerbo, director of the international data centre division of the Vienna-based Comprehensive Nuclear-Test Ban Treaty Organisation, said. The US Geological Survey said that a seismic event measuring 5.1 magnitude had occurred.
"It was confirmed that the nuclear test that was carried out at a high level in a safe and perfect manner using a miniaturised and lighter nuclear device with greater explosive force than previously did not pose any negative impact on the surrounding ecological environment," KCNA said.
Despite China's strong response, the test is likely to be a major embarrassment for Beijing, the North's sole major economic and diplomatic ally.
"The test is hugely insulting to China, which now can be expected to follow through with threats to impose sanctions," said Mark Fitzpatrick of the International Institute for Strategic Studies think tank.
North Korea trumpeted the announcement on its state television channel to patriotic music against the backdrop of an image of its national flag.
It linked the test to its technical prowess in launching a long-range rocket in December, a move that triggered the UN sanctions, backed by China, that Pyongyang said prompted it to take Tuesday's action.
The North's ultimate aim, Washington believes, is to design an intercontinental ballistic missile capable of carrying a nuclear warhead that could hit the United States. North Korea says the program is aimed merely at putting satellites in space.
North Korea used plutonium in previous nuclear tests and prior to Tuesday there had been speculation it would use highly enriched uranium so as to conserve its plutonium stocks as testing eats into its limited supply of the material that could be used to construct a nuclear bomb.
Despite its three nuclear tests and long-range rocket tests, North Korea is not believed to be close to manufacturing a nuclear missile capable of hitting the United States.
South Korea's Yonhap news agency said Pyongyang had informed China and the United States of its plans to test on Monday, although this could not be confirmed.
When North Korean leader Kim, 30, took power after his father's death in December 2011, there were hopes the he would bring reforms and end Kim Jong-il's "military first" policies.
Instead, the North, whose economy is smaller than it was 20 years ago and where a third of children are believed to be malnourished, appears to be trapped in a cycle of sanctions followed by further provocations.
"The more North Korea shoots missiles, launches satellites or conducts nuclear tests, the more the UN Security Council will impose new and more severe sanctions," said Shen Dingli, a professor at Shanghai's Fudan University. "It is an endless, vicious cycle."
But options for the international community appear to be in short supply.
Tuesday's action appeared to have been timed for the run-up to February 16 anniversary celebrations of Kim Jong-il's birthday, as well as to achieved maximum international attention.
Significantly, the test comes at a time of political transition in China, Japan and South Korea, and as Obama begins his second term. He will likely have to tweak his State of the Union address due to be given on Tuesday.
Japanese Prime Minister Shinzo Abe is bedding down a new government and South Korea's new president, Park Geun-hye, prepares to take office on February 25.
China too is in the midst of a once-in-a-decade leadership transition to Xi Jinping, who takes office in March. Both Abe and Xi are staunch nationalists.
The longer-term game plan from Pyongyang may be to restart talks aimed at winning food and financial aid. China urged it to return to the stalled "six-party" talks on its nuclear program, hosted by China and including the two Koreas, the United States, Japan and Russia.
Its puny economy and small diplomatic reach mean the North struggles to win attention on the global stage - other than through nuclear tests and attacks on South Korea, last made in 2010.
"Now the next step for North Korea will be to offer talks... - any form to start up discussion again to bring things to their advantage," said Jeung Young-tae, senior research fellow at the Korea Institute for National Unification in Seoul.
The European Union's foreign policy chief, Catherine Ashton, urged North Korea to refrain from further provocation.
EU member Denmark called on China to step up to the plate and use its influence to rein in its ally.
"This deserves only one thing and that is a one-sided condemnation," said Foreign Minister Villy Sovndal. "North Korea is likely the most horrible country on this planet."