BEIJING — President Hu Jintao of China praised North Korea and its ailing leader, Kim Jong-il, for giving “top priority to improving people’s lives,” according to a report on Thursday night by Xinhua, the state news agency. Mr. Hu made his remarks during a six-day tour of China by Mr. Kim, and they reflected China’s hopes that North Korea would move toward major economic reforms.

The same Xinhua report commented on Mr. Kim’s reaction to the economic prosperity he saw throughout China, where he traveled in a private armored train: “He said the Chinese people are now engaged in economic and social development and he marveled at the amazing changes he saw during the visit.”

China is North Korea’s closest ally, and Mr. Kim’s visit, his third since May 2010, comes at a critical time. North Korea is facing a severe food shortage and is casting about for aid. A team of officials from Washington is in Pyongyang, the North Korean capital, to assess the extent of the crisis.

Mr. Kim is also seeking to shore up Beijing’s support for his heir apparent, Kim Jong-un, his third and youngest son. The trip also gives Mr. Kim an opportunity to talk to Chinese officials about moving his nation’s command economy more toward market reforms, but it is unclear how sincere Mr. Kim is about pushing such changes.