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.
The bomb dropped by the US on Hiroshima in 1945 had a yield of about 15 kilotonnes.
Ms Park, who is cutting short an overseas visit, said the test was a "grave challenge" to the international community that would "only earn more sanctions and isolation" for North Korea.
"Such provocation will further accelerate its path to self-destruction," she said.
Japan's Prime Minister Shinzo Abe said his country "absolutely cannot condone" any such test and would "protest adamantly" to Pyongyang.
"North Korea's nuclear development is becoming a graver threat to Japan's safety and severely undermines the peace and safety of the region and the international community," he said.
The White House said President Barack Obama had spoken to both Ms Park and Mr Abe after the latest test.
A statement from press secretary Josh Earnest said Mr Obama had "reiterated the unbreakable US commitment to the security of our allies in Asia and around the world".
Analysis: Steve Evans, BBC News, Seoul
What North Korea's opponents can actually do is problematic.
After the fourth test back in January, China agreed to impose tougher UN sanctions. Further and even tougher sanctions are still possible, like blocking the export of fuel oil to North Korea.
That would be a drastic step which might halt the economy and cause serious suffering to ordinary people.
China and the US are increasingly at odds as China asserts itself in East Asia.
China's bottom line is that it does not want the collapse of the regime in Pyongyang if that leads to a chaotic power vacuum, possibly filled by the US and its allies.
"The president indicated he would continue to consult our allies and partners in the days ahead to ensure provocative actions from North Korea are met with serious consequences."
China's foreign ministry said it would lodge a diplomatic protest. Its statement read: "Today, [North Korea] again conducted a nuclear test despite widespread international opposition - the Chinese government firmly opposes the test."
Russian Foreign Minister Sergei Lavrov expressed "serious concern", adding: "UN Security Council resolutions should be strictly complied with."
Yukiya Amano, head of the International Atomic Energy Agency, said the test was "in clear violation of numerous UN Security Council resolutions and in complete disregard of the repeated demands of the international community. It is a deeply troubling and regrettable act".
The North often uses nationally important dates as an opportunity to show military strength. Friday is its National Day, on which it celebrates the founding of the current regime.
The test was first detected as a 5.3 magnitude earthquake on Friday morning in north-east North Korea, close to its Punggye-ri underground nuclear test site.
Both Japan and China are monitoring radiation levels.
The North's last test in January had a yield of about 6-8 kilotonnes. Pyongyang said it was of a hydrogen bomb, which employs nuclear fusion, although many analysts cast doubt on that claim.
The North said its latest test meant that it could now produce "at will, and as many as it wants, a variety of smaller, lighter and diversified nuclear warheads of higher strike power" for use on ballistic rockets.
The North's claims on "miniaturised" nuclear warheads have never been independently confirmed.
In recent months the North has conducted a series of ballistic missile launches - some of which reached Japanese waters - and has unleashed a rising tide of aggressive rhetoric, threatening nuclear attacks on its enemies.
The North has also been angered by a US and South Korean plan to install an anti-missile defence system in the South and by the allies' massive annual joint military exercises, which are still taking place.