North Korea conducted its last major weapons test in November 2017, when it launched an intercontinental ballistic missile. But Mr. Kim has since declared a moratorium on nuclear and ICBM tests.

By testing a short-range tactical weapon, North Korea is playing its cards cautiously, analysts said. Mr. Kim can raise pressure on Washington with such a test but still be able to claim that he has not reneged on the moratorium.

Karl Dewey, a senior analyst at Jane’s by IHS Markit, said that North Korea’s “stress on the weapon’s tactical nature” was “primarily aimed at a domestic audience, rather than signaling a shift in North Korea’s strategic approach to U.S. talks.”

But other analysts said the test was a more ominous signal aimed at Washington.

“It is a message from Kim Jong-un that he no longer trusts Trump or Moon Jae-in, and that he is ready to go his own way,” said Lee Byong-chul, another North Korea expert at the Institute for Far Eastern Studies. “He is showing that there will be no buckling under or compromising under American pressure. This may well be Mr. Kim’s first step to raise tensions on the Korean Peninsula.”

In a speech on Thursday at Auburn University in Alabama, Gina Haspel, the director of the Central Intelligence Agency, said, “I am very proud that we’ve been able to support this administration’s efforts to engage the North Koreans in a dialogue.”

“After years of failure, I do think that President Trump has shown a lot of wisdom in reaching out his hand to the North Korean leader and to suggest there might be a different future for the North Korean people,” she added.

The test by North Korea came amid news reports that Mr. Kim planned to meet President Vladimir V. Putin of Russia in the far eastern city of Vladivostok next week. On Thursday, the Kremlin said in a brief statement that the two would meet this month, giving no specific date.