After meeting in Beijing, Kim and the Chinese leaders agreed to "jointly pushing forward" six-nation talks on the North's nuclear program, the official Xinhua News Agency said.
The report, issued after the secretive Kim left the Chinese capital on Wednesday, was China's first public confirmation of his three-day visit.
Kim's trip followed Vice President Dick Cheney's visit to Beijing last week, when he urged Chinese leaders to press North Korea to reach a settlement.
Kim, meeting with Chinese President Hu Jintao, said the North "sticks to the final nuclear-weapon-free goal and its basic position on seeking a peaceful solution through dialogue has not changed," Xinhua reported. It said the two leaders "agreed to continue … jointly pushing forward the six-party talks process."
The last round of six-party talks — involving United States, China, the two Koreas, Japan and Russia — ended in February in Beijing without a settlement but a pledge to meet again.
Kim also met former President Jiang Zemin, who now heads the commission that runs China's military. In addition, he met Premier Wen Jiabao, Vice President Zeng Qinghong and Wu Bangguo, the No. 2 leader of China's Communist Party.
South Korean media earlier reported that Chinese leaders had urged Kim to ease his hard-line stance against the United States.
Washington insists on a "complete, verifiable and irreversible dismantling" of all the communist North's nuclear facilities. But Pyongyang says it needs a "nuclear deterrent" against a possible U.S. attack, and would give up its nuclear program only in return for U.S. security guarantees and economic aid.
In his meeting with Jiang, "Kim was believed to have expressed a strong doubt that North Korea would ever get security guarantees from the United States even if it gives up its nuclear programs," the South Korean newspaper Munhwa Ilbo reported, citing unidentified sources in Beijing.
"Jiang was believed to have told Kim that the possibility of the United States invading North Korea was very slim, thus indirectly giving him strong advice for North Korea to change its hard-line stance against the United States."
Chinese media had been silent about Kim's trip, though it was widely reported in South Korean media. Following his departure, Chinese state television showed him hugging each of the leaders and kissing some of them on the cheek.
China says those involved in the six-party talks want to meet again by July, but have been blocked by unspecified differences.
Xinhua said Wednesday the North "will continue to take a patient and flexible manner and actively participate in the six-party talks process, and make its own contributions to the progress of the talks."
China is North Korea's last major ally, and both countries have one-party communist rule. But while China has turned its economy into a market-driven powerhouse, North Korea is wracked by famine and the failures of state planning.
The Stalinist regime's anachronistic ways are more than just an embarrassment for China. Beijing has grown increasingly alarmed that North Korea's nuclear defiance could destabilize the region and even encourage South Korea and Japan to acquire nuclear weapons.
During his 15-hour train ride home, Kim was expected to visit the major industrial centers of Shenyang or Dalian in China's northeast to study government efforts to boost the economy with outside investment.
The standoff with North Korea began in October 2002, when a U.S. envoy said a North Korean diplomat told him the country had a program to make uranium for nuclear weapons.
That led the U.S. to suspend fuel shipments to North Korea, and North Korea retaliated by throwing out international inspectors, exiting the Nonproliferation Treaty and vowing to resume a mothballed plutonium-based program.
Since then, North Korea has issued a series of belligerent threats, vowing to test weapons or sell them. The U.S. believes Pyongyang already has two or so crude nuclear devices.
According to CIA reports, North Korea was also believed to have been developing long-range missiles that could be capable of hitting some parts of the western United States.
Pyongyang says it fears invasion because President Bush listed it in the "axis of evil" and because of the Bush administration doctrine of preemptive war.