North Korean leader Kim Jong-un met with Chinese President Xi Jinping on Tuesday, confirming rumors of the unannounced state visit.
Kim pledged his commitment to denuclearization and to meet US officials, Chinese officials said on Wednesday after the meeting.
After two days of speculation, China and North Korea both confirmed that Kim had traveled to Beijing and met Xi during what China called an unofficial visit from Sunday to Wednesday.
The visit was Kim's first known trip outside North Korea 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 US President Donald Trump that is planned for some time in May.
China has traditionally been North Korea's closest ally but ties have been frayed by its pursuit of nuclear weapons and China's backing of tough UN sanctions in response.
China's Foreign Ministry cited Kim in a lengthy statement as telling Xi the situation on the Korean peninsula was starting to improve because North Korea had taken the initiative to ease tension and put forward proposals for 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 the ministry.
North Korea was 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.
Kim Jong-un's predecessors, grandfather Kim Il Sung and father Kim Jong Il, both promised not to pursue nuclear weapons but secretly maintained programs to develop them, culminating in the North's first nuclear test in 2006 under Kim Jong Il.
The North had said in previous, failed talks aimed at dismantling its nuclear program it could consider giving up its arsenal if the United States removed its troops from South Korea and withdrew its so-called nuclear umbrella of deterrence from South Korea and Japan.
Many analysts and former negotiators believe this still constitutes North Korea's stance and remain deeply skeptical Kim is willing to give up the weapons his family has been developing for decades.
At first wrapped in secrecy, the announcement of Kim Jong-un's visit soon became the third-most discussed topic on China's Weibo microblogging site, although many state media outlets blocked their comments sections.
Widely read Chinese state-run newspaper the Global Times praised the meeting as proving naysayers wrong about Beijing-Pyongyang relations.
"China and North Korea maintaining their friendly relations provides a positive force for the whole region and promotes strategic stability in northeast Asia," it said in an editorial.
Kim's appearance in Beijing involved almost all the trappings of a state visit, complete with an honor guard and banquet at Beijing's Great Hall of the People.
Kim and Xi also met at the Diaoyutai State Guest House, where Kim Il Sung planted a tree in 1959 that still stands.
State television showed pictures of the two men chatting and Kim's wife, Ri Sol Ju, getting a warm welcome from Xi's wife, Peng Liyuan.
China briefed Trump on Kim's visit and the communication included a personal message from Xi to Trump, the White House said in a statement.
"The United States remains in close contact with our allies South Korea and Japan. We see this development as further evidence that our campaign of maximum pressure is creating the appropriate atmosphere for dialogue with North Korea," it said.
Analysts said the meeting strengthened North Korea's position ahead of any meeting with Trump by aligning Beijing and Pyongyang while reassuring China it was not being sidelined in any negotiations.
"It seems that North Korea is not ready to deal with the United States without support and help from its longtime ally China," said Han Suk-hee, professor of Chinese Studies at South Korea's Yonsei University.
A top Chinese diplomat, Politburo member Yang Jiechi, will brief officials, including President Moon Jae-in, in Seoul on Thursday about the Beijing talks, the presidential office in Seoul said.
Kim told a banquet hosted by Xi the visit was intended to "maintain our great friendship and continue and develop our bilateral ties at a time of rapid developments on the Korean peninsula," according to KCNA.
Xi had accepted an invitation "with pleasure" from him to visit North Korea, KCNA said.
China made no mention of Xi accepting an invitation, but Foreign Ministry spokesman Lu Kang pointed to a line in their statement citing Xi as saying he is willing to maintain regular communications with North Korea via visits and exchanges of envoys and messages.
"I have to say that China and North Korea have a tradition of high-level mutual visits," Lu told a daily news briefing.
China had largely sat on the sidelines as North Korea improved relations with South Korea recently, raising worry in Beijing that it was no longer a central player in the North Korean issue, reinforced by Trump's subsequent announcement of his proposed meeting with Kim Jong-un in May.
"China is North Korea's lifeline, so the notion, from a Chinese perspective, that Kim Jong-un could have had these other two meetings before meeting with Xi Jinping, I think the Chinese just thought that is not going to happen," said Paul Haenle, director of the Carnegie–Tsinghua Center in Beijing and the former White House representative to North Korea denuclearization talks from 2007-2009.
By Ben Blanchard and Joyce Lee/Reuters
Additional reporting by Christine Kim and Soyoung Kim in Seoul, David Stanway and John Ruwitch in Shanghai and Ayesha Rascoe in Washingtong; Writing by Lincoln Feast; Editing by Paul Tait, Robert Birsel.