BEIJING — China and North Korea praised their deepening cooperation Wednesday, as North Korean leader Kim Jong Un continued his first state visit to China and the two countries sought to draw closer.

China has long been North Korea’s main diplomatic backer and economic lifeline. Kim’s visit is his seventh to China since he took office in late 2011. Questions about the relationship have emerged in recent years as Kim has prioritized ties with Russia, supplying weapons and troops to support its war against Ukraine.

Chinese President Xi Jinping and Kim, accompanied by their wives, Peng Liyuan and Ri Sol Ju, chatted over tea at Zhongnanhai, a former imperial garden that now serves as the headquarters of China’s top leadership, state broadcaster CCTV reported. Xi said they had held fruitful talks the previous day.

“We reached a new and important consensus on continuing to maintain high-quality, high-level exchanges, deepening and expanding practical cooperation and strengthening people-to-people and cultural exchanges to foster bonds between the peoples,” Xi was quoted as saying.

CCTV reported that Kim said he had in-depth exchanges with Xi and hoped to strengthen contact with China through party-to-party and local channels.

Kim arrived in Beijing on Tuesday aboard his private train and received a lavish welcome ceremony before meeting Xi. His itinerary in China was unclear. CCTV said Xi and Peng held a luncheon for Kim and his wife on Wednesday after the tea gathering.

China’s official Xinhua News Agency reported that Kim also visited the Party School of the ruling Chinese Communist Party’s Central Committee. He said he hoped party schools in the two nations would strengthen cooperation.

Relations between China and North Korea appeared to be warming. Xi made a rare trip to North Korea in June. Four months later, a new bridge linking the two countries opened, and Kim later made a one-day trip to China via the crossing.

CCTV earlier reported Xi saying China’s position on attaching great importance to their “traditional friendship” would not change. Kim said developing the “most special, sincere and durable strategic relations” with China was a top foreign-policy priority, according to North Korea’s official Korean Central News Agency.

Andrew Yeo, the SK-Korea Foundation Chair at the Brookings Institution’s Center for Asia Policy Studies, said Kim sees value in North Korea’s relationships with both Russia and China. In the long term, he said, ties between Beijing and Pyongyang are “the more consequential of the two,” given their historic links and Beijing’s greater geopolitical influence compared with Russia’s.

Yeo expects trade and investment between the two nations to continue growing, Chinese tourism to North Korea to rise and meetings between senior officials to continue at a steady pace.

“A key question is how Beijing will navigate its relationship with South Korea as it strengthens bilateral ties to North Korea,” he said.