China initially refused to support the rebels or to criticize Qaddafi, but started building ties to the insurgents as the months-long Libya conflict wore on. Jetisoning any last vestige of neutrality, China’s Foreign Ministry called Friday for the rapid launch of an inclusive political process and economic reconstruction in Libya.

Meanwhile, state media outlets began referring to Qaddafi in disparaging terms not seen before. As recently as late August, Qaddafi had been portrayed in relatively complimentary terms as a “Middle Eastern strongman” who defied Western threats and pressure. On Friday, however, the Web sites of both the official Xinhua News Agency and People’s Daily newspaper ran photos of him, including those of his corpse, alongside side captions describing him as insane.

“The death of Qaddafi concludes the Middle East’s era of madmen,” people.com.cn said, while xinhuanet.com wrote simply, “The Middle Eastern madman Qaddafi.”

Foreign Ministry spokeswoman Jiang Yu also urged national unity and the restoration of social stability in Libya, but it did not directly comment on Qaddafi’s death.

“We have noted the relevant reports. At present, a new page has been turned in the history of Libya,” Jiang said.

“We hope Libya will rapidly embark on an inclusive political process, maintain ethnic solidarity and national unity, swiftly establish social stability, begin economic reconstruction, and allow the people to live in peace and happiness,” she said.

China abstained in the UN Security Council vote on whether to use force to protect civilians from Qaddafi’s troops and was highly critical of the NATO air campaign that helped unseat the dictator. During the fighting, Beijing maintained contacts with Qaddafi’s regime, even while gradually opening links to the rebels.

Beijing was the last member of the UN Security Council to formally recognize on Sept. 12 the transitional council as the ruling authority of Libya, and only after it had provided Beijing with assurances that business contracts signed under Qaddafi would continue to be honored.

China had accused NATO of overstepping its UN mandate, and Chinese diplomats say that strengthened Beijing’s opposition to similar action against Syria’s regime, which was accused of atrocities against civilian protesters.

China joined with Russia earlier this month in vetoing an already watered-down UN resolution criticizing the Syrian leadership, saying it objected to its holding open the possibility of sanctions against it.

Considerable sympathy for Qaddafi remained on Internet forums, including the popular Weibo microblogging site where ordinary Chinese feel freer to express personal views.

“Deeply mourn Libya’s former leader Qaddafi, friend of the Chinese people. He died a heroic death,” read one comment, signed “Yuan Jun.”

“Heroic warrior against Western imperialism, slain by the Western bullets wielded by his own people,” read another on the Sohu site, signed simply “Shanghai Internet user.”

China’s negative views of the uprisings in Libya, Syria, Egypt and elsewhere do not come without risk.

Spokesmen for Libya’s new government have said they may discriminate against Chinese companies because of Beijing’s failure to provide strong support, in contrast to France, Italy and other countries that early on condemned Qaddafi and fervently backed the air campaign.

China had invested billions of dollars in Libyan projects, including housing and railway construction, and was forced to send military cargo planes and a navy frigate to aid in the evacuation of more than 30,000 Chinese workers in the country when the conflict erupted in February.