Xi said China and North Korea should use the stability of their bilateral ties to counter the uncertainties of a changing external environment and that China's firm support for Kim's socialist policy will remain unwavering, KCNA state news agency reported.
"It is the primary task of my country and a firm choice of the party and the republic to strengthen and develop North Korea-China ties... to the most unique, sincere and solid strategic partnership," Kim was quoted as saying.
Kim arrived in Beijing on Tuesday in his armoured train for the first state visit by a North Korean leader since 1982, which analysts said could be an attempt to bolster his leverage before any potential renewed diplomacy with the United States.
Kim and his wife, Ri Sol Ju, were received by Xi in a grand welcoming ceremony with a 21-gun salute and children singing in chorus "North Korea-China Friendship is Everlasting" in Korean and Chinese, KCNA said.
During their meeting, Xi said China attaches great importance to its "traditional friendship" with North Korea, adding that this stance "will not change" and that bilateral relations have "withstood the test of a changing international landscape".
Xi said the two sides should "firmly safeguard their respective strategic interests and regional peace and stability".
Following a lull in exchanges after the COVID-19 pandemic, when North Korea imposed one of the tightest lockdowns, Kim has stepped up courting China, calling for cooperation in all areas.
Kim hosted Xi in June in Pyongyang, where the two agreed to expand cooperation and strengthen strategic communication.
South Korea's intelligence service has said Kim was expected to return home on Thursday.
The trip marks Kim's second meeting this year with Xi and his seventh visit to China since 2018.