PHNOM PENH (Reuters) - Cambodia’s Deputy Prime Minister Sok An, a close ally of Prime Minister Hun Sen for decades, died on Wednesday at the age of 66, a government spokesman said.

Sok An’s death comes at a difficult time for Hun Sen as he gears up for local elections in June and a general election next year, with critics accusing him of doing anything possible to eliminate rivals and extend his three-decade leadership.

Having served Hun Sen as secretary in the 1980s, Sok An -- one of Cambodia’s 10 deputy prime ministers and the cabinet minister -- was in charge of many influential government authorities, committees and commissions.

Local media said that Sok An ran the government like “a Hindu god of 48 arms”.

“This is a loss of the most active human resource who sacrificed everything for the sake of the Cambodian people,” government spokesman Phay Siphan said, adding that the cause of death has yet to be determined.

Sok An’s roles included negotiations with the United Nations on setting up a tribunal to try those with greatest responsibility for the deaths of 1.8 million people under the Khmer Rouge communist regime in the 1970s.

However, both he and Hun Sen have come under fire from rights campaigners.

Sok An was “a pre-eminent Hun Sen loyalist, prepared to repeat any charge, justify any rights abuse, facilitate any deal and go to any length” to ensure his boss’s - and therefore his own - power and wealth, Phil Robertson, deputy Asia director of New York-based advocacy group Human Rights Watch, said on Wednesday.

Hun Sen, himself a former Khmer Rouge soldier, had more recently been at odds with the the U.N.-backed Khmer Rouge Tribunal for extending its investigations beyond the regime’s core leadership.

Sok An died on Wednesday in Beijing and his body would arrive in Cambodia early on Thursday, Phay Siphan said.