North Korean leader Kim Jong Un told Chinese President Xi Jinping that he was committed to giving up his nuclear weapons if security guarantees were met, during a surprise visit to the Chinese port city of Dalian just weeks ahead of a planned summit between Kim and U.S. President Donald Trump, Chinese state media said late Tuesday.

The talks, held on Monday and Tuesday, came some 40 days after Kim visited Beijing in March to meet Xi on his first trip outside the country since taking over as the North's leader in 2011.

"As long as relevant parties abolish their hostile policies and remove security threats against the DPRK, there is no need for the DPRK to be a nuclear state and denuclearization can be realized," Kim was quoted by China's official Xinhua News Agency as saying, using the acronym for the North's official name, the Democratic People's Republic of Korea.