BEIJING — When the military investigators arrived at the luxurious Beijing villa of General Zhang Yang on November 23, they made a grisly discovery. The 66-year-old, one of China’s highest ranking generals, had hanged himself before he could face questioning over bribery allegations.

Having been relieved of his post as chief of political work in the People’s Liberation Army (PLA) in August, he had disappeared from public view.

Many people assumed he had become yet another high-profile casualty of China’s anti-corruption crackdown. Yet for five days after the discovery of his body, officials deliberated over how to handle the news of his death.

In the end the Central Military Commission issued a six-line statement, confirming that Zhang had been under investigation for corruption since August.

“Evading the punishment of party discipline and law by committing suicide was disgusting conduct,” the defence ministry said.

Zhang’s death brought home the ferocity of the purge enveloping the ranks of the world’s largest army. Since 2012, 16 first and second-class generals — equivalent to five and four-star in the United States military — have been prosecuted for corruption, according to Liu Bojiana researcher at the East Asian Institute of the National University of Singapore.

More than 13,000 senior officers have been investigated according to the PLA Daily, the military’s in-house newspaper, and hundreds more in the lower ranks have been sacked or imprisoned.

What many now view as a political purge forms part of a massive anti-graft campaign spearheaded by Mr Xi, who began his second five-year term as party secretary-general in October.

It has touched every corner of Chinese officialdom from senior Communist party members to local administrators and targeted wealthy business figures. But no institution has been turned upside down more than the PLA, and no Chinese leader since Mao Zedong has done more to reconfigure the relationship between the ruling Communist party — long obsessed by its own survival — and the one institution that can perhaps guarantee it.

Historians have to reach back to the political chaos of the cultural revolution and the succession struggles following the death of Mao in 1976 to find similar turmoil within the ranks of the two million strong PLA.

Those events played out against a backdrop of intense factional disputes within the Communist party. A month after Zhang’s death it was revealed that Gen Fang Fenghui, head of the PLA joint command — equivalent to the US Joint Chiefs of Staff — had also been detained.

He and Zhang were the first sitting members of the CMC, the Communist party vehicle with authority over the PLA, to ever be handed over to prosecutors.

“Something of this magnitude hasn’t happened since the cultural revolution,” says one former military officer who declined to be named.

The last significant purge of the PLA happened after the death in 1971 of Lin Biao, a marshal in the PLA and Communist party vice-chairman, who was accused of fomenting a coup against Mao shortly after his aeroplane crashed in the Mongolian desert. At least 1000 senior officers were arrested including top generals.

Analysts say the downfall of two sitting CMC members could be merely the public face of the internecine struggle being fought behind closed doors in the lead up to the all important 19th Communist Party Congress which took place in October.

“There is no doubt in my mind that something odd happened in late summer in the run-up to the [19th Communist party] Congress when Fang Fenghui and Zhang Yang disappeared,” says Christopher Johnson of the Center for Strategic and International Studies.

“Xi clearly saw something he didn’t like and he moved quickly.”

Some believe Mr Xi is using the anti-graft campaign to settle scores and build his power base within the PLA, which while nominally loyal to the party, has long functioned in the post-Mao era as a state within a state with huge local influence, as well as control over lucrative property holdings.

For Mr Xi, China’s most powerful leader since Mao, curbing the PLA is seen by some as his most significant move and potentially his most dangerous. “There is a very political undertone to it,” says Mr Johnson.

“Strangely enough, no one in the military who is close to Xi has been purged.”

The last major fight between a Chinese leader and the military came after Deng Xiaoping took power in 1978. He chastised the PLA as “having grown fat” after it fought a disastrous 27-day war with Vietnam in 1979 that cost tens of thousands of lives and followed up by forcing military reforms and troop cuts.

Yet the PLA emerged from the Mao era as perhaps the only functioning political institution in the country.

In the decades since, it has resisted attempts by various governments to rein it in and create a modern, effective fighting force.

A key part of those efforts has been to try to dismantle entrenched patronage machines operating inside the PLA, where promotions are bought and sold, and command structures run their units with impunity.

Mr Xi witnessed first hand Deng’s efforts to break down those vested interests as secretary to the then defence minister Geng Biao between 1979 and 1982.

“Xi watched everything that Deng did to bring the military to heel after Mao,” says Dennis Wilder, former CIA deputy assistant director for East Asia and an expert on the PLA who now teaches at Georgetown University.

The prime target for those trying to root out corruption was the military region structure, a legacy of the Mao era, in which the PLA became an instrument of domestic political control and commanders enjoyed near absolute authority.

