China's president signed trade deals with Cuba and agreed to help its communist ally modernize its ports and hospitals on Tuesday, part of a Latin America trip on which Chinese businessmen have been snapping up raw materials. Taking the long view at a time of financial crisis, China is investing heavily in commodity-producing countries, and Cuba is no exception. More than a dozen deals agreed to by President Hu Jintao included purchases of Cuban nickel and sugar, along with pledges to send food and building materials to help the Caribbean nation recover from three major hurricanes. Hu signed off on a second, $70 million phase of $350 million in Chinese credit to renovate Cuban hospitals. China also committed to help renovate Cuba's crucial, but aging, ports. It was unclear how many of the deals were on credit. Havana has already borrowed extensively from Beijing - loans it might have trouble repaying as it recovers from Hurricanes Gustav, Ike and Paloma, all of which hit Cuba this year. Hu thanked Cuba for sending doctors to China after last year's devastating earthquake, and for educational programs on the island attended by about 2,000 Chinese, including medical students. China's president also met with ailing former President Fidel Castro. Cuba released a photo of the pair shaking hands and chatting. Hu wore a business suit and the former Cuban president had on exercise clothing that has become his standard uniform since undergoing emergency intestinal surgery and disappearing from public view in July 2006. Cuban authorities provided no further details, but China's official Xinhua News Agency said the two held a long discussion. “I see in person that you have recovered and have been energetic, so I feel very pleased,” Xinhua reported Hu told Castro. Castro replied: “We are old friends. I am happy to see that you are as energetic as when I met you last time.” Hu met with Castro during his first visit to Cuba in 2004. The 82-year-old has an undisclosed illness and brother Raul Castro, five years his junior, formally succeeded him as president in February. Accompanying Hu on a visit to a school for Chinese students on Tuesday, Raul Castro sang snippets of a song about China and Mao Zedong he said he learned while traveling the world in 1953. At first, hundreds of students gathered in an auditorium seemed confused, but they soon sang along, clapping in time. “Even though the physical distance that separates China and Cuba is great, friendship between both people goes back a long way,” Hu said. Cuba depended heavily on Soviet largesse and turned a cold shoulder to China during the Cold War's Sino-Soviet split. But ties warmed after the breakup of the Soviet Union in 1991, and Cuba now has no problem dealing with both Beijing and Moscow. With bilateral trade topping $2.6 billion a year, China is Cuba's No. 2 trading partner after Venezuela, where socialist President Hugo Chavez provides nearly 100,000 barrels of oil a day to the island at favorable prices. The ties have brought a tangible benefit to residents of the Cuban capital, where more than 3,000 shiny new Yutong buses replaced smoke-belching, Soviet era buses. But Hu's visit poses something of an ideological challenge, since some Cubans speculated that Raul Castro might follow a Chinese model of reform after becoming president in February. China transformed its economy three decades ago by embracing market reforms even as its Communist Party maintained strict political control. Cuba's communist government, however, still controls well over 90 percent of the economy and shows no sign of easing its grip on political or economic matters.