BEIJING/SEOUL (Reuters) - 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.

TRUMP-XI CALL

Trump and Xi discussed developments on the Korean peninsula and Kim’s visit to China during a phone call on Tuesday morning, the White House said.

Trump and Xi agreed on the importance of maintaining sanctions on Pyongyang until it permanently dismantles its nuclear and missile programs, the White House said. Chinese state media said Xi reiterated China’s support for a U.S.-North Korea summit.

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.

SMILING KIM ACCOMPANIED BY SISTER

Kim was accompanied to China by his sister, Kim Yo Jong, who has played a leading role in diplomatic overtures by the long-isolated country.

Chinese state media showed pictures of Kim smiling in an outdoors meeting with Xi, and the two leaders strolling along a waterfront.

Xi hosted a banquet and told Kim of his backing of North Korea’s “strategic shift towards economic development”, Xinhua added.

Slideshow ( 13 images )

“China supports North Korea’s upholding of denuclearization on the peninsula, and supports North Korea and the United States resolving the peninsula issue through dialogue and consultation,” Xi said.

North Korean state media said Kim was “very pleased” that the relationship with China was reaching a high point, and North Korea would cooperate with China more actively as the situation on the Korean peninsula changed.

The two leaders “opened their hearts and had warm conversations,” North Korea’s state news agency KCNA reported.

Slideshow ( 13 images )

LATEST SUMMIT

The meeting was the latest in a series by North Korean leaders and follows Kim’s historic summit with South Korean President Moon Jae-in last month.

In March, Kim traveled by train to Beijing, his first known trip abroad since assuming power in 2011.

Kim used his official aircraft to make the short flight to Dalian, in what was his first known international flight since assuming power.

Kim’s father, Kim Jong Il, feared flying, fuelling speculation that the younger Kim may not be willing to travel far to meet Trump. The venue for their summit has not been announced.

The demilitarized zone, or DMZ, between North and South Korea, and Singapore are believed to be the most likely contenders for the venue.

South Korea’s presidential office said the Chinese government notified Seoul about the Xi-Kim meeting in advance.

Intense secrecy typically surrounds high-level North Korean visits to China, and this week’s trip was no different.

Throughout the day on Tuesday there was speculation on Chinese websites that a North Korean leader was in China, though China’s foreign ministry said earlier it had no information and Chinese state media did not carry any reports.

Japanese public broadcaster NHK had shown images of two North Korean aircraft taxiing at Dalian’s airport, one an Air Koryo plane and another carrying a North Korean emblem.

Posts about unusual traffic jams and security in Dalian popped up on Chinese social media.