North Korea nuclear test branded 'serious threat' to US
North Korean military ambitions are a "serious threat" to the US, outgoing Pentagon chief Leon Panetta has said.
In a speech made after Pyongyang carried out its third nuclear test, Mr Panetta likened the North to Iran, describing them as "rogue states".
In New York, the UN Security Council "strongly condemned" the nuclear test.
The council said it would begin work on measures against North Korea, after UN chief Ban Ki-moon said the test was a "clear and grave violation".
Earlier, Pyongyang said "even stronger" action might follow, saying its test was a response to US "hostility".
North Korea warned the US in advance that it intended to conduct a nuclear test, the state department said, but did not say when it would happen.
US President Barack Obama spoke to his South Korean counterpart Lee Myung-bak to coordinate a response.
He "unequivocally reaffirmed" the US defence commitment to South Korea, "including the extended deterrence offered by the US nuclear umbrella," the White House said.
Nuclear test monitors in Vienna say the underground explosion had double the force of the last test, in 2009, despite the use of a device said by the North to be smaller.
If a smaller device was indeed tested, analysts said this could take Pyongyang closer to building a warhead small enough to arm a missile.
All we know at the moment about the North Korean test is gleaned from seismic data: the event was magnitude 4.9, significantly larger than the 2006 and 2009 tests.
Learning more than that will be difficult. Monitoring stations in the region can pick up radioactive elements and particles that may - or may not - have been released from the test site; that would indicate whether the device was based on plutonium, as earlier tests, or the more worrisome uranium.
But that could take days, and may be frustrated by weather conditions; it will be virtually impossible to determine if the device was "miniaturised", as North Korea claims.
UN sanctions on North Korea were expanded after the secretive communist state launched a rocket in December, in a move condemned by the UN as a banned test of missile technology.'Stern' message
North Korea's latest nuclear test comes as senators in Washington prepare for the first votes on whether to confirm Chuck Hagel as successor to current Defence Secretary Leon Panetta.
In a farewell speech at the Pentagon, Mr Panetta said the US would continue to be tested by unpredictable regimes in years to come.
"We're going to have to deal with weapons of mass destruction and the proliferation. We're going to have to continue with rogue states like Iran and North Korea.
"We just saw what North Korea's done in these last few weeks - a missile test and now a nuclear test. They represent a serious threat to the United States of America. We've got to be prepared to deal with that."
President Obama, who is to make his State of the Union speech later, called the test a "highly provocative act" and called for "swift" and "credible" international action in response.
China, North Korea's main ally and a veto-wielding member of the Security Council, summoned North Korea's ambassador to Beijing to express its concern over the test.
The President wanted his big State of the Union speech to focus on jobs and the economy. Now he must decide how directly he has to address North Korea's weapons. He already planned to talk about reducing the world's nuclear arsenal and will look foolish unless he links this directly with what is actually happening in the world.
While no-one really thinks military action against North Korea is on the cards, some are urging the president to make an explicit statement, setting out how the US would respond if the regime fired missiles out of its own territory. Some want him to make it clear the US would shoot them down. But perhaps the biggest test of the Obama administration is how Beijing responds - a key plank of his foreign policy is bringing China into the international community and get it to , in some senses, start to act like a superpower.
When the outgoing defence secretary says the US is going to have to "deal with the threat", it sounds tough - but the best they really hope for is China voting for new sanctions. This is a conundrum: no-one thinks military action is likely, no-one thinks North Korea will abandon its programme, and few think diplomatic pressure will work. Experts are gloomy and can't tell where this will all end.
Foreign Minister Yang Jiechi delivered a "stern representation"' to Ji Jae Ryong and expressed China's "strong dissatisfaction and firm opposition'' to the test, the Chinese foreign ministry said in a statement.
Earlier, it urged the North to honour its commitment to denuclearisation and "not take any actions which might worsen the situation".
The test was condemned by North Korea's immediate neighbours, South Korea and Japan, while Russian Foreign Minister Sergei Lavrov called for a revival of talks on the North's nuclear arms programme.
In a defiant message to the UN's disarmament forum, the North said it would never bow to resolutions on its nuclear programme and blamed the failure of diplomacy on the US.
"The US and their followers are sadly mistaken if they miscalculate the DPRK [North Korea] would respect the entirely unreasonable resolutions against it," the North's envoy, Jon Yong Ryong, told the Conference on Disarmament in Geneva.'Miniaturised' device
North Korea confirmed the test after international monitors recorded seismic activity consistent with a powerful underground explosion at 11:57 (02:57 GMT) on Tuesday.
Activity had been observed at the Punggye-ri nuclear test site for several months.
State-run KCNA news agency said the test 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".
North Korea said the nuclear test was a response to the "reckless hostility of the United States".
"The latest nuclear test was only the first action, with which we exercised as much self-restraint as possible," the foreign ministry said in a statement.
"If the US further complicates the situation with continued hostility, we will be left with no choice but to take even stronger second or third rounds of action."
US Ambassador to the UN Susan Rice said North Korea would not benefit from violating international law.
Instead it had "increasingly isolated and impoverished its people through its ill-advised pursuit of weapons of mass destruction and their means of delivery," Ms Rice said.
The Vienna-based Comprehensive Nuclear-Test-Ban Treaty Organisation said the "explosion-like event" was twice as big as the 2009 test, which was in turn bigger than that in 2006.
It is the first such test under new leader Kim Jong-un, who took over the leadership after his father Kim Jong-il died in December 2011.
The BBC's Lucy Williamson, in Seoul, says the trouble, as ever, is what the international community can do in response without triggering an even bigger crisis - North Korea is already tied up in layers of sanctions which do not seem to have any impact.
She adds that some in Washington have talked of maybe targeting North Korean financial interests, but the only real pressure is seen to lie with China.
By defying the UN and launching its nuclear test now, our correspondent says, Pyongyang is giving the new leadership in Beijing a very public test of its own.