North Korean leader Kim Jong Un visited China and met President Xi Jinping, state media of both countries said on Tuesday, their second encounter in two months in a flurry of diplomatic engagement that has eased tensions on the Korean peninsula.

They met on Monday and Tuesday in the coastal city of Dalian ahead of what would be a historic meeting between Kim and U.S. President Donald Trump that the White House has said could take place as soon as this month.

China has been keen to show it has an indispensable role in seeking a lasting solution to tension over North Korea’s pursuit of nuclear weapons, concerned that its interests may be ignored, especially as North Korea and the United States establish contacts.

During the visit, announced only after it was over, Kim told Xi he hoped relevant parties would take “phased” and “synchronized” measures to realize denuclearization and lasting peace on the Korean peninsula.

“So long as relevant parties eliminate hostile policies and security threats toward North Korea, North Korea has no need for nuclear (capacity), and denuclearization can be realized,” China’s official Xinhua news agency cited Kim as saying.

Kim told Xi the denuclearization of the peninsula was North Korea’s “constant and clear position”, and that dialogue between North Korea and the United States could build mutual trust.

Chinese state television said Xi said he “hopes the United States and North Korea can build mutual trust, synchronize actions, resolve each sides’ concerns through meeting and consultations, consider North Korea’s reasonable security concerns, and jointly promote the political resolution process to the Korean peninsula issue.”

In the past North Korea has used the term “hostile policies” in reference to the U.S. troop presence in South Korea, the U.S. nuclear umbrella covering South Korea and Japan and regular joint military exercises in South Korea.

China is North Korea’s most important economic and diplomatic backer, but Beijing has been angered by Pyongyang’s repeated nuclear and missile tests and supported tough U.N. sanctions against its Cold War-era ally.

The two sides have stepped up engagement since Trump surprised the world in March by saying he would be willing to meet Kim in a bid to resolve the crisis over Pyongyang’s development of nuclear missiles capable of hitting the United States.