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
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
PHOTO: Bloomberg/Getty Images
Now playing
01:53
Trump threatens tariffs on more Chinese goods
PHOTO: CNN
Now playing
02:52
Trump: Kim Jong Un has been open, terrific
PHOTO: 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
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)
PHOTO: MOHD RASFAN/AFP/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
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)
PHOTO: SAUL LOEB/AFP/AFP/Getty Images
Now playing
02:11
UN: N. Korea still pursuing missiles program
TOPSHOT - North Korea
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)
PHOTO: ANTHONY WALLACE/AFP/AFP/Getty Images
Now playing
02:25
Pompeo: Kim Jong Un not acting consistently
PHOTO: Airbus Defense and Space
Now playing
01:44
New images show N. Korea dismantling test site
PHOTO: 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: 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
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)
PHOTO: 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
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)
PHOTO: Handout/Getty Images AsiaPac/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)
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)
PHOTO: Andrew Harnik/AP
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)
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)
PHOTO: 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
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)
PHOTO: Andrew Harnik/AP
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.

According to Mintaro Oba, a former Korea desk officer at the State Department under President Barack Obama, it is not yet clear whether trade tensions between the US and China are having an impact on negotiations with North Korea, but he warned that Xi could temper his cooperation if tensions continue to rise.

“The Chinese are still trying to preserve the space to climb down from this,” he told CNN. “But if the Trump administration continues to escalate the fight on trade so far that relations sour in a major way, it’s possible the Chinese will feel less and less inclined to cooperate on enforcing and generating pressure on the North Korean regime.”

China has helped make the Trump administration’s “maximum pressure” campaign against North Korea effective, US officials say, but historically Beijing has been slow to apply sanctions against Pyongyang or has looked the other way on Chinese companies doing business with Pyongyang and on North Korean smuggling.

Beijing fears a regime collapse next door that could send desperate refugees flooding across its borders and even worse, the prospect of US troops moving into North Korea as a stabilizing force, bringing them right to Chinese borders.

Looking for leverage

Xi feted Kim during his visit, underscoring the newly warm ties by sending crowds of jubilant children to greet Kim waving Chinese flags and jumping up and down.

The Chinese leader praised Kim for his handling of the US meeting last week in Singapore and conveyed his satisfaction with the results of the summit as well as Pyongyang’s goal of economic development, according to Chinese state media CCTV.

As Trump continues to demand credit for his role in making “initial steps toward a deal” with North Korea by establishing a personal rapport with the young dictator, Kim is pulling all the levers available to strengthen his own negotiating position.

His relationship with China is one of them, according to Richardson, who said Xi holds the power to loosen sanctions that are biting the North Korean economy by looking the other way on cross-border smuggling and energy restrictions imposed by the US and United Nations.

“I believe Kim Jong Un is trying to delay denuclearization and do it at his own pace,” he said, noting that can be accomplished only with sanctions relief from China – a step the North Korean leader views as an apt reward for rapprochement with Trump.

While Trump has publicly claimed to have “solved” the North Korea issue during his made-for-television meeting with Kim, the reality of the situation remains more complex as Kim continues to seek negotiating leverage.

“Kim’s logic is pretty simple: more options, more leverage,” said Oba. “Without engagement with the United States, Kim going to Beijing would make him look desperate and highlight North Korea’s dependence on China.

“And without China clearly backing North Korea, the United States might feel more free to abandon diplomacy and ramp up pressure. Now he gets to look independent and strong while playing both sides to get the best possible situation for North Korea.”

Critics argue that Kim has only been emboldened by Trump’s failure to demand specific concessions when the two met face-to-face.

Sources have told CNN that there is nothing to suggest that North Korea has begun destroying its missile launch sites, despite Trump’s repeated claims to the contrary and his declaration last week that the country is no longer a nuclear threat.

Vipin Narang, an associate professor of political science at the Massachusetts Institute of Technology who studies nuclear proliferation, told CNN that Trump’s decision to suspend August’s joint military drills with South Korea, without demanding North Korea take concrete steps toward disarmament, concedes strategic flexibility to both Kim and Xi.

North Korea and China have long pushed for an end to US military exercises with Japan and South Korea, suggesting that Pyongyang would stop military exercises in return, known as a “freeze for a freeze.”

“Now that Trump seems intent on escalating the trade war with China, if Kim Jong Un decides to skirt the margins of ‘freeze for freeze,’ there isn’t a snowflake’s chance in hell that China sees that as a violation justifying putting any screws on North Korea,” Narang said.

He referenced a recent headline to further illustrate his point.

“The Economist may have said ‘Kim Jong Won,’ ” Narang said, referring to a pun on the magazine’s cover about the summit, “but it really should’ve been Xi Jinping winning,” he said.

CNN’s Steven Jiang and Joshua Berlinger contributed to this report