Chinese President Xi Jinping and Kim Jong Un met in China for the second time in six weeks on Tuesday, signalling their warming ties ahead of the North Korean leader’s expected summit with US President Donald Trump.

Shortly after the meeting was made public, Trump tweeted that he would speak to his “friend” Xi about North Korea later on Tuesday.

Kim’s trip to the northeastern port city of Dalian was his second visit to China since March, highlighting efforts by the Cold War-era allies to mend relations that have chilled as Beijing has supported UN sanctions over Pyongyang’s nuclear activities.

Beijing is keen to avoid being left out in the cold in a whirlwind of diplomacy that has led to Kim’s historic summit last month with South Korean President Moon Jae-in and his expected meeting with Trump in June.

But Kim’s second trip abroad in such a short time — after having never left North Korea since coming to power in 2011 — shows that Beijing still has a central role to play in the diplomatic shuffle.

“After the first meeting between me and Comrade Chairman (Kim), both China-DPRK relations and the Korean peninsula situation have made positive progress. I feel happy about it,” Xi said, according to the official Xinhua news agency.

North Korea’s official KCNA news agency said Xi and Kim “exchanged warm greetings, unable to hold back joy at meeting again”.

“The respected leader (Kim) also expressed pleasure at the bilateral ties that are enjoying a new heyday, and praised that the high-level exchanges and strategic communication between the two countries have reached an unprecedented level,” according to KCNA.

For his part, Trump tweeted that “the primary topics” of his discussion with Xi “will be Trade, where good things will happen, and North Korea, where relationships and trust are building.”

Chinese state broadcaster CCTV showed Xi and Kim taking a seaside stroll and holding talks in a conference room with several officials, while Xinhua said the two leaders met on Monday and Tuesday.

Xi said he was willing to meet Kim again, and backed North Korea’s adherence to the denuclearisation of the peninsula and the dialogue between Pyongyang and Washington, Xinhua said.

“China is willing to continue to work with all relevant parties and play an active role in comprehensively advancing the process of peaceful resolution of the peninsula issue through dialogue, and realising long-term peace and stability in the region,” Xi said.

The Chinese leader also voiced support for North Korea “shifting its strategic focus to economic construction”.

Xinhua said Kim spoke “highly of Xi’s profound vision and extraordinary wisdom” and “expressed his gratitude to China” for its contribution to the denuclearisation and peace efforts.