KYIV, Ukraine — Ukrainian forces defiantly pushed back against threats by Russia to annex territory it controls on Saturday, while Moscow replaced a top general in charge of logistics after a series of snafus that contributed to recent battlefield losses by Russian troops.

The fighting raged as Russian proxies in four Ukrainian provinces conducted the second day of voting in what Western officials have called “sham” referendums to become part of Russia. Some residents reported seeing soldiers in ski masks accompanying election workers and going house to house to coerce people to vote.

The referendums — which are expected to culminate in the annexation of an area larger than Portugal — have raised alarm in Western nations, because Russia, the nation with the world’s largest nuclear arsenal, has signaled that after annexation it would consider Ukrainian attacks in the territory violations of its sovereignty and defend it by any means necessary.

But Ukraine is set on trying to block the annexation. As voting in the referendums was underway, its military kept fighting for the area, saying on Saturday that over the last day it had destroyed eight tanks, 11 armored vehicles and six artillery systems. The Ukrainian army does not disclose its own losses, and its claims were impossible to independently verify.

The military also said it had shot down an Iranian-made armed drone known as a Mohajer-6 that is part of a fleet of Iranian drones Russia bought over the summer, according to Ukrainian and Western officials. After a flurry of such attacks by Iranian-made drones in recent days, Ukraine’s Foreign Ministry on Friday said it had expelled Iran’s ambassador.

Saturday’s fighting came one day after President Volodymyr Zelensky of Ukraine called on Ukrainians to resist the Russians from inside the occupied territories.

In his nightly address on Friday, Mr. Zelensky called on those living in provinces under partial Russian control — Luhansk, Donetsk, Zaporizka and Kherson — to avoid Russian mobilization efforts “by any means” and to try to flee to Ukrainian-held lands.

If they could not and were conscripted into the Russian military, Mr. Zelensky urged them to support Ukraine’s fight from the inside.

President Vladimir V. Putin of Russia has insisted his threat to defend claimed territory after annexation “is not a bluff.”

But that threat has rung hollow in Ukraine in part because the Ukrainian military has been striking targets inside Russia and on the Crimean Peninsula, which Moscow annexed in 2014 after a referendum that was also conducted under military occupation and widely condemned as rigged. These attacks have not prompted any specific Russian retaliation.

In the face of recent battlefield losses in eastern and southern Ukraine, Mr. Putin sought to reinvigorate his war effort this week by starting the referendums and announcing a military call-up that Russian officials said could add 300,000 soldiers to his ranks.

The conscription effort, too, has faced resistance, but this time from Russians themselves.

Some Russian men who had previously avoided military service or were indifferent to the invasion of Ukraine have scrambled to leave the country since Mr. Putin announced what he called a “partial mobilization” on Wednesday. Flights from Russian cities to countries that Russians can enter without visas have quickly sold out, while lines have grown at Russia’s land borders, some stretching many miles.

And as the first conscription notices arrived, villagers, activists and even some elected officials asked why the drive appeared to be targeting minority groups and isolated areas much more than cities.

Ukrainians living in lands occupied by the Russian military fear being conscripted. Ukraine’s military said in a statement on Saturday that draft notices had already been handed out in the Zaporizka and Kherson regions of southern Ukraine.

Olha, a Ukrainian who spoke on Thursday night to friends in Enerhodar, a Russian-controlled city in southeastern Ukraine near the Zaporizhzhia Nuclear Power Plant, said men between the ages of 18 and 35 were being prevented from leaving the city. She said she was nervous that annexation would force young men to join the Russian military and fight against fellow Ukrainians.

Moscow’s replacement of its deputy minister of defense, a general who had overseen battlefield logistics, suggested a new effort to improve its forces’ performance.

The change in leadership comes after the ouster of Russian forces from Ukraine’s northeastern Kharkiv region two weeks ago, a retreat that underscored the extent of their logistical failures, according to Western military experts.

But on the world stage, Russia diverted attention from those developments. In a speech at the United Nations General Assembly on Saturday, Russia’s foreign minister, Sergey V. Lavrov, lashed out at the United States and its Western allies and repeated what the Kremlin has said before: Russia was left with “no choice” but to start “a special military operation” to protect Russians in eastern Ukraine, because Ukraine had threatened the rights of ethnic Russians living there.

As the referendums in those regions and others proceeded, the Russian military took steps to ensure the results it wanted, while Ukrainians in those areas expressed a mix of anger, defiance and fear that their homeland was being usurped in what they called a sham vote.

“The so-called referendum is more like an opinion poll under the muzzle of machine guns,” Serhei Haidai, the Ukrainian governor of the eastern Luhansk region, wrote on Telegram on Saturday.

Residents have described an intimidating scene: soldiers with balaclavas covering their faces accompanying poll workers going house-to-house with ballots. The soldiers stand by as the ballots are filled in, leaving little doubt over which box they expect to be checked.

Other residents said they hid in their homes, terrified that voting against Russia’s annexation would lead to their being abducted, or worse.

Much of the population of occupied areas has fled. And mail-in and electronic voting is ostensibly taking place despite the lack of a postal service or even electricity in many towns.

Tina, 27, a freelance journalist who was visiting her fiancé’s parents in Beryslav, in Russian-occupied southern Ukraine, said that she drove through the streets on Friday morning and saw Russian officials standing in a neighbor’s yard, waiting for him to fill the ballot before passing it on to someone in a nearby vehicle.

“We are against these occupiers,” said Tina, who gave only her first name for fear of repercussions. “But we do not have a right to say no — we cannot refuse.”

In Russian-occupied Melitopol, in southeastern Ukraine, Natalia, 73, a pensioner, said the Russians had set up information booths about the referendum across the city and had hung banners with pro-Russian slogans. The city, she said, was covered with Russian flags, and patriotic Russian music played.

On Friday, she said, she looked out the window of her apartment and saw two pro-Russian referendum workers entering the building. She remained inside, far from the window, to avoid being seen. But she managed to spot two soldiers, each wearing a balaclava and clutching a gun, escorting three referendum workers. She said that a polling station had been set up in the gym of a school.

“I will not go to vote,” Natalia said. “Only if they point a gun at me, and even then I will vote for Ukraine.”

Andrew E. Kramer reported from Kyiv, Ukraine, Valerie Hopkins from Berlin and Ben Hubbard from Istanbul. Victoria Kim contributed reporting from Seoul, and Maria Varenikova from Kyiv, Ukraine.