In their first and only meeting, President Obama explicitly warned Donald Trump days after the election about the urgency of North Korea’s nuclear weapons threat.

A few weeks later, it was clear that Obama had made an impression: Trump raised the matter out of the blue in a telephone conversation with Taiwanese President Tsai Ing-wen, according to an Asia expert at the State Department who reviewed a transcript.

“What Tsai Ing-wen knows about North Korea could fill a thimble. It’s not the focus of her world,” said the official, who spoke Wednesday on the condition of anonymity to discuss the private call. “But that brought home to me that it really got through to Trump that this was a real problem.”

To a degree that even Obama might not have anticipated, the early warning in the Oval Office last November motivated Trump to elevate North Korea to his chief foreign policy concern — after rarely talking about it during the campaign. Trump’s administration has used diplomacy, economic sanctions and displays of military power in a bid to alter Pyongyang’s calculus over its pursuit of nuclear weapons capable of reaching the continental United States.

Yet it is the increasingly bellicose, often contradictory, rhetoric from Trump himself that has marked the sharpest shift in U.S. policy toward North Korea from previous administrations. Having declared an end to the Obama era of “strategic patience” that focused on isolating Pyongyang, Trump has failed to articulate a clear alternative. He has vacillated between courting China’s help and giving up on Beijing — and between suggesting he is opening to meeting with North Korean dictator Kim Jong Un and threatening to obliterate his regime.

On Tuesday, Trump vowed in spontaneous remarks not vetted by aides that Pyongyang would be met with unprecedented “fire and fury” if it did not stop its threats — a pledge that some outside the White House interpreted as an allusion to nuclear war.

“That wasn’t what we had in mind,” Ben Rhodes, a former deputy national security adviser for Obama, said in an interview. “It’s clear that they got the message that this was the principal challenge for them, but they keep making statements that don’t feel like they have been informed by some deliberative process.”

Trump aides sought to tamp down talk of war, saying the president was intent on delivering a stern message “in terms Kim Jong Un would understand,” according to Secretary of State Rex Tillerson. They emphasized that while the White House remains committed to resolving the matter through diplomatic means, Trump has sent clear directives that the United States must be prepared to defend itself if necessary.

“President Trump was informed of the growing threat last December and on taking office his first orders to me emphasized the readiness of our ballistic missile defense and nuclear deterrent forces,” Defense Secretary Jim Mattis said in a statement.

Even as advisers sought to portray a commander in chief with a laserlike focus on North Korea, Trump, who took office with virtually no foreign policy experience, has given the impression of a president who is learning on the job and experimenting with policy through trial and error.

Daniel Russel, who served as Obama’s senior Asian affairs director on the National Security Council, said the U.N. Security Council’s move last week to ban some North Korean exports is a potentially meaningful step that comports with efforts of previous U.S.> administrations.

But Russel added that Trump’s rhetoric is “a departure from the temperate, consistent and balanced statements of past presidents that combined expressions of firm resolve with an openness to peaceful resolution through negotiations. Nobody is going to beat the North Koreans in a hyperbole contest.”

Obama highlighted North Korea in his meeting with Trump two days after the election. Aides who traveled with Obama to an Asia-Pacific economic forum in Peru in late November recalled him saying that Trump seemed to “sit up and take notice.”

The Obama team expected Trump to undertake the sort of deep-dive review and interagency decision-making process that it had employed, Rhodes said. Obama was frequently criticized by Republicans as being too deliberative, or, as Trump called him on the campaign trail, weak and indecisive. But Rhodes said the goal was to produce unity and clarity across the administration, rather than the kind of whipsaw tone and message that has marked the North Korea issue under Trump.

Initially, Trump appeared to think he could outsource the problem to China, a strategy deemed simplistic and naive by foreign policy experts who say Beijing has limited influence with the North and strategic interests that diverge from the United States’.

Leading up to a summit in early April with Chinese President Xi Jinping at Mar-a-Lago, his resort in Palm Beach, Fla., Trump bashed Beijing as not doing enough to rein in Kim’s government. But after his conversations with Xi, “I realized it’s not so easy,” Trump told the Wall Street Journal. “I felt pretty strongly that they had a tremendous power over North Korea. But it’s not what you would think.”

Later that month, Trump continued to try to enlist regional partners in phone calls to Southeast Asian leaders.

In a conversation with Philippines President Rodrigo Duterte, Trump called Kim “a madman with nuclear weapons,” and he asked Duterte whether Kim was “stable or not stable,” according to a transcript obtained by The Washington Post.

The United States has “a lot of firepower over there,” Trump boasted, including two nuclear submarines ordered to the region by the Pentagon.

But three days later, Trump told Bloomberg News that he would be “honored” to meet Kim “under the right circumstances,” opening the possibility of bilateral or multilateral talks. No sitting U.S. president has met with a North Korean leader.

In another interview with CBS News, Trump called Kim “a pretty smart cookie” and expressed admiration for the North Korean leader’s having assumed power “at a very young age” after the death of his father, Kim Jong Il.

“What is alarming to allies and probably confusing to China is that the statements are all over the map,” Rhodes said. “One day we’re conciliatory; the next day we’re threatening ‘fire and fury.’ ”

Trump told Duterte that he hoped “China solves the problem” and encouraged the Philippines leader to talk directly to Xi and “tell him I am counting on him.”

Two months later, however, Trump appeared to lose faith in Beijing. The turning point came after Otto Warmbier, an American college student who was detained in North Korea for 17 months, died days after his release due to injuries suffered in captivity.

“While I greatly appreciate the efforts of President Xi & China to help with North Korea, it has not worked out,” Trump wrote in a tweet.

Nine days later, the Treasury Department announced sanctions on the Bank of Dandong, a Chinese entity near the border with North Korea, cutting off its access to U.S. financial markets.

White House aides said Trump’s focus on the issue has already paid dividends, pointing out that China, contrary to its past opposition to broad economic sanctions, voted in support of last week’s U.N. sanctions on North Korea

But Jim Walsh, a nuclear and Asia security expert at the Massachusetts Institute of Technology, was skeptical about Trump’s strategy.

“It seems to me that an impromptu nuclear doctrine without having consulted staff or allies is not really a great idea,” he said.