China said on Wednesday North Korean leader Kim Jong Un pledged to denuclearize the Korean peninsula during an historic meeting in Beijing with President Xi Jinping, who promised China would uphold its friendship with its isolated neighbor.

After two days of speculation, China and North Korea both confirmed on Wednesday that Kim had visited Beijing and met Chinese president, Xi Jinping, in an unofficial visit from Sunday to Wednesday.

The trip was Kim's first known journey abroad since he assumed power in 2011 and is believed by analysts to serve as preparation for upcoming summits with South Korea and the United States.

North Korea's KCNA news agency made no mention of Kim's pledge to denuclearize, or his anticipated meeting with U.S. President Donald Trump that is planned for some time in May.

Beijing has traditionally been the closest ally of secretive North Korea, but ties have been frayed by North Korea's pursuit of nuclear weapons and China's backing of tough U.N. sanctions in response.

Xinhua cited Kim as telling Xi that the situation on the Korean peninsula is starting to improve because North Korea has taken the initiative to ease tensions and put forward proposals for peace talks.

"It is our consistent stand to be committed to denuclearization on the peninsula, in accordance with the will of late President Kim Il Sung and late General Secretary Kim Jong Il," Kim Jong Un said, according to Xinhua.

North Korea is willing to talk with the United States and hold a summit between the two countries, he said.

"The issue of denuclearization of the Korean Peninsula can be resolved, if South Korea and the United States respond to our efforts with goodwill, create an atmosphere of peace and stability while taking progressive and synchronous measures for the realization of peace," Kim said, according to Xinhua.