This article is more than
6 year oldRumours circulated earlier this week after local media reported a high-profile figure had arrived on a special train.
The visit, confirmed by China and North Korea, was Mr Kim's first foreign trip since taking office in 2011.
Mr Kim held "successful talks" with the Chinese leader Xi Jinping in Beijing, Xinhua reports.
The visit is considered a significant step in North Korea's preparation for talks agreed in principle with South Korea and the United States.
Last month, President Donald Trump accepted an unprecedented invitation to meet Mr Kim.
Analysts had said North Korean and Chinese leaders would be likely to meet before that summit goes ahead. China is North Korea's main economic ally.
Xinhua said Mr Kim had assured his Chinese counterpart he is committed to denuclearisation.
North Korea's KCNA news agency called the visit "a milestone" in improving ties with China.
Newer articles
<p>The deployment of Kim Jong-un’s troops has added fuel to the growing fire in recent weeks. Now there are claims Vladimir Putin has put them to use.</p>