Faced with a threat from North Korea that it might soon test an intercontinental ballistic missile, President-elect Donald J. Trump took to Twitter on Monday to declare bluntly, “It won’t happen!”

Mr. Trump made his post on Twitter, where he often tests out his first thoughts on developing issues in the United States and abroad, a day after North Korea’s young leader, Kim Jong-un, declared that the “final stage in preparations” was underway for a test of such a missile. Mr. Kim offered no time frame. North Korea has routinely tested short- and medium-range missiles, with some successes and many failures, but it has so far stopped short of testing a long-range missile, which could reach Guam or the West Coast of the United States.

“North Korea just stated that it is in the final stages of developing a nuclear weapon capable of reaching parts of the U.S.,” Mr. Trump wrote, somewhat misstating Mr. Kim’s warning. Pyongyang has already tested nuclear weapons underground; the latest threat concerned what Mr. Kim called a “test launch of an intercontinental ballistic missile.” But Mr. Kim also boasted last year that the North had conducted “the first H-bomb test,” and experts say there is no evidence for that claim.

After his first Twitter message, Mr. Trump added: “China has been taking out massive amounts of money & wealth from the U.S. in totally one-sided trade, but won’t help with North Korea. Nice!” That appeared to reflect briefings Mr. Trump has received about how Chinese leaders fear instability and collapse in the North more than the status quo.