North Korea's Foreign Ministry said the test was "only the first response we took with maximum restraint".
"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," it said in a statement carried by the official KCNA news agency.
North Korea - which gave the U.S. State Department advance warning of the test - often threatens the United States and its "puppet", South Korea, with destruction in colorful terms.
North Korea told the U.N. disarmament forum in Geneva that it would never bow to resolutions on its nuclear program and that prospects were "gloomy" for the denuclearization of the divided Korean peninsula because of a "hostile" U.S. policy.
Suzanne DiMaggio, an analyst at the Asia Society in New York, said North Korea had embarrassed China with the test. "China's inability to dissuade North Korea from carrying through with this third nuclear test reveals Beijing's limited influence over Pyongyang's actions in unusually stark terms," she said.
South Korean Military Sharpens Reflexes on Divided Peninsula
Mark Fitzpatrick of the International Institute for Strategic Studies think tank, said: "The test is hugely insulting to China, which now can be expected to follow through with threats to impose sanctions."
The magnitude of the explosion was roughly twice that of the 2009 test, according to the Vienna-based Comprehensive Nuclear-Test Ban Treaty Organization. The U.S. Geological Survey said that a seismic event measuring 5.1 magnitude had occurred.
U.S. intelligence agencies were analysing the event and found that North Korea probably conducted an underground nuclear explosion with a yield of "approximately several kilotons", the Office of the Director of National Intelligence said.
Nuclear experts have described Pyongyang's previous two tests as puny by international standards. The yield of the 2006 test has been estimated at less than 1 kiloton (1,000 tons of TNT equivalent) and the second at some 2-7 kilotons, compared with 20 kilotons for a Nagasaki-type bomb.
Initial indications are that the test involved the latest version of a plutonium-based prototype weapon, according to one current and one former U.S. national security official. Both previous tests involved plutonium. If it turns out the test was of a new uranium-based weapon, it would show that North Korea has made more progress on uranium enrichment than previously thought.
The United States uses WC-135 Constant Phoenix "sniffer" aircraft to collect samples to identify nuclear explosions. These would need to be deployed quickly to detect whether highly enriched uranium rather than plutonium was used because uranium decays to undetectable levels within a matter of days. Plutonium takes much longer to decay.
North Korea trumpeted news of the test on its state television channel to patriotic music against a backdrop of its national flag.
"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.
North Korea linked the test to its technical prowess in launching a long-range rocket in December, a move that triggered the U.N. 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 programme is aimed at putting satellites in space.
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.
It used plutonium in previous nuclear tests and before Tuesday there had been speculation that it would use highly enriched uranium so as to conserve its plutonium stocks, as testing eats into its limited supply of materials to construct a nuclear bomb.
When Kim Jong-un, who is 30, took power after his father's death in December 2011, there were hopes that he would bring reforms and end Kim Jong-il's "military first" policies.
Instead, North Korea, 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 U.N. 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."
Options for the international community appear to be in short supply. Diplomats at the United Nations said negotiations on new sanctions could take weeks since China is likely to resist tough new measures for fear they could lead to further retaliation by the North Korean leadership.
Beijing has also been concerned that tougher sanctions could further weaken North Korea's economy and prompt a flood of refugees into China. Tuesday's action appeared to have been timed for the run-up to Feb. 16 anniversary celebrations of Kim Jong-il's birthday, as well as to achieve 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. The U.S. president 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, is preparing to take office on Feb. 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 international talks aimed at winning food and financial aid. China urged it to return to the stalled "six-party" talks on its nuclear programme, hosted by China and including the two Koreas, the United States, Japan and Russia.
Its puny economy and small diplomatic reach mean that North Korea struggles to win attention on the global stage - other than through nuclear tests and attacks on South Korea, the last of which was 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," predicted Jeung Young-tae, senior research fellow at the Korea Institute for National Unification in Seoul.