SEOUL, South Korea — The standoff over North Korea’s nuclear program has long been shaped by the view that the United States has no viable military option to destroy it. Any attempt to do so, many say, would provoke a brutal counterattack against South Korea too bloody and damaging to risk.

That remains a major constraint on the Trump administration’s response even as North Korea’s leader, Kim Jong-un, approaches his goal of a nuclear arsenal capable of striking the United States. On Tuesday, the North appeared to cross a new threshold, testing a weapon that it described as an intercontinental ballistic missile and that analysts said could potentially hit Alaska.

Over the years, as it does for potential crises around the world, the Pentagon has drafted and refined multiple war plans, including an enormous retaliatory invasion and limited pre-emptive attacks, and it holds annual military exercises with South Korean forces based on them.

On Wednesday, the Trump administration made a point of threatening a military response. Gen. Vincent K. Brooks, commander of the American forces that conducted a missile exercise with South Korea, said the United States had chosen “self-restraint” with the North. Nikki R. Haley, the American ambassador to the United Nations, said her country’s “considerable military forces” were an option. “We will use them if we must, but we prefer not to have to go in that direction,” she told the Security Council.

But the military options are more grim than ever.

Even the most limited strike risks staggering casualties, because North Korea could retaliate with the thousands of artillery pieces it has positioned along its border with the South. Though the arsenal is of limited range and could be destroyed in days, the United States defense secretary, Jim Mattis, recently warned that if North Korea used it, it “would be probably the worst kind of fighting in most people’s lifetimes.”

Beyond that, there is no historical precedent for a military attack aimed at destroying a country’s nuclear arsenal.

The last time the United States is known to have seriously considered attacking the North was in 1994, more than a decade before its first nuclear test. The defense secretary at the time, William J. Perry, asked the Pentagon to prepare plans for a “surgical strike” on a nuclear reactor, but he backed off after concluding it would set off warfare that could leave hundreds of thousands dead.

The stakes are even higher now. American officials believe North Korea has built as many as a dozen nuclear bombs — perhaps many more — and can mount them on missiles capable of hitting much of Japan and South Korea.

Earlier in his term, President Trump tried to change the dynamics of the crisis by forcing the North and its main economic benefactor, China, to reconsider Washington’s willingness to start a war. He spoke bluntly about the possibility of a “major, major conflict” on the Korean Peninsula, ordered warships into nearby waters and vowed to “solve” the nuclear problem.

But Mr. Trump has backed off considerably in recent weeks, emphasizing efforts to pressure China to rein in Mr. Kim with sanctions instead.

After all, a pre-emptive American attack would very likely fail to wipe out North Korea’s arsenal, because some of the North’s facilities are deep in mountain caves or underground and many of its missiles are hidden on mobile launchers.

The North has warned that it would immediately retaliate by launching nuclear missiles. But predicting how Mr. Kim would actually respond to a limited attack is an exercise in strategic game theory, with many analysts arguing that he would refrain from immediately going nuclear or using his stockpile of chemical and biological weapons to avoid provoking a nuclear response from the United States.

Assuming Mr. Kim is rational and his primary goal is the preservation of his regime, he would only turn to such weapons if he needed to repel a full-scale invasion or felt a nuclear attack or other attempt on his life was imminent, these analysts say.

But anticipating what the North might do with its conventional weapons in the opening hours and days after an American attack is like trying to describe a “very complex game of three-dimensional chess in terms of tic-tac-toe,” said Anthony H. Cordesman, a national security analyst at the Center for Strategic and International Studies in Washington.

The problem, Mr. Cordesman said, is that there are many ways and reasons for each side to escalate the fighting once it begins.

Stopping it would be much more difficult.