Kim was invited by Xi and accompanied by his wife Ri Sol Ju and several top officials on his train journey across the border, the state-run Korean Central News Agency said.
The visit coincides with what is believed to be Kim's 36th birthday and follows a 2018 filled with unprecedented travel for the young dictator.
The visit by Kim suggests that he is seeking Xi's advice or highlighting his country's alliance with China as he prepares for another meeting with Trump.
Kim's visit to China, confirmed by North Korean and Chinese state media, comes amid plans for a second summit with U.S. President Donald Trump aimed at denuclearising the Korean peninsula.
"Kim is eager to remind the Trump administration that he does have diplomatic and economic options besides what Washington and Seoul can offer", Harry J. Kazianis, Director of Defence Studies at the US -based Centre for the National Interest, said in an e-mailed statement.
The trip marked a further break with past practice in that it was announced in advance of Mr Kim's arrival, a possible sign of growing confidence on the part of North Korea and China, Pyongyang's most important trading partner and a key buffer against pressure from Washington.
Kim's four-day visit comes after he expressed frustration in his annual New Year's address over the lack of progress in negotiations with Washington since his unprecedented summit with Trump in Singapore seven months ago.
Kim visited Beijing on his train from March 25 to 28 for his first summit with President Xi, an opportunity to thaw frozen North Korea-China ties.
It is hoped that the US and South Korea can accurately understand the constructive significance of amicable China-North Korea ties to push ahead with denuclearization of the Korean Peninsula. "USA and North Korean officials are believed to have met in Vietnam to discuss the location of a second summit", the Associated Press reports.
Negotiations were under way on the location of their next meeting, Trump said Sunday, while remaining evasive on its timing. The trip comes as Chinese and US officials held a second day of trade talks and as Kim prepares for a second possible meeting with President Donald Trump. North Korea insists that Washington first build trust by lifting the sanctions imposed on that country.
Kim's latest visit coincided with the second day of the crucial trade talks between the United States and Chinese officials here.
The only day North Korea has acknowledged Mr Kim's birthday was in 2014, when visiting basketball star Dennis Rodman sang "Happy Birthday" to him after an exhibition match in Pyongyang.
"The Chinese have been very clear to us that these are separate issues", Pompeo said.
Both Trump and Kim have alluded to a summit being in the works. However, Xi has called on the sides to "meet each other halfway", and China's foreign minister in September urged some form of sanctions relief in response to any positive outcomes from the first Kim-Trump summit.
The Global Times concluded that Beijing would like to see "warming ties between Washington and Pyongyang with an agreement on a road map for denuclearization", but then shrugged and said it was entirely up to Washington to forge such an agreement by convincing Pyongyang to trust the Americans, and then shrugged again and admitted the Trump administration has exceeded all expectations by bringing an end to "nuclear tests, missile tests, and extreme threats" on the Korean Peninsula.
Ties between China and North Korea, which had frayed as Pyongyang stepped up its provocations through a series of missile and nuclear tests, warmed over the previous year as Kim engaged with Beijing as well as Seoul and Washington.