“Corruption has been endemic in the military,” says Andrew Scobell of the Rand Corporation. “And because leaders at the apex have been able to have almost complete freedom to promote their own people it is hard to break the cycle of cronyism and corruption when many officers benefit career-wise and materially from the status quo.”

The commanders of China’s military regions sat atop vast wealth.

“These guys controlled valuable properties in cities and all kinds of places,” says Mr Wilder. “If the US military in Hawaii could leverage the land that they own on Diamond Head [the scenic seaside landmark] and other places, think about all the money they could make.”

Mr Xi’s predecessors, Jiang Zemin and Hu Jintao lacked the strength to take on the PLA.

“They understood this was a problem, but they did not have the authority over the PLA to do anything about it,” says Mr Wilder.

“Xi saw that corruption was his angle” in asserting his authority over the military, adds Mr Wilder.

The anti-graft crackdown on the armed services began months before Mr Xi took over as president but while he was already vice-chairman of the CMC. In February 2012 lieutenant general Gu Junshan, deputy head of the PLA’s general logistics department, was detained.

Investigators who raided his homes found a gold statue of Mao Zedong as well as a gold model boat and a gold wash basin, according to Chinese media.

Gen Gu was sentenced to death, but the sentence was commuted. That investigation led the authorities to Gen Xu Caihou, who was detained in 2014, and Gen Guo Boxiong, arrested the following year.

Retired members of the CMC, they had both been close to Mr Xi’s former rival Bo Xilai, the one-time Communist party boss of the city of Chongqing, who was imprisoned along with his wife in 2013 following the murder of a British businessman.

After hammering the PLA with corruption prosecutions for three years, Mr Xi in 2015 abolished the remaining seven military regions and transformed them into five geographic command zones similar to Centcom or Pacom, the strategic regions used by the US military, plus joint commands with authority over air, naval, and strategic rocket forces in addition to army units.

Air and naval forces were given wider authority in the general staff, previously dominated by the army, which was itself transformed into a joint command structure. The moves dealt a blow to the culture of the PLA by destroying some of the vested interests that the command structure had helped foster.

The reforms, which include a cut of 300,000 troops, should mean a more professional, high-tech army, and an eventual end to conscription.

China has, in the past two years, also begun stationing armed forces abroad for the first time since the 1950s, with a base in Djibouti, and deploying combat troops under UN mandates in Africa.

It is also increasing its expeditionary capability with five brigades of marines, up from two, and an ambitious production schedule for new aircraft carriers.

In parallel with his efforts to decapitate entrenched networks Mr Xi has begun indulging in North Korea-style military pageantry, presiding over troop inspections, often wearing fatigues, which has not been customary for a Chinese political leader, since the 1950s.

Mr Scobell says Mr Xi “is trying to look like China’s commander-in-chief to bolster his stature and image as China’s strongman . . . he wants to project the Chinese people the image of a powerful dynamic leader and this is certainly one high-profile way to do so.”

The president’s push to reform the PLA is in step with China wanting to take a more assertive role in Asia and beyond. It wants to increase the PLA’s ability to project power as part of a foreign policy — stretching from the South China Sea to Africa and the Middle East — that has abandoned the non-interventionism of the past 30 years.

“No Chinese politician since the 1950s has covered themselves in the military the way Xi has,” says one former Chinese official.

In January, a Xi speech, simultaneously broadcast to every unit in the PLA, admonished the troops “not to fear death”.

When he pushed through a resolution at the 19th Party Congress in October enshrining “Xi Jinping thought” in the constitution, five of the 10 clauses dealt with the military, including: “Build people’s forces that obey the party’s command, [and] can fight and win, and maintain excellent conduct.”

The Congress also revealed that the CMC was being cut from 11 to seven members — further tightening Mr Xi’s hold over it.

“Xi is lavishing attention on the military to win the approval and support of soldiers as a way to compensate for the embarrassment and turmoil he has caused the military [with] the anti-corruption campaign,” says Mr Scobell. He adds that the theatrics — including public oaths of loyalty to the party and even a song dedicated to Mr Xi by the People’s Armed Police — may be an indication that he needs to shore up his power base.

“That he is doing so much of this suggests he might feel insecure,” Mr Scobell adds.

A parade in Inner Mongolia in July featured 12,000 troops, a huge armada of weaponry and, notably, Mr Xi brought no one from the civilian politburo with him.“There were no civilians in sight,” says Mr Wilder. “The message he was sending is that ‘this is my army’.’”