Kim paid a four-day unofficial visit from Sunday to Wednesday to Beijing at the invitation of Xi, state-run Xinhua news agency reported.

The Chinese government on Wednesday officially confirmed the 'unofficial' visit of North Korean leader Kim Jong-un and his meeting with President Xi Jinping.

Kim paid a four-day unofficial visit from Sunday to Wednesday to Beijing at the invitation of Xi, state-run Xinhua news agency reported.

As per reports, Kim arrived in China by a special train from across the border and left in the same train on Tuesday. During the visit, which was kept highly confidential, Xi held talks with Kim at the Great Hall of the People in Beijing.

Xi and his wife Peng Liyuan held a welcoming banquet for Kim and his wife Ri Sol Ju and watched an art performance together, the report said. Premier Li Keqiang, Vice-President Wang Qishan and other top leaders of the ruling Chinese Communist Party of China, (CPC) attended related activities, respectively, it said.

During the talks, Xi welcomed Kim warmly and appreciated his congratulatory message greeting him for his re-election as the General Secretary of CPC and head of the military as well as president for the second five-year term, the report said.

Xi said Kim's current visit to China had come "at a special time" and was of great significance. "We speak highly of this visit," Xi told Kim.For his part, Kim said a series of major and happy events had taken place consecutively in China recently and referred Xi's re-election for the second term.

Kim said it was his obligation to come congratulate Xi in person, in line with the DPRK-China friendly tradition, the report said.

Kim was quoted as saying that many important changes have taken in the Korean Peninsula where the situation is developing rapidly and he felt he should come in time to inform Xi in person the situation "out of comradeship and moral responsibility".

This was Kim's first visit abroad and came ahead of his planned summit with US President Donald Trump. Yesterday, China had parried questions over Kim's visit amid intense media speculation.

Though allies, the China-North Korean relations went through some testing times since Kim took over as the supreme leader of the country as he pressed ahead with his nuclear programme disregarding caution from Beijing.

Relations between the two countries have been strained after Beijing beefed up UNsanctions by blocking essential supplies like oil and coal following pressure from Trump.

In his talks with Kim, Xi said that China and the Democratic People's Republic of Korea (DPRK), the official name for North Korea, had "traditional friendship" which was "the precious wealth" of both sides.

Xinhua quoted Xi as saying that that the traditional China-DPRK friendship should be passed on continuously and developed better.

"This is a strategic choice and the only right choice both sides have made based on history and reality, the international and regional structure and the general situation of China-DPRK ties. This should not and will not change because of any single event at a particular time," Xi was quoted as saying.

Xi reportedly said that China was willing to work with the DPRK to promote long-term, healthy and stable development of China-DPRK relations that would benefit the two countries, its peoples, and regional peace, stability and development.

Xi made four proposals concerning the development of China-DPRK relations: continuation of high-level exchange, including close communication between him and Kim; make full play of strategic communication; actively advance peaceful development; cement the popular will foundation for China-DPRK friendship enhancing people to people contacts.

Kim said he was greatly encouraged and inspired by Xi's important views on DPRK-China friendship and the development of relations between the two parties and countries. The two sides informed each other of their respective domestic situation.