Tensions had already been running high, with Kim repeatedly defying international condemnation and increasingly blunt warnings by President Trump, and continuing to launch ballistic missiles.
But Sunday's blast — North Korea's sixth nuclear test but the first since Trump took office — could escalate those tensions to a new level.
Trump sharply condemned the test, saying North Korea is "very hostile and dangerous to the United States."
In a pair of tweets issued Sunday morning, Trump wrote: "North Korea has conducted a major Nuclear Test. Their words and actions continue to be very hostile and dangerous to the United States … North Korea is a rogue nation which has become a great threat and embarrassment to China, which is trying to help but with little success."
Trump also delivered an admonishment of sorts to South Korea, saying that "appeasement with North Korea will not work" and suggesting that more severe steps must be taken to influence Kim's regime.
China said Sunday that it "resolutely opposes and strongly condemns" the launch, adding to denunciations from South Korea and Japan.
The nuclear device that North Korea tested appeared to be so large that Vipin Narang, an expert on nuclear proliferation and strategy at the Massachusetts Institute of Technology, called it a "city buster."
"Now, with even relatively inaccurate intercontinental ballistic missile technology, they can destroy the better part of a city with this yield," Narang said.
The nuclear test took place at exactly noon local time at North Korea's Punggye-ri testing site and was recorded as a 6.3-magnitude earthquake, according to the U.S. Geological Survey. It was followed eight minutes later by a 4.1-magnitude earthquake that appeared to be a tunnel collapsing at the site.
Japan immediately sent up sniffer planes to try to measure radiation levels.
North Korean state media said the test was carried to determine "the accuracy and credibility" of its "H-bomb to be placed at the payload of the ICBM." North Korea tested its intercontinental ballistic missile for the first time in July, and its second test later that month showed that the rocket could theoretically reach Denver or Chicago.
Those launches caused Trump to warn that if North Korea continued its provocations, it would face "fire and fury." He later tweeted that the U.S. military was "locked and loaded."
North Korean television on Sunday broadcast footage of Kim signing the order to detonate. Sunday's test, part of the regime's plan for building "a strategic nuclear force," was a "perfect success," the state-run Korean Central News Agency said.
Earlier Sunday, KCNA had released photos of Kim inspecting what was described as a hydrogen bomb that could be attached to an ICBM, the same device that appeared to have been detonated just hours later.
All the components of the "H-bomb" were "homemade," so North Korea could produce "powerful nuclear weapons as many as it wants," the KCNA quoted Kim as saying.
Analysts were poring over the photos and the data Sunday, especially questioning North Korea's claim to have produced a "two-stage thermonuclear weapon."
David Albright, a nuclear weapons expert and president of the Institute for Science and International Security, was skeptical of North Korea's claims and said the photos were probably "propaganda."
But there was no doubt that North Korea was making progress. South Korean officials and independent nuclear scientists estimated the yield — the amount of energy released by the weapon — to be 100 kilotons. That would make it almost seven times as strong as the U.S. atomic bomb that destroyed the Japanese city of Hiroshima in 1945.
At that level, North Korea's nuclear device would be "very significant and destabilizing," Albright said. "It would show that their design, whatever the specific design, has achieved a yield that is capable of destroying substantial parts of large modern cities."
South Korea's meteorological agency said Sunday's explosion was as much as six times the size of the fifth test, in September last year, and 11 times the size of the January 2016 detonation.
Still, Albright doubted that North Korea had been able to make such a warhead small enough to fit onto a missile.
After firing increasingly long-range missiles, including the two that can theoretically reach the U.S. mainland, into the sea between the Korean Peninsula and Japan, North Korea last week sent a missile over Japan and into the Pacific Ocean, claiming it was capable of reaching Guam, a U.S. territory.
Analysts said that appeared to be a dummy run for firing an ICBM on a normal trajectory over Japan and into the Pacific, instead of straight up and straight down as with its first two tests.
Although governments and experts would continue to assess the technical aspects of the latest nuclear test, MIT's Narang said the danger is significant, regardless of whether this was a lesser boosted fission device or a true hydrogen bomb, or whether North Korea had mastered the technology to deliver this accurately to a target.
"It really doesn't matter now from a deterrence perspective," he said. "Mated on the ICBM, you don't want this thing anywhere near a city near you."
Sunday's test caused anger across the region, with South Korean President Moon Jae-in saying he would "never allow North Korea to continue advancing its nuclear and missile technologies," according to his national security adviser.
South Korean military leaders warned North Korea that they, together with their American allies, were "fully equipped" to punish North Korea.
But Trump later admonished the Moon government. "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!" he wrote in a third Sunday morning tweet.
Japanese Prime Minister Shinzo Abe said he "would not tolerate" the nuclear test. Abe had spoken with Trump three hours before the test and said afterward that they had agreed to "increase pressure on North Korea and make it change its policies."
The White House said the two leaders discussed "ongoing efforts to maximize pressure on North Korea." Trump made the call from Air Force One, as he returned home to Washington from his visit to storm-battered Texas and Louisiana.
"The two leaders reaffirmed the importance of close cooperation between the United States, Japan and South Korea in the face of the growing threat from North Korea," the White House statement said.
All eyes will turn to China to see whether it will be angry enough to impose true punishment on North Korea.
China has expressed annoyance at North Korea's frequent ballistic missile launches, but analysts have said that Beijing probably would not take serious action unless there is another nuclear test.
China's primary concern is stability on its borders, and it has shied away from implementing sanctions that would seriously undermine the regime in Pyongyang, analysts have said. Almost all international sanctions, such as recent bans on coal and seafood exports, rely on Chinese enforcement because about 90 percent of North Korean trade goes through China.
China's Foreign Ministry said Sunday that North Korea had conducted the nuclear test "with no regard to the general objections of the international community."
"The Chinese government resolutely opposes and strongly condemns this," the ministry said in a statement.
"China will work together with the international community to comprehensively and completely implement the relevant resolutions of the Security Council of the U.N., unswervingly push forward the denuclearization of the peninsula, and unswervingly maintain the peace and stability of the peninsula," it said.
Philip Rucker in Washington, Yoonjung Seo in Seoul, and Emily Rauhala and Shirley Feng in Beijing contributed to this report.