President Volodymyr Zelensky of Ukraine announced on Friday that his government was dismissing all of the country’s regional military recruitment chiefs to crack down on corruption, after multiple revelations of officers taking bribes to let men evade being drafted into fighting the Russian invasion.

The announcement this week that since the invasion prosecutors had opened 112 cases against 33 officials involved in recruitment offered the latest evidence that the war had provided new avenues for the entrenched governmental corruption that has long plagued Ukraine. Two recruitment officers have been accused in recent days of enriching themselves by falsifying documents that label men as unfit for service — in some cases collecting $10,000 per head.

The allegations come as bombs are falling on civilians, soldiers are dying, Ukraine is trying to enlist more troops to replace those killed or wounded, and millions are sacrificing to ensure the nation’s survival.

Mr. Zelensky did not hide his contempt in announcing that he was firing the 24 regional recruitment chiefs, saying in a video posted on social media that “the system should be run by people who know exactly what war is and why cynicism and bribery during war is treason.” Those officers who are removed but have committed no wrongdoing, he added, should serve at the front “if they want to keep epaulets and prove their dignity.”

All of the existing heads of the centers will be replaced by “soldiers who have been at the front or who cannot be in the trenches because they have lost their health, lost their limbs.”

Corruption over draft evasion strikes a nerve for people like Oksana Borkun, whose husband, Volodymyr Hunko, was killed fighting the Russians. “Indignation arises, anger, both toward those who give a bribe and those who take it,” said Ms. Borkun, who lives in Irpin, a suburb of Kyiv. “Despair arises, because there are many guys on the front line who need to have been replaced a long time ago, because they are very exhausted.”

But Andriy, an officer in the Territorial Defense Force, said corruption in recruitment centers was well known, and that rooting out some of those responsible was unlikely to have a big effect on mobilization. Andriy, who discussed political matters on the condition that his surname not be used, said, “Those who would like to avoid would do that anyway.”

Mr. Zelensky, playing to multiple audiences, needs to fend off such cynicism. To continue the war, he must assure Ukrainians that their sacrifices have been worthwhile and coax them to do more, while satisfying his Western backers that he does not tolerate corruption and that the fortune they have poured into propping up his military and government has not been wasted.

U.S. and European officials say there is no evidence that aid to Ukraine has been stolen or abused, but even the perception of fraud could threaten political support.

The scale of enlistment corruption and draft evasion are unclear, but this is not the first scandal to shake the administration of Mr. Zelensky, who took office in 2019 vowing to fight systemic corruption.

One scandal involved paying drastically inflated prices for food for the military, which led to the ouster of several top government officials. And the government acted on the recruitment scams, as it did on the food procurement scandal, only after they were reported on by Ukrainian news media.

An investigation by the news outlet Ukrainska Pravda in June revealed that a military enlistment officer from the southern Odesa region had bought real estate and cars worth millions of dollars in a coastal area of Spain. The officer, Yehor Smirnov, was dismissed and sent to the front lines, and the case prompted Mr. Zelensky to order an inspection of the entire system, conducted by several national security and law enforcement agencies.

Ukrainska Pravda reported on Thursday that Defense Minister Oleksii Reznikov could be replaced imminently.

Mr. Zelensky’s shake-up of recruitment operations represented the broadest change to Ukraine’s military structure since the invasion, a reflection of both the depth of the problem and the challenges facing Ukraine after 18 months of brutal fighting.

While Kyiv does not often reveal casualty figures, Western officials and analysts have estimated more than 150,000 Ukrainian troops have been killed or wounded, in addition to tens of thousands of civilian casualties. Estimates of Russia’s losses are higher, but with about 145 million people, it has more than three times the population to draw from.

Ukraine’s two-month-old counteroffensive to retake lost territory in the south has turned into a bloody slog, making painfully slow advances toward the occupied cities of Melitopol and Berdiansk, with more incremental gains reported on Friday. But at the same time, Russian forces are advancing on the city of Kupiansk in the northeast.

Many of those fighting for Ukraine are volunteers or professional soldiers who view the fight not as a choice but an obligation.

Still, as Ukraine has reached ever deeper into society to keep its ranks filled, the number of people trying to escape service has grown, Ukrainian officials have said.

The State Border Guard has said that an average of 20 men per day are arrested for trying to leave the country. Under the declaration of martial law that followed the invasion, males between the ages of 18 and 60 must remain in Ukraine, report to their local recruitment offices and undergo medical screening for possible service. There are a handful of exemptions, including being enrolled in a university, having a disability or having at least three children.

Many women also serve in the Ukrainian military, including in combat roles, but they are volunteers, not conscripts.

Some of the corrupt schemes described by prosecutors have involved giving “unfit” men permission to leave the country. Those implicated, in addition to enlistment officers, include medical personnel who review potential soldiers’ fitness for duty.

The problem for Ukraine’s government is far smaller than the exodus from Russia, estimated in the hundreds of thousands, which intensified after the Kremlin announced a mobilization of some 300,000 men last September.

But it is a problem for a war effort that needs resources and public confidence, amid a counteroffensive that has failed so far to achieve a major breakthrough. Unrelenting Russian bombardment compounds the sense of exhaustion felt by millions who would like nothing more than to be left in peace but see no other choice than to fight.

The decision to replace the heads of the recruitment offices was approved at a meeting of Ukraine’s National Security and Defense Council, and General Valeriy Zaluzhny, the chief of the Ukrainian armed forces, was put in charge of implementing the changes.

The exact number of people in Ukraine’s armed services is not publicly available, but Mr. Reznikov, the defense minister, has said that the nation’s goal was to have an army of a million people, a figure that would include national guard, police and border guard.

In the first months of the war, the government said only people with military experience or specifically needed skills were drafted. But even then, there were complaints that the conscription process was secretive and rife with corruption.

Last year, the Ukrainian government instituted a ban on recruitment officers issuing summonses at checkpoints, gas stations and other public places, in response to a petition signed by more than 25,000 people.

Reporting was contributed by Gaya Gupta in New York, Anna Lukinova and Natalia Yermak in Kyiv, and Cassandra Vinograd in Goult, France.