HONG KONG (BLOOMBERG) - Kim Jong Un just sent a powerful message to US President Donald Trump ahead of planned talks: China is back on North Korea's side.
The North Korean leader and his wife received a warm welcome in his first trip abroad since taking power in 2011, holding talks with President Xi Jinping and meeting a host of dignitaries.
Xi told Kim that China has made a "strategic choice" to have friendly ties with North Korea, and they will "remain unchanged under any circumstances".
The surprise, highly secretive four-day trip ends a period of frosty ties between the longtime allies as China backed increasingly tough economic sanctions against North Korea over its nuclear and missile programmes.
Xi avoided meeting Kim during his first five years in power, and the countries traded barbs at each other through state-run media.
The shift ensures that China's interests are protected during Kim's planned summit with Trump, and also gives North Korea an insurance policy if talks collapse.
While the White House said the Kim-Xi summit showed that its pressure campaign was working, closer China ties would help North Korea undermine sanctions and raise the cost of any US military action even further.
"If you are the Trump White House right now, you've got to be very concerned," said John Park, director of the Korea Working Group at Harvard Kennedy School.
"As much as the official White House line says that maximum pressure is what brought about yet another diplomatic summit, the reality is you move away from the primary focus on maximum pressure to one huge massive pressure release valve."
North Korea's official media made no mention of denuclearisation or Kim's planned meeting with Trump, instead focusing on the lavish greeting he received in Beijing.
China's readout said Kim was willing to meet Trump and South Korean President Moon Jae In, and said that he could give up his nuclear weapons if both countries take "progressive and synchronous measures for the realization of peace".
That's where any talks risk breaking down.
Trump's decision to appoint hardliners such as John Bolton as National Security Adviser and CIA director Mike Pompeo as Secretary of State may have put added pressure on North Korea before the summit, say analysts.
"It seems that North Korea is not ready to deal with the United States without support and help from its longtime ally China," Han Suk Hee, professor of Chinese Studies at Yonsei University, told Reuters.
The appointments have heightened fears that the US might resort to military action if Trump is disappointed by his meeting with Kim.
Trump last week fired H.R. McMaster as national security adviser and replaced him with John Bolton, a former envoy to the United Nations who last month wrote a commentary titled "The Legal Case for Striking North Korea First".
Kim Jong Un and Bolton Learned Very Different Lessons From Libya
While Bolton has said that he'll start with a fresh slate in his new role, earlier this month he said Trump should demand that North Korea immediately agree to pack up its nuclear program and have it shipped to the US - similar to what happened in Libya.
If Kim refused, he added, it could be a "very short meeting".
"These military options are back on the table, so North Korea needs a stronger China in the whole negotiating process," said Bernt Berger, senior fellow on Asia at the German Council on Foreign Relations in Berlin.
At the same time, China didn't want to be left out of the loop.
While China opposes North Korea's nuclear weapons, it also wants to prevent a collapse of Kim's regime or war on the Korean Peninsula.
Any instability - or alternatively, a deal that leads to a US-aligned unified Korea - potentially could put American troops on its border.
"Beijing feels very nervous about a possible fundamental shake-up in Northeast Asia if Kim and Trump can successfully resolve the nuclear issue," said Zhang Baohui, director of the Centre for Asian Pacific Studies at Lingnan University in Hong Kong.
"The Chinese may have thrown the olive branch to Kim to keep him on its side."
China is Indispensable
The meeting also gives China some more leverage as faces a potential trade war with Trump.
Earlier this month, the US president signed a law upgrading the diplomatic status of Taiwan, a move that risks inflaming tensions with China.
In practical terms, the Chinese overtures suggest that any meetings Kim holds with Trump and Moon may eventually pave the way for a return of the six-party talks on North Korea's nuclear programme. Those discussions, which also included China, Japan and Russia, broke down in 2009.
In the near term, Kim will be looking for relief from sanctions that have crimped exports of everything from coal to seafood while also curbing oil imports.
Over the long term he wants a peace treaty that formally ends the Korean War and ensures that his family's interests are protected.
To achieve those goals, it was essential for Kim to shore up the support of North Korea's biggest trading partner and economic lifeline before heading into talks with Trump.
"China is indispensable to North Korea, and there is no way that Kim will initiate talks with President Trump without consulting China," said Shi Yongming, a former Chinese diplomat who is now a research associate at the China Institute of International Studies. "What happens next depends on the U.S. because the Trump administration is full of hawkish officials."