The statement echoed past comments by the defense secretary as well as a warning issued by President George W. Bush after the North’s first atomic test, in 2006. In that statement Mr. Bush also said North Korea would be held responsible if it ever exported any of its nuclear weapons technology to other nations or to terrorists.
Mr. Mattis’s statement left open many questions, including whether Mr. Trump will attempt a diplomatic opening to the North, which so far has declined negotiations aimed at forcing it to give up its nuclear arsenal, or whether he might attempt targeted military attacks or sabotage aimed at crippling Mr. Kim’s ability to threaten the United States.
Mr. Trump threatened last month to bring “fire and fury” to North Korea if it continued to threaten the United States with nuclear missiles, and two weeks ago, after a brief lull in the North’s testing, he said he thought Mr. Kim “respected” him and might be ready to turn to negotiations.
But the test, which followed the launch last week of a ballistic missile over Japan into the north Pacific, prompted another shift in tone by Mr. Trump, who responded on Twitter with posts that suggested anger at the North but also frustration with China and, notably, South Korea.
“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,” he said. “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!”
The president’s options are limited. Although the Pentagon has revised its military options for strikes against missile and nuclear sites, and Mr. Trump’s aides have talked about how a “preventive war” might be necessary, the risk of rekindling the Korean War looms large.
Mr. Mattis said Mr. Trump and Vice President Mike Pence had been briefed on “many military options.” But Mr. Mattis himself has been among the biggest skeptics about the wisdom of employing them, for fear of rekindling the Korean War, which ended 65 years ago, and causing thousands of casualties in South Korea or Japan. The defense secretary did not say whether the United States had concluded whether North Korea had, in fact detonated a hydrogen bomb.
South Korea, which has urged talks to resolve the crisis, is particularly vulnerable because much of its population is within range of the North’s artillery. Mr. Trump’s undisguised swipe at the South for “appeasement” was certain to exacerbate fears that the United States might put it in danger. And it threatened a new rift in relations that are already strained because of Mr. Trump’s threats to withdraw from a trade deal.
In response to Mr. Trump’s criticism, the office of President Moon Jae-in said it was working closely with Washington to exert “maximum sanctions and pressure.” But it also reiterated that the allies shared the understanding that the goal of these sanctions and pressure was to bring North Korea back to the negotiating table.
South Korea also reminded Washington of its strong opposition to military action.
“We have experienced an internecine war and can never tolerate another catastrophic war on this land,” Mr. Moon’s office said in a statement. “We will not give up our goal of working together with allies to seek a peaceful denuclearization of the Korean Peninsula.”
Other possible responses include a more comprehensive embargo on trade with the North, including cutoffs of the North’s energy supplies. But both approaches would require the help of China and Russia, and neither has seemed eager to do anything that could lead to a collapse of the North Korean regime.
The United States Geological Survey estimated that the tremor set off by the blast, detected at 12:36 p.m. at the Punggye-ri underground test site in northwestern North Korea, had a magnitude of 6.3.
The South Korean Defense Ministry’s estimate was much lower, at 5.7, but even that would mean a blast “five to six times” as powerful as the North’s last nuclear test, a year ago, said Lee Mi-sun, a senior analyst at the South Korean Meteorological Administration.
The tremor from the North was strong enough to be felt by some people in South Korea. The South’s National Fire Agency, which operates an emergency hotline, said it had received 31 calls about buildings and the ground shaking, the first time that South Koreans had reported tremors after a North Korean nuclear detonation.
The blast was so powerful that the first tremor was followed by a second, weaker one minutes later, which the United States Geological Survey called a “collapse.” The second tremor was detected in China but not in South Korea; officials in the South said that would be consistent with a cave-in at the North’s underground test site.
Condemnation of the test came from around the world. In Asia, Mr. Moon, the South Korean leader, called the test “utterly disappointing and infuriating.”
China, the North’s main ally and biggest trading partner, expressed “strong condemnation” of the test, according to Xinhua, the state news agency. Japan requested an emergency meeting of the United Nations Security Council.
In Europe, the Russian Foreign Ministry said that North Korea “deserves absolute condemnation,” and a joint statement from Chancellor Angela Merkel of Germany and President Emmanuel Macron of France said “the most recent provocation from Pyongyang reaches a new dimension.”
The International Atomic Energy Agency said the test amounted to a “complete disregard of the repeated demands of the international community.”
Just last week, North Korea fired a ballistic missile over Japan, sharply escalating tensions in the region. Pyongyang recently launched an intercontinental ballistic missile capable of reaching the American mainland, and it responded to Mr. Trump’s “fire and fury” rhetoric by threatening to fire missiles into waters around Guam, a United States territory that is home to military bases.
The timing of the test on Sunday was almost certainly no coincidence: It came during the American Labor Day weekend, and the anniversary of the founding of the North Korean government is Saturday.
The North has often tried to catch its enemies in Washington off guard by conducting major weapons tests around American holidays — Mr. Kim called his country’s first ICBM test, conducted on July 4, a “gift package for the Yankees” — or timed them to coincide with its own holidays for domestic propaganda uses.
On Sunday, North Korea gave its people and the outside world notice of “an important announcement” to come, followed hours later with confirmation of the test and Mr. Kim’s handwritten order to conduct it. In the coming days, the government is expected to organize huge rallies to celebrate the bomb test and Mr. Kim’s leadership.
“Pyongyang has a playbook of strategic provocations, throws off its adversaries through graduated escalation, and seeks maximum political impact by conducting weapons tests on major holidays,” said Lee Sung-yoon, a Korea expert at the Fletcher School of Law and Diplomacy at Tufts University.
North Korea has conducted a series of nuclear and ballistic missile tests since 2006. Its previous nuclear tests have produced increasingly larger blasts. The last test, in September 2016, yielded one about as powerful as the bomb the United States dropped on Hiroshima in 1945.
In its fourth nuclear test, in January 2016, North Korea claimed to have used a hydrogen bomb. Other countries dismissed the claim for lack of evidence, but experts have said that the North may have tested a “boosted” atomic bomb by using tritium, a common enhancement technique that produces a higher explosive yield.
Hydrogen bombs and atomic bombs both work by detonating nuclear energy in an explosive chain reaction. But hydrogen devices can be much more powerful because they use a second stage that boosts the chain reaction, unleashing more explosive force.
Analysts noted that the device in the photo that the North released on Sunday — whether real or a mock-up — was shaped like a two-stage thermonuclear device. David Albright, president of the Washington-based Institute for Science and International Security, said he doubted the device was real, but he said there was strong evidence that the North had been working on thermonuclear weapons.
“The size of the seismic signal of the recent test suggests a significantly higher explosive yield than the fifth test,” Mr. Albright said. “Getting this high of a yield would likely require thermonuclear material in the device.” But he said he was “skeptical that this design has been miniaturized to fit reliably on a ballistic missile.”
With his options limited, Mr. Trump has turned to the same strategy his predecessors have tried: increasing economic pressure and threatening military force, though Mr. Trump has used more provocative rhetoric about a potential military response than his predecessors did.
Another strategic consideration in responding to a nuclear blast is China. While the country’s president, Xi Jinping, fears that a collapse in North Korea could lead to a wave of hungry refugees and a scramble for North Korea’s territory and nuclear weapons, he has shown signs of losing patience with Mr. Kim, recently agreeing to stronger United Nations sanctions against Pyongyang.
The test’s timing was a major embarrassment for Mr. Xi, who on Sunday was hosting a summit meeting of the so-called BRICS countries — Brazil, Russia, India, China and South Africa.
Peter Hayes, director of Nautilus, a United States-based research institute specializing in North Korea, said the test seemed intended to jolt Mr. Xi, and to convince him that he needed to persuade the United States to talk to North Korea.
“It’s aimed more at Xi than Trump,” Mr. Hayes said. “Kim Jong-un doesn’t have the leverage to get Washington to talk. Xi has real power to affect the calculations in Washington. He’s putting pressure on China to say to Trump, you have to sit down with Kim Jong-un.”