BEIJING - One of the most senior Chinese military officers to be accused of corruption has died of cancer, the state news agency Xinhua said on Monday, sparing the government what could have been an embarrassing trial.

Xu Caihou retired as vice chairman of the powerful Central Military Commission in 2013 and from the ruling Communist Party’s decision-making Politburo in 2012. In a brief statement released shortly after midnight, Xinhua said that Xu had died in hospital on Sunday of multiple organ failure bought on bybladder cancer.

His illness had previously been reported by the government.

Though he has died, his “illegal gains” will still be dealt with in accordance with the law, the report added, without providing details. China’s Defence Ministry carried the same Xinhua report on its website.

It was not immediately possible to reach family members for comment.

The official PLA Daily, in a commentary on its microblog, said that Xu ended his “pathetic and shameful life” on a sickbed under supervision.

“Corruption in the military is the most dangerous kind, for if the military tolerates corruption it tolerates defeat in battle,” it added.

President Xi Jinping heads the Central Military Commission, which controls the 2.3 million-strong armed forces, and has made weeding out corruption in the military a top goal.

The government said in October than Xu had confessed to taking “massive” bribes in exchange for help in promotions. Xu had been under investigation since last March, state media said.

His death means the ruling Communist Party will not have to risk the embarrassment that could have come from a trial and the details of graft in the highest echelons of power that it might have revealed, though the trial likely would have been held behind closed doors.

But China is also investigating a second former top military officer on suspicion of corruption, two independent sources told Reuters recently.

Guo Boxiong, 72, was another vice chairman of the Central Military Commission until he stepped down in 2012. The government has yet to confirm the probe.

China intensified its crackdown on corruption in the military in the late 1990s, banning the People’s Liberation Army from engaging in business. But the military has been involved in commercial dealings in recent years due to a lack of checks and balances, military analysts have said.