North Korea has provoked a conflict with the United States and its Asian allies in recent weeks with its sixth test of a nuclear bomb and its first successful tests of intercontinental ballistic missiles that could potentially deliver a warhead to the United States mainland. Mr. Trump has responded by vowing to “totally destroy” North Korea if forced to defend the United States or its allies, while ratcheting up economic pressure through sanctions.

Mr. Tillerson told reporters traveling with him in Beijing on Saturday that he was seeking a diplomatic solution. “We are probing, so stay tuned,” he said. For the first time, he disclosed that the United States had two or three channels to Pyongyang asking “Would you like to talk?” Therefore, he said, “we’re not in a dark situation, a blackout.”

There have been no indications that Mr. Kim is any more interested in talks than Mr. Trump. He has responded to the president’s threats with more of his own, castigating Mr. Trump as a “mentally deranged U.S. dotard” and suggesting through his foreign minister that he might order the first atmospheric nuclear test the world has seen in 37 years.

Negotiations with North Korea have long proved frustrating to American leaders. Mr. Bush and President Bill Clinton both tried talks and granted concessions while ultimately failing to prevent North Korea from developing nuclear weapons. But national security analysts have said there is no viable military option at this point without risking devastating casualties.

White House officials made no official comment on Mr. Tillerson’s disclosure or Mr. Trump’s reaction, but advisers privately said the president was upset at being caught off guard. At the same time, they did not rule out diplomacy as a possible path forward eventually. On the campaign trail last year, Mr. Trump expressed a willingness to negotiate with Mr. Kim over a hamburger. He plans to visit China, South Korea and Japan in November, among other destinations, to keep up regional pressure on Pyongyang.

Despite the president’s message, Mr. Tillerson’s spokeswoman said diplomacy remained possible. “#DPRK will not obtain a nuclear capability,” Heather Nauert, the State Department spokeswoman, wrote on Twitter after Mr. Trump’s tweet, using initials for the Democratic People’s Republic of Korea. “Diplomatic channels are open for #KimJongUn for now. They won’t be open forever.” She did not explain what she meant about not obtaining a nuclear capability, which North Korea already has.

Senator Bob Corker, Republican of Tennessee and chairman of the Senate Foreign Relations Committee, said the United States had no choice but to seek a diplomatic agreement.