Given that it takes more than 14 hours from Beijing to the border city of Dandong by train, Kim stayed less than two days in the capital city.
Kim travelled to China - his most important security and trade partner - before meetings a year ago with Trump and South Korean President Moon Jae-in.
North Korean leader Kim Jong Un has reportedly told the leader of his only major ally, China, that he wants to "achieve results" on the nuclear standoff on the Korean Peninsula in a second summit with President Donald Trump.
Kim Jong Un's train left Beijing on Wednesday after the North Korean leader visited his key ally on a trip seen as a strategy session ahead of his expected summit with Donald Trump.
Kim reportedly said North Korea "will continue sticking to the stance of denuclearization and resolving the Korean Peninsula issue through dialogue and consultation, and make efforts for the second summit between (North Korean) and US leaders to achieve results that will be welcomed by the global community".
Xi was quoted as saying that China supports the U.S.
According to North Korea's own news reports Kim told Xi that the North remains unchanged in its push to seek a negotiated resolution of the nuclear standoff.
The unannounced trip was largely shrouded in secrecy.
India's lower house passes citizenship bill that excludes Muslims
Replying to a debate on the Bill, Home Minister Rajnath Singh said, the bill is not just for Assam but for other states too.
The Xinhua report described Kim's meeting with Xi, which was held on what was believed to be the North Korean leader's 35th birthday, as being held with a "cordial and friendly atmosphere".
Before Kim's first visit to China last March, the relationship between Kim and Xi was anything but warm - they kept each other at arm's length despite years of propaganda claiming the two countries were as close as "lips and teeth". His delegation was seen off by high-ranking Chinese officials and honour guard at a Beijing train station and could return to North Korea as soon as Thursday morning, Yonhap said.
Mr Xi agreed that North Korea's reasonable concerns must be addressed properly, it said.
Lu continued, "China supports the two sides in continuing with their dialogue and striving for positive outcomes".
"The US is translating Kim's trip to China as (part of) a war of nerves".
Pyongyang needed to take "bold, practical measures for denuclearisation" to ensure sanctions are lifted, he told reporters, but added that "corresponding measures" were also needed from the U.S., such as agreeing a "peace regime" and formally declaring an end to the 1950-53 Korean War.
Pyongyang and Washington have been locked in a stalemate over how to carry out the agreements they reached in their first-ever summit in June, at which Kim promised to work toward complete denuclearization in exchange for security guarantees from the US.
The visit coincided with negotiations between United States and Chinese officials in Beijing to resolve a bruising trade war between the world's two biggest economies. This time, Kim was accompanied by his wife, Ri Sol Ju, and North Korean Vice Chairman Kim Yong Chol, who is in charge of nuclear talks with the United States.
Mr Moon, who has over the past year played mediator between North Korea and the USA, said at a news conference on Thursday that Seoul would cooperate with the United States in resolving the issue of sanctions on North Korea.
Multiple diplomatic sources have said that the Vietnamese government has said it desires to host the second North-U.S. summit.