A reach stacker transports a shipping container in a terminal at the Yangshan Deep Water Port in Shanghai, China, on Friday, March 23, 2018. The trade conflict between China and the U.S. escalated, with Beijing announcing its first retaliation against metals levies hours after President Donald Trump outlined fresh tariffs on $50 billion of Chinese imports and pledged there's more on the way. Photographer: Qilai Shen/Bloomberg via Getty Images
Bloomberg/Getty Images
A reach stacker transports a shipping container in a terminal at the Yangshan Deep Water Port in Shanghai, China, on Friday, March 23, 2018. The trade conflict between China and the U.S. escalated, with Beijing announcing its first retaliation against metals levies hours after President Donald Trump outlined fresh tariffs on $50 billion of Chinese imports and pledged there's more on the way. Photographer: Qilai Shen/Bloomberg via Getty Images
Now playing
01:53
Trump threatens tariffs on more Chinese goods
CNN
Now playing
02:52
Trump: Kim Jong Un has been open, terrific
Pleiades © CNES 2018, Distribution Airbus DS
Now playing
01:08
New North Korea images spark concern
US Secretary of State Mike Pompeo (3rd L) shakes hands with North Korea's Foreign Minister Ri Yong Ho (3rd R) as they arrive for a group photo at the ASEAN Regional Forum Retreat during the 51st Association of Southeast Asian Nations (ASEAN) Ministerial Meeting (AMM) in Singapore on August 4, 2018. - Leaders, ministers and representatives are meeting in the city-state from August 1 to 4 for the ASEAN Ministerial Meeting (AMM). (Photo by Mohd RASFAN / AFP)        (Photo credit should read MOHD RASFAN/AFP/Getty Images)
MOHD RASFAN/AFP/AFP/Getty Images
US Secretary of State Mike Pompeo (3rd L) shakes hands with North Korea's Foreign Minister Ri Yong Ho (3rd R) as they arrive for a group photo at the ASEAN Regional Forum Retreat during the 51st Association of Southeast Asian Nations (ASEAN) Ministerial Meeting (AMM) in Singapore on August 4, 2018. - Leaders, ministers and representatives are meeting in the city-state from August 1 to 4 for the ASEAN Ministerial Meeting (AMM). (Photo by Mohd RASFAN / AFP) (Photo credit should read MOHD RASFAN/AFP/Getty Images)
Now playing
01:49
Pompeo delivers Trump's letter to N. Korea
TOPSHOT - US President Donald Trump (R) poses with North Korea's leader Kim Jong Un (L) at the start of their historic US-North Korea summit, at the Capella Hotel on Sentosa island in Singapore on June 12, 2018. - Donald Trump and Kim Jong Un have become on June 12 the first sitting US and North Korean leaders to meet, shake hands and negotiate to end a decades-old nuclear stand-off. (Photo by SAUL LOEB / AFP)        (Photo credit should read SAUL LOEB/AFP/Getty Images)
SAUL LOEB/AFP/AFP/Getty Images
TOPSHOT - US President Donald Trump (R) poses with North Korea's leader Kim Jong Un (L) at the start of their historic US-North Korea summit, at the Capella Hotel on Sentosa island in Singapore on June 12, 2018. - Donald Trump and Kim Jong Un have become on June 12 the first sitting US and North Korean leaders to meet, shake hands and negotiate to end a decades-old nuclear stand-off. (Photo by SAUL LOEB / AFP) (Photo credit should read SAUL LOEB/AFP/Getty Images)
Now playing
02:11
UN: N. Korea still pursuing missiles program
TOPSHOT - North Korea's leader Kim Jong Un (L) shakes hands with US President Donald Trump (R) after taking part in a signing ceremony at the end of their historic US-North Korea summit, at the Capella Hotel on Sentosa island in Singapore on June 12, 2018. - Donald Trump and Kim Jong Un became on June 12 the first sitting US and North Korean leaders to meet, shake hands and negotiate to end a decades-old nuclear stand-off. (Photo by Anthony WALLACE / POOL / AFP)        (Photo credit should read ANTHONY WALLACE/AFP/Getty Images)
ANTHONY WALLACE/AFP/AFP/Getty Images
TOPSHOT - North Korea's leader Kim Jong Un (L) shakes hands with US President Donald Trump (R) after taking part in a signing ceremony at the end of their historic US-North Korea summit, at the Capella Hotel on Sentosa island in Singapore on June 12, 2018. - Donald Trump and Kim Jong Un became on June 12 the first sitting US and North Korean leaders to meet, shake hands and negotiate to end a decades-old nuclear stand-off. (Photo by Anthony WALLACE / POOL / AFP) (Photo credit should read ANTHONY WALLACE/AFP/Getty Images)
Now playing
02:25
Pompeo: Kim Jong Un not acting consistently
Airbus Defense and Space
Now playing
01:44
New images show N. Korea dismantling test site
CNN
Now playing
01:32
Clarke: Trump diminishes US role and influence
Now playing
01:16
Source: N. Korea seeking 'bold move' from US
Now playing
02:07
Trump privately expressed N. Korea frustration
Photo Illustration/Getty images
Now playing
02:01
North Korea officials skip meeting with US
SINGAPORE, SINGAPORE - JUNE 12:  In this handout photograph provided by The Strait Times, North Korean leader Kim Jong-un (L) with U.S. President Donald Trump (R) during their historic U.S.-DPRK summit at the Capella Hotel on Sentosa island on June 12, 2018 in Singapore. U.S. President Trump and North Korean leader Kim Jong-un held the historic meeting between leaders of both countries on Tuesday morning in Singapore, carrying hopes to end decades of hostility and the threat of North Korea's nuclear programme. (Photo by Kevin Lim/The Strait Times/Handout/Getty Images)
Kevin Lim/The Strait Times/Handout/Getty Images
SINGAPORE, SINGAPORE - JUNE 12: In this handout photograph provided by The Strait Times, North Korean leader Kim Jong-un (L) with U.S. President Donald Trump (R) during their historic U.S.-DPRK summit at the Capella Hotel on Sentosa island on June 12, 2018 in Singapore. U.S. President Trump and North Korean leader Kim Jong-un held the historic meeting between leaders of both countries on Tuesday morning in Singapore, carrying hopes to end decades of hostility and the threat of North Korea's nuclear programme. (Photo by Kevin Lim/The Strait Times/Handout/Getty Images)
Now playing
01:28
Trump touts North Korea denuclearization
SINGAPORE - JUNE 12: In this handout photo, North Korean leader Kim Jong-un shakes hands with U.S. President Donald Trump during their historic U.S.-DPRK summit at the Capella Hotel on Sentosa island on June 12, 2018 in Singapore. U.S. President Trump and North Korean leader Kim Jong-un held the historic meeting between leaders of both countries on Tuesday morning in Singapore, carrying hopes to end decades of hostility and the threat of North Korea's nuclear program. (Photo by Kevin Lim/THE STRAITS TIMES/Handout/Getty Images)
Handout/Getty Images AsiaPac/Getty Images
SINGAPORE - JUNE 12: In this handout photo, North Korean leader Kim Jong-un shakes hands with U.S. President Donald Trump during their historic U.S.-DPRK summit at the Capella Hotel on Sentosa island on June 12, 2018 in Singapore. U.S. President Trump and North Korean leader Kim Jong-un held the historic meeting between leaders of both countries on Tuesday morning in Singapore, carrying hopes to end decades of hostility and the threat of North Korea's nuclear program. (Photo by Kevin Lim/THE STRAITS TIMES/Handout/Getty Images)
Now playing
01:56
Kim Jong Un snubbed Mike Pompeo, source says
U.S. Secretary of State Mike Pompeo, left, speaks during a meeting with North Korean Director of the United Front Department Kim Yong Chol at the Park Hwa Guest House in Pyongyang, North Korea, Friday, July 6, 2018. Pompeo is on a trip traveling to North Korea, Japan, Vietnam, Abu Dhabi, and Brussels. (AP Photo/Andrew Harnik, Pool)
Andrew Harnik/AP
U.S. Secretary of State Mike Pompeo, left, speaks during a meeting with North Korean Director of the United Front Department Kim Yong Chol at the Park Hwa Guest House in Pyongyang, North Korea, Friday, July 6, 2018. Pompeo is on a trip traveling to North Korea, Japan, Vietnam, Abu Dhabi, and Brussels. (AP Photo/Andrew Harnik, Pool)
Now playing
02:09
N. Korea to Pompeo: You may not have slept well
WASHINGTON, DC - MAY 09:  National Security Adviser John Bolton speaks on a morning television show from the grounds of the White House, on May 9, 2018 in Washington, DC. Yesterday President Donald Trump announced that America was withdrawing from the Iran nuclear deal.  (Photo by Mark Wilson/Getty Images)
Mark Wilson/Getty Images
WASHINGTON, DC - MAY 09: National Security Adviser John Bolton speaks on a morning television show from the grounds of the White House, on May 9, 2018 in Washington, DC. Yesterday President Donald Trump announced that America was withdrawing from the Iran nuclear deal. (Photo by Mark Wilson/Getty Images)
Now playing
01:34
Bolton: US has plan for denuclearizing N. Korea
U.S. Secretary of State Mike Pompeo, second from right, greets Kim Yong Chol, second from left, a North Korean senior ruling party official and former intelligence chief, as they arrive for a meeting at the Park Hwa Guest House in Pyongyang, North Korea, Friday, July 6, 2018. Pompeo is on a trip traveling to North Korea, Japan, Vietnam, Abu Dhabi, and Brussels. Also pictured is Andrew Kim, the head of the CIA's Korea Mission Center, right. (AP Photo/Andrew Harnik, Pool)
Andrew Harnik/AP
U.S. Secretary of State Mike Pompeo, second from right, greets Kim Yong Chol, second from left, a North Korean senior ruling party official and former intelligence chief, as they arrive for a meeting at the Park Hwa Guest House in Pyongyang, North Korea, Friday, July 6, 2018. Pompeo is on a trip traveling to North Korea, Japan, Vietnam, Abu Dhabi, and Brussels. Also pictured is Andrew Kim, the head of the CIA's Korea Mission Center, right. (AP Photo/Andrew Harnik, Pool)
Now playing
02:43
Trump touts confidence in Kim Jong Un
(CNN) —  

