Pyongyang said the test involved a “miniaturized” device and was carried out in a “perfect manner”.
The confirmation came three hours after seismic activity was detected at North Korea’s nuclear test site.
President Barack Obama called for “swift” and “credible” international action in response.
He said the “provocative” nuclear test did not make North Korea more secure, adding that Washington would remain vigilant and steadfast in its defence commitments to its allies in Asia.
The United Nations had warned of “significant consequences” if Pyongyang went ahead.
UN Secretary General Ban Ki-moon has condemned the test as a “clear and grave violation” of UN resolutions and a “deeply destabilizing” provocation.
The Security Council is to hold an emergency meeting at 14:00 GMT on Tuesday in New York, diplomats say.
North Korea previously conducted nuclear tests in 2006 and 2009. It announced in January that it would conduct a third as a response to UN sanctions that were expanded after its December rocket launch.
Confirmation of the test came in a statement from state-run KCNA news agency.
“It was confirmed that the nuclear test that was carried out at a high level in a safe and perfect manner using a miniaturized and lighter nuclear device with greater explosive force than previously did not pose any negative impact on the surrounding ecological environment,” KCNA said.
The claim to have tested a “miniaturized” device is likely to alarm observers. The US and North Korea’s neighbors fear Pyongyang’s ultimate goal is to produce a nuclear device small enough to fit on a long-range missile, something it is not yet believed to have mastered.
In December it put a satellite into space using a three-stage rocket – a move condemned by the UN as a banned test of missile technology.
North Korea said the nuclear test – which comes on the eve of President Barack Obama’s State of the Union address – was to “to protect our national security and sovereignty against the reckless hostility of the United States”.
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.
Activity had been observed at the Punggye-ri nuclear test site for several months.
Seismic activity was then detected by monitoring agencies from several nations at 11:57 a.m. A shallow earthquake with a magnitude of 4.9 was recorded, the US Geological Survey said.
Both South Korea and Japan convened emergency meetings of their national security teams shortly afterwards.
“This is an unacceptable threat to the security of the Korean peninsula and north-east Asia, and a challenge to the whole international community,” South Korea’s presidential national security adviser Chun Young-woo said.
Japanese Prime Minister Shinzo Abe said his government would “consider every possible way to address this issue”.
The US, South Korea and Japan had all warned Pyongyang not to go ahead with the test. China, North Korea’s closest ally and biggest trading partner, had also called for restraint.
dfvtL2_UHXg o4panEYEFQk E41aaycRI58Quincy Jones, the celebrated musician and producer who worked with Michael Jackson, Frank Sinatra, Ray…
Misleading allegations, rumours and outright lies about voting and fraud are flooding online spaces in…
At least 158 people have died in Spain's worst flooding disaster in generations. On October…
Google has been fined two undecillion (a two followed by 36 zeroes) roubles by a…
Embarking on a home remodel is an exciting journey, promising enhanced comfort, increased property value,…
The US presidential candidates continued to campaign across key swing states on October 20. Footage…