North Korea says it has successfully carried out its fifth nuclear test, in continued defiance of UN resolutions.
A 5.3 magnitude tremor had earlier been detected near its nuclear test site.
South Korea believes it is the North's biggest-ever test, raising fears it has made significant nuclear advances.
South Korean President Park Geun-hye called it an act of "self-destruction" showing the "maniacal recklessness" of leader Kim Jong-un. The US warned of "serious consequences".
China's foreign ministry said Beijing was resolutely opposed to the test and urged North Korea to avoid further action that would worsen the situation.
North Korea is banned by the UN from any tests of nuclear or missile technology and has been hit by five sets of UN sanctions since its first test in 2006.
The North said the latest test had been of a "nuclear warhead that has been standardised to be able to be mounted on strategic ballistic rockets".
Estimates of the explosive yield of the latest blast have varied. South Korea's military said it was about 10 kilotonnes, enough to make it the North's "strongest nuclear test ever". Other experts say initial indications suggest 20 kilotonnes or more.