Sarah Huckabee Sanders, the White House press secretary, said Mr. Trump’s national security team was “well aware of the tone of the statement of the president prior to delivery.”

“The tone and strength of the message were discussed beforehand,” she said. The words he used, she added, “were his own.”

And they revealed what some longtime associates of Mr. Trump say is a simmering frustration with the velvet handcuffs slapped on him by John F. Kelly, his new White House chief of staff, who has cracked down on walk-in visitors to the Oval Office and keeps tabs on some of the president’s after-hours phone calls to ensure that he is not being fed bad information or reckless advice.

Mr. Trump has embraced the new, more disciplined approach of the former Marine general, but he has made it clear that he will not cede control of what he says or tweets to anybody. If nothing else, Tuesday’s statement proved that he cannot be muzzled by his staff or decorous diplomatic protocol.

The president, people close to him say, believes he has a better feel for Mr. Kim than his advisers do. He thinks of Mr. Kim as someone used to pushing people around, and Mr. Trump thinks he needs to show that he cannot be pushed.

The episode also reflects an evolving and unsettled approach to one of the world’s most dangerous hot spots as Mr. Trump and his team debate diplomatic, economic and military options, none of them particularly attractive.

The president’s aides are divided on North Korea, as on other issues, with national security veterans like Defense Secretary Jim Mattis and Lt. Gen. H. R. McMaster, the national security adviser, on one side and Stephen K. Bannon, the president’s chief strategist, and his allies on the other.

