Xi is the first Chinese president to visit North Korea in 14 years, after relations between the Cold War era allies deteriorated over Pyongyang's nuclear provocations and Beijing's subsequent backing of UN sanctions.
But as he embarked on a flurry of diplomacy last year, Kim ensured that Xi -- the leader of his country's key diplomatic supporter and main provider of trade and aid -- was the first head of state he met.
The North Korean has now visited his older ally four times in China and Pyongyang has been increasingly keen for Xi to reciprocate, while according to diplomats Beijing has been biding its time to see how nuclear talks between Kim and Trump play out.
But Beijing's own trade negotiations with Washington hit a wall last month and some analysts say Xi is now looking for leverage ahead of his meeting with Trump at next week's G20 summit in Japan.
"When both China & North Korea are confronted by US, they have a lot to discuss with each other," Lijian Zhao, the deputy chief of mission of China's embassy in Pakistan, wrote on Twitter.
Kim met Xi at Pyongyang airport as he began a two-day state visit with his wife Peng Liyuan, Foreign Minister Wang Yi, and other officials, according to Chinese state media.
Portraits of the two leaders stood outside the terminal, pictures showed, and a 21-gun salute was fired.
Chinese flags hung throughout the capital and hundreds of thousands of residents were lined up along the streets according to CCTV -- standard procedure when a foreign leader visits the isolated North, whose authorities are adept at mounting spectacular displays.
But in an unprecedented move, Xi was welcomed at the Kumsusan Palace, the mausoleum where the preserved bodies of the North's founder Kim Il Sung and successor Kim Jong Il -- the grandfather and father of the current leader -- lie in state.
Kim and Xi went on to hold formal talks, Xinhua reported.
The Rodong Sinmun newspaper, the mouthpiece of the ruling party, devoted the top half of its front page to the visit, with a colour picture of Xi accompanying a profile.
In an editorial, it said the trip at a time of "complex international relations" showed that the leadership in Beijing attached "high importance on the DPRK-China friendship".
"Our people are proud of having a trustworthy and close friend like the Chinese people," it added.
- Symbolic visit -
Xi's visit will be largely symbolic, with no formal joint communique expected -- as was the case with Kim's April summit with Russian President Vladimir Putin in Vladivostok, Russia.
Authorities have imposed tight restrictions on coverage. International journalists in Pyongyang were told they would not be able to cover it, while foreign media organisations initially invited to attend proved unable to secure visas.
Sources said the Chinese media delegation accompanying Xi was also reduced in size from initial plans.
The North wants to demonstrate to Trump that it has China's support with nuclear negotiations at a standstill after Trump and Kim's second summit broke up without a deal.
In Hanoi in February the two men disagreed in February on what Pyongyang would be willing to give up in exchange for sanctions relief.
For the North the visit "will serve to show the US that China has its back and to send a message to Washington it should stop its maximum pressure posture", said Lim Eul-chul, professor of North Korean studies at Kyungnam University.
Analysts say the trip is equally a chance for China to showcase its influence in the region and the talks process, at a time when it is at loggerheads with the US over trade.
In clear assertion of Beijing's role, Xi said in a rare opinion piece in the Rodong Sinmun that China would play an active part in "strengthening communication and coordination" between the North and "other relevant parties" to push forward negotiations.
Beijing has fretted over being sidelined after the North Korean leader agreed to meet Trump last year, with the US leader going as far as declaring he had fallen "in love" with Kim.
"Xi wants everyone to remain acutely aware that he can influence Kim, and that no comprehensive, durable deal with North Korea can occur without China's assistance -- and approval," Scott Seaman, Asia director of the Eurasia Group consultancy, said in a research note.
Beijing sees the North as a strategic buffer, keeping the 28,500 US troops in South Korea far from its borders, and Xi's trip will include a visit to pay homage at Pyongyang's Friendship Tower, a monument to the millions of Chinese troops who saved Kim Il Sung's forces from defeat during the Korean War.
But Zhao Tong, North Korea expert at the Carnegie Tsinghua Center think tank in Beijing, said Xi and Kim were unlikely to have substantive discussions on denuclearisation, because "China and North Korea do not have enough mutual trust".