Xi knows value of welcome for region's prodigal son
The fast-moving diplomatic game which is being played out over North Korea's nuclear weapons programme has seen Kim Jong-un emerge as a major figure on the world stage while China was being left behind.
Mr Kim is heading into an important summit next month with South Korean leader Moon Jae-in, ahead of a meeting with US President Donald Trump before the end of May. Time was running out for Chinese President Xi Jinping to act if he wanted to play any part in shaping a new political order in north-east Asia.
So the 21-carriage train that pulled into Beijing on Monday under a heavy police guard not only carried Mr Kim on his first overseas trip but also the hopes of the Chinese president to get back into the mix.
Paul Haenle served on the American National Security Council under Presidents George W Bush and Barack Obama. He is now working as the director of the Carnegie-Tsinghua Centre for Global Policy in Beijjng.
"It seems that China is not comfortable with the idea of Kim meeting with Moon and Trump before having ever met with Xi," he said.
"Beijing has significant interests and huge stakes in any outcomes of upcoming summits and did not want to be on the sidelines as a spectator as this important diplomacy unfolds."
So, like a prodigal son returning to his father, Kim Jong-un was at Xi Jinping's side when they needed each other most. Mr Kim wrote notes when Mr Xi spoke, nodded approvingly at his host's words and when it was his turn to speak, he did it from a pre-prepared script. There was no question that the North Korean leader was the junior partner.
However, beyond the brief glimpse into the two leaders' relationships, the power play developing in front of the cameras showed Mr Xi's desire to slot back into the driving seat ahead of unexpected bilateral talks on China's doorstep. Bonnie Glaser, senior advisor for Asia at the Centre for Strategic and International Studies in Washington, said: "Xi wants to ensure that Chinese interests are protected in any future deal making."
But while Mr Xi would have been enjoying the platitudes during the visit, the message from both countries was clear. Mr Kim may be considered a wayward upstart by much of the global community, but China and North Korea remain allies.
"This should dispel any doubt that there is real daylight between China and North Korea," said Bill Bishop, a China expert who writes the influential 'Sinoicism' newsletter.
This is no new reality, however, but more of a resumption of the usual order of north-east Asia politics. It has served both China and North Korea well in the past. The nations have a historic relationship born on the battlefield of the 1950-53 Korean War. To use Mao Tse-tung's famous analogy, the two nations are closer than "lips and teeth".
However, in more recent times, with Beijing backing hard-hitting sanctions on Mr Kim's regime and Pyongyang causing alarm in China with a series of missile launches, many believed the strong bonds between the two neighbours had been severed.
North Korea mending those fences with China would provide a significant boost for Mr Kim as he goes into his talks. Hua Po, a Beijing-based independent commentator on North Korean issues, said: "Kim's meetings are not going to be easy or smooth but will be a complicated and tough process. So Kim has no choice but to come to Beijing in advance to talk with Chinese leaders and reach a consensus."
With an emboldened Mr Kim and Mr Xi being placed firmly back in the driving seat, the battle lines for upcoming talks are already being drawn.