Though the precise strength of the explosion has yet to be determined, South Korea's weather agency said the artificial earthquake it caused was five to six times stronger than tremors generated by its previous tests. It reportedly shook buildings in China and in Russia.
The test was carried out at 12:29 p.m. local time at the Punggye-ri site where North Korea has also conducted past nuclear tests. Officials in Seoul put the magnitude at 5.7, while the U.S. Geological Survey said it was a magnitude 6.3. The strongest artificial quake from previous tests was a magnitude 5.3.
North Korea's state-run television broadcast a special bulletin Sunday afternoon to announce the test. It said leader Kim Jong Un attended a meeting of the ruling party's presidium and signed the go-ahead order. Earlier in the day, the party's newspaper ran a front-page story showing photos of Kim examining what it said was a nuclear warhead being fitted onto the nose of an intercontinental ballistic missile.
The White House said President Donald Trump and his national security team planned a meeting later Sunday to discuss North Korea.
Trump said on Twitter that the North's "words and actions continue to be very hostile and dangerous" to the U.S. He called it "a rogue nation which has become a great threat and embarrassment to China, which is trying to help but with little success."
China is by far the North's biggest trading partner, but Trump on Sunday appeared to be more critical of South Korean President Moon Jae-in, who has attempted to reach out to the North.
"South Korea is finding, as I have told them, that their talk of appeasement with North Korea will not work, they only understand one thing!" Trump tweeted.
Sunday's detonation builds on recent North Korean advances that include test launches in July of two ICBMs that are believed to be capable of reaching the mainland United States. Pyongyang says its missile development is part of a defensive effort to build a viable nuclear deterrent that can target U.S. cities.
China's foreign ministry said in a statement that the Chinese government has "expressed firm opposition and strong condemnation" and urged North Korea to "stop taking erroneous actions that deteriorate the situation."
South Korea held a National Security Council meeting chaired by Moon. Officials in Seoul also said U.S. National Security Adviser H.R. McMaster spoke with his South Korean counterpart for 20 minutes about an hour after the detonation.
Japan's Prime Minister Shinzo Abe called the test "absolutely unacceptable."
The nuclear test is the first since Trump assumed office in January. Trump has been talking tough with the North, suggesting it would see fire, fury and power unlike any the world had ever witnessed if it continued even verbal threats.
Nuclear tests are crucial to perfect sophisticated technologies and to demonstrate to the world that claims of nuclear prowess are not merely a bluff.
The North claimed the device it tested was a thermonuclear weapon - commonly called an H-bomb. That could be hard to independently confirm. It said the underground test site did not leak radioactive materials, which would make such a determination even harder.
At the same time, the simple power of the blast was convincing. Japan's Defense Minister Itsunori Onodera said it might have been as powerful as 70 kilotons. North Korea's previous largest was thought to be anywhere from 10 to 30 kilotons.
"We cannot deny it was an H-bomb test," Onodera said.
North Korea conducted two nuclear tests last year and has been launching missiles at a record pace this year. It fired a potentially nuclear-capable midrange missile over northern Japan last week in response to ongoing U.S.-South Korea military exercises.
It said that launch was the "curtain-raiser" for more activity to come.
Just before Sunday's test, according to state media, Kim and the other senior leaders at the party presidium meeting discussed "detailed ways and measures for containing the U.S. and other hostile forces' vicious moves for sanctions."
The photos released earlier Sunday showed Kim talking with his lieutenants as he observed a silver, peanut-shaped device that the state-run media said was designed to be mounted on the North's "Hwasong-14" ICBM.
The North claims the device was made domestically and has explosive power that can range from tens to hundreds of kilotons. For context, the bomb dropped on Hiroshima by the United States had a 15-kiloton yield.
North Korea's recent activity has been especially bold.
Pyongyang followed its two ICBM tests by announcing a plan to launch a salvo of intermediate range missiles toward the U.S. Pacific island territory of Guam. Kim signed off on the plan, but is watching the moves by the U.S. before deciding when or whether to carry it out.
Guam is a sore point for Pyongyang because it is home to a squadron of B-1B bombers that the North fears could be used to attack their country. The U.S. on Thursday had sent the bombers and F-35 stealth fighters to the skies of South Korea in a show of force - and North Korea strongly protested.
Options to pressure Pyongyang would appear to be limited. Further economic and trade sanctions, increased diplomatic pressure and boosting military maneuvers or shows of force would likely all be on the table.
The two Koreas have shared the world's most heavily fortified border since their war in the early 1950s ended with an armistice, not a peace treaty. About 28,500 American troops are deployed in South Korea as deterrence against North Korea.