North Korean leader Kim Jong Un ended a celebratory visit to China’s President Xi Jinping on Wednesday with tea, praise, handshakes – and a message for the US.

Amid lingering questions over Pyongyang’s willingness to denuclearize and an escalating trade war between the US and China, Kim’s trip reinforced the idea that Beijing remains a key player – a variable that President Donald Trump needs and yet one that remains outside his control.

Administration officials have said that they will maintain sanctions on North Korea even as talks continue, and stand ready to intensify that economic pressure should Pyongyang fail to cooperate. But China, North Korea’s biggest trading partner, ultimately has power over whether sanctions on Pyongyang truly bite.

With tensions climbing between Beijing and Washington over trade, some analysts point to the warmth on display during Kim’s visit to Beijing as a warning from Xi that Trump’s moves on trade could undermine the most ambitious goal – peace with North Korea – on his foreign policy agenda.

“I think China is sending a message to Trump: You want to put trade tariffs on us and have our cooperation with North Korea? You can’t have both,” Bill Richardson, the former US energy secretary, ambassador and repeat US envoy to North Korea, told CNN.

Complex relationships

Kim’s visit was his third pilgrimage to Beijing in as many months and came just days after the North Korean dictator’s high-profile June 12 summit with Trump in Singapore.

Publicly, Xi has vowed to maintain a constructive role in facilitating efforts toward denuclearization and supported North Korea’s commitment to that goal despite issues with the US over trade.

But tensions are rising. On Monday, Trump ordered the US trade representative to prepare new tariffs on $200 billion in Chinese imports. Trump was reacting angrily to Beijing’s decision to match $50 billion in tariffs he placed on Chinese goods on June 15 to protest China’s “unfair trade practices.”

“Again and again the US has been provoking a trade war,” China’s Foreign Ministry spokesman Geng Shuang said Tuesday. He said China does not wish to fight a trade war, “but is not scared of one.”

“We advise the US side to return to reason, and stop words and actions that harm itself and others,” Geng said.

On Tuesday, State Department spokesperson Heather Nauert cautioned against conflating disagreements over trade with China’s cooperation in talks with North Korea, noting that the US maintains complex relationships with many countries.

“We have areas where we work with China and have – and we have strong relations, but there are also areas where we’re not always in agreement with China, and we will certainly bring those to light,” she said, highlighting the “good work that President Xi and the Chinese government have done in helping to bring North Korea to the negotiating table.”

“We want to have a constructive relationship with the government of China. In order to do that, we need to repair, make some progress on some issues related to trade,” Nauert said.