On behalf of the North's ruling party and government, Kim invited Xi "to make an official visit to the DPRK at a convenient time and the invitation was accepted with pleasure", KCNA reported, using the country's official acronym.
North Korea's Kim Jong Un told Chinese President Xi Jinping that it was his "solemn duty" to make Beijing his first overseas destination as he made his maiden foreign trip as leader, Pyongyang's official news agency reported Wednesday.
The relationship between the North and its key protector has soured in recent years, with China increasingly exasperated by its neighbour's nuclear antics, and recently showing a new willingness to enforce United Nations sanctions imposed on it over its weapons and missiles programmes.
KCNA described the visit as unofficial and said it ran from Sunday to Wednesday, implying that Kim's armoured train entered China at the weekend and crossed back into North Korea early Wednesday after leaving Beijing on Tuesday afternoon.
Kim was accompanied by his wife Ri Sol Ju and several officials and dignitaries, KCNA said, without mentioning his sister Kim Yo Jong, who acted as his special envoy to last month's Winter Olympics in the South, which have triggered an unprecedented flurry of diplomatic activity on and around the flashpoint peninsula.
(With inputs from Reuters and AFP)