WASHINGTON — A day after Secretary of State Rex Tillerson suggested a possible diplomatic breakthrough with nuclear-armed North Korea, President Trump undercut his top diplomat Sunday, saying Tillerson “is wasting his time.”

The stunning rebuke was the latest incident in which Trump has publicly contradicted Tillerson, and quickly dashed any hope for progress in easing a perilously volatile dispute with the government in Pyongyang, which has threatened to destroy the United States just as Trump has threatened the same against North Korea.

Tillerson said Saturday in Beijing that the U.S. had opened direct “lines of communication” with North Korea over its aggressive program to build a nuclear arsenal.

“We’re not in a dark situation, or blackout,” Tillerson said. “We can talk to them, we do talk to them.”

The comments suggested that Washington was perhaps finally moving toward accepting the reality of Kim Jong Un having nuclear weapons and instead attempting to contain him, as many foreign leaders and some former American officials have urged.

But within hours of Tillerson’s return to Washington on Sunday, Trump took to Twitter from his New Jersey golf club.

“I told Rex Tillerson, our wonderful secretary of state, that he is wasting his time trying to negotiate with Little Rocket Man,” Trump wrote, using a derisive nickname he created for Kim.

“Save your energy, Rex. We’ll do what has to be done!” Trump tweeted, once again injecting a measure of instability into the fraught relations with the isolated country.

Trump has resorted to bellicose rhetoric with North Korea, while Tillerson has repeatedly advocated diplomacy. That gulf in approach seemed wider now than ever after Trump contradicted his adviser.

Trump has insisted that a military operation is a real possibility, but most experts agree that war on the Korean peninsula would quickly cost thousands of lives.

The public disparaging also raised more questions about how long Tillerson will remain in office. Already, rumors have been swirling that he was pondering resignation from a job he has said he never wanted. The former chief executive of Exxon Mobil has denied he was planning to leave his position, although that was before the weekend controversy.

In a rare moment of candor several months ago, Tillerson expressed frustration with the bureaucracy of the State Department and diplomacy in general. And in apparent allusion to Trump, he said he missed being the “ultimate decider” as he was as CEO.

Veteran diplomats and foreign policy experts in the U.S. and elsewhere have been shocked by Trump’s blithe belittling of his secretary of state, especially considering its potential to diminish Tillerson’s leverage and influence in the world.

Former State Department spokesman Nicholas Burns said on Twitter that “undercutting your secretary of state publicly is a cardinal sin of diplomacy.”

“Unpresidential,” he said.

Earlier this year, Trump also touched off a major crisis in the Persian Gulf region that put him at odds with Tillerson.

Trump sided with Saudi Arabia against its tiny neighbor Qatar. He accused Qatar of being a major “funder” of terrorism, although far more terrorists have come from Saudi Arabia. He also backed a blockade against the gas-rich emirate, even though it is the site of the region’s largest U.S. military base.

Tillerson struggled to defuse that dispute, meeting with and cajoling both the Saudis, who were allied with Egypt, Bahrain and the United Arab Emirates, and the Qataris. He publicly called for an end to the blockade, only to be contradicted less than an hour later by Trump, who insulted Qatar directly in remarks from the Rose Garden.