After several days of rumours - the secretive visit was confirmed on Wednesday by Chinese and North Korean state media.
Kim Jong Un did indeed came to Beijing this week, travelling in his green bullet-proof train with yellow stripes, similar to the one his late father used when travelling abroad.
The leader and his wife were met with honour guards and a banquet hosted by President Xi, and the two men held talks at the imposing Great Hall of the People.
During the meeting, Chinese media reported that Kim said he was "committed to denuclearisation" and willing to hold summits with South Korea and the US.
Diplomatic relations between the North and its main ally China have been strained since Beijing threw its support behind United Nations sanctions over Pyongyang's nuclear programme.
Analysts says China is keen to ensure North Korea does not cut a deal with the US that might hurts Chinese interests in the region.
The Chinese leader said he was willing to maintain frequent contact with Kim "under the new circumstances".
This comes as preparations get underway for Kim to hold a summit next month with South Korea's Moon Jae-in, ahead of a planned meeting with US President Donald Trump in May.
About the prospects of North Korea denuclearising, RFI's Seoul correspondent Jason Strother said that North Korea has told South Korean officials, who visited Pyongyang earlier this month, that he (Kim Jong Un) would denuclearise if the security of his regime is guaranteed.
North Korea has for decades called for the removal of the US forces from South Korea.
"Pyongyang has also said that it wants American nuclear weapons removed from South Korea. But as far as we all know, the US took out its tactical nukes back in the early 1990s. Yet North Korea insists that they are still here. So we are not too sure where they are going to set the bar for them to denuclearise," he added.