BEIJING — He was one of China’s most prominent commanders, with hopes of rising higher. So when Gen. Fang Fenghui disappeared from public view, it sent a clear warning to the top leaders of the People’s Liberation Army: President Xi Jinping was not done shaking up their once-unassailable ranks.
General Fang, the chief of the army’s Joint Staff Department, was not the only military leader to fall ahead of next week’s Communist Party congress. Gen. Zhang Yang, the director of the military’s political department, also vanished from sight. Their names have not appeared in the Chinese news media for more than a month, when their successors were announced with no fanfare.
Removing the two generals was the latest step by Mr. Xi to strengthen his grip on the military, a pillar of Communist Party power. On the eve of the party congress, which will kick off his second five-year term as the nation’s leader, he seems to have concluded that he must exert greater control to remake the country’s armed forces into a power worthy of China’s global standing.
Mr. Xi’s reorganization of the military has already gone further than seemed possible under his recent predecessors, but as the overhaul and its attendant personnel cuts have begun to take shape, Mr. Xi has confronted poor coordination among branches of the armed forces and foot-dragging from senior officers whose positions have been threatened.
“The removal of those top leaders, senior elderly generals and admirals, is part of a broader drive to promote and advance younger, more professionally minded officers,” said Timothy R. Heath, an expert on the Chinese military at the RAND Corporation. “There are huge numbers of top brass in the P.L.A.; it’s top-heavy, and huge numbers of these guys are going to lose their jobs.”
Mr. Xi “has been able to take political control of the military to an extent that exceeds what Mao and Deng have done,” said Tai Ming Cheung, a professor at the University of California, San Diego, who studies China’s defense forces. “He has already demonstrated ahead of the congress his ability to elevate key commanders that are close to him.”
The abrupt disappearance of the two generals before the congress underlined how ruthlessly Mr. Xi was willing to act. He is now poised to cement his control by installing a new cohort of civilian and military leaders loyal to him and his vision for the Chinese military.
Before his abrupt removal, General Fang, 66, had seemed positioned for promotion at the congress. He had recently laid out China’s stance on North Korea to his visiting American counterpart and was enforcing Mr. Xi’s overhaul. He even accompanied Mr. Xi to Florida in April for a summit meeting with President Trump at his golf resort in Palm Beach.
General Fang, however, seems to have fallen afoul of Mr. Xi, for reasons that are not fully apparent. He has been put under investigation on suspicion of abuses of office, two former officials in Beijing said, confirming reports that first appeared in several overseas news outlets. Both spoke on the condition of anonymity, fearing recrimination for discussing internal affairs. One said General Zhang, 66, was also under investigation.
They are not the first commanders purged under Mr. Xi. There have been trials of dozens of high-ranking officers, including the two highest-ranking generals ever toppled for corruption in modern China: Guo Boxiong and Xu Caihou, two former vice chairmen of the Central Military Commission, the party committee that commands China’s armed forces.
“Strong Military,” an eight-part documentary series shown on Chinese television in recent weeks, said that Mr. Xi had to act urgently because bribery and embezzlement in the top ranks had corroded morale and threatened battle-readiness in the armed forces.
One episode showed the confessions of Generals Guo and Xu as well as a luxurious compound that another fallen general had turned into his private playground.
“The problems of corruption and work style in the armed forces weren’t just harming the image of the military, they were badly damaging morale in the ranks,” Wan Minggui, a commissar in the Chinese military, says in the documentary. “It really had reached the point where something had to be done.”
For Mr. Xi, gaining firmer control of the military could help ensure his grip on power during his second terms as party leader and president, which he is all but certain to receive at this month’s party congress and a session of China’s legislature next year.
It could also be a way for Mr. Xi to extend his influence beyond a second term. Two predecessors, Deng Xiaoping and Jiang Zemin, wielded influence after retiring from other official posts by staying in charge of the Central Military Commission, which Mr. Xi now leads.
The party congress, scheduled to open Oct. 18, could fill the 11-member commission with younger commanders loyal to Mr. Xi or shrink the size of the commission to enhance his say. Separately, dozens of other rising military officers are likely to be promoted to the Central Committee, the party’s highest organ, whose some 200 voting members oversee governance of the entire nation, not just the military.
“The control of the military is an ironclad insurance policy for Xi,” said Minxin Pei, a professor at Claremont McKenna College in California who studies Chinese politics. “If Xi has complete control of the military, nobody dares lift a finger.”
Mr. Xi’s reshuffling of the military leadership is also aimed at accelerating the changes he has sought in the People’s Liberation Army, which, for all its size and influence, had become sclerotic and inward-looking.
Since late 2015, Mr. Xi has reorganized the army to weaken the traditional land forces and shift more resources to the technology-dependent naval, air and missile forces. Seven military regions — the heart of the old arm-focused system — were replaced with five new theater commands, and the army is cutting 300,000 enlisted soldiers and officers, paring the military to two million personnel.
Mr. Xi wants to create an integrated armed forces that can enforce China’s claims to disputed islands in the East and South China Seas, offset American influence and protect China’s growing interests as far away as Africa, Latin America and the polar regions.
It is a military that, while not yet a rival to the United States, could soon be one.
“China’s military modernization is targeting capabilities with the potential to degrade core U.S. military-technological advantages,” the Pentagon’s annual report to Congress on China’s military abilities asserted.
China’s military spending, officially $144 billion in 2016, still lags far behind the more than $600 billion spent last year by the United States. China, though, spends nearly three times as much as Russia, and its annual defense budgets are expected to continue to grow 7 percent per year on average, the report said.
“If I look out to 2025, and I look at the demographics and the economic situation, I think China probably poses the greatest threat to our nation,” Gen. Joseph F. Dunford Jr., the chairman of the Joint Chiefs of Staff, testified at his Senate reconfirmation hearing.
The biggest challenges to Mr. Xi’s military modernization may involve updating attitudes as well as technology. It could take years for new commanders to overcome rivalries and learn to operate jointly in the fog of war. But experts already credit with Mr. Xi with making significant progress in creating a leaner, more modern, more professional force.
“No one had the political mojo to pull it off until Xi Jinping, and Xi Jinping only had an anticorruption campaign to use as a hammer,” said James Mulvenon, a specialist on China’s military at SOS International, a firm that provides security services and advice. “The P.L.A. has known that they have to go to a joint force structure and get rid of the military regions for 25 years, but they had not been able to generate the political will to be able to do that. He was able to do it.”