Russian forces were closing in when Sgt. Ivan Zhytnik made a desperate call to his family from a bunker on the front line in eastern Ukraine.

Ukrainian defenses in the city of Avdiivka were crumbling and Zhytnik’s brigade had pulled out to avoid being overrun, leaving him and five other soldiers behind.

“Four of us are wounded—seriously wounded—we can’t walk. One can, but barely,” said 31-year-old Zhytnik in the video call on the morning of Feb. 15, adding the sixth man stayed to help them. “All the officers are gone—all of them. They left us at our positions.”

The plight of the men demonstrates the conundrum for Ukrainian leaders this year as they confront mounting Russian offensives with dwindling resources : when to cut their losses.

Ukrainian leaders say every inch of territory is worth fighting for, but their military is worn down after a failed counteroffensive last year and with a much-needed additional aid package stuck in Congress . Russia, with a larger army and a war economy clunking into gear, is pressing forward against its smaller neighbor.

That leaves Ukraine facing a year on the defensive, picking its battles in an effort to limit territorial losses while outlasting the Russian army. Kyiv needs to buy time to rebuild its own forces with the aim of retaking some of the roughly 20% of its territory occupied by Russia.

A woman walks past apartment blocks that were destroyed in a Russian missile strike, amid Russia’s attack on Ukraine, in Selydove near Avdiivka, Ukraine, February 19, 2024. REUTERS/Thomas Peter

It is a delicate calculus that requires weighing precious land against scarce resources , including lives—and morale.

At first Zhytnik hoped for rescue. Then he counted on mercy. In the last of several video calls recorded by his relatives, he turned to exchange words with someone off camera.

“Are they there?” asked his brother-in-law, Dmytro Shubin.

“Yes,” Zhytnik responded.

The Russians had arrived.

Zenit

As Ukraine’s counteroffensive stalled last fall, Russia seized the initiative and launched massed assaults on Avdiivka. The target, a small industrial city, revealed the shrunken reach of Russia’s invasion, which began in February 2022 with a failed attempt to seize Ukraine’s capital and overthrow its government.

Ukraine blunted Russia’s initial thrusts on Avdiivka, destroying dozens of armored vehicles and killing hundreds. But the relentlessness of Moscow’s assaults demonstrated a resolve to press on regardless in an effort to grind Ukraine into submission.

Zhytnik, a former taxi driver who had been drafted into the army just weeks after Russia invaded, had been deployed as part of the 110th Mechanized Brigade in a Soviet air force bunker complex called Zenit, a critical defensive position about one mile south of the city.

Like many soldiers, he used humor to cope with the grim realities of war. In a video posted on TikTok he pretended to be on the phone with his mother while standing in a crater large enough to fit a car in. “What shelling? Everything is fine,” he said. Other videos featured a pet capybara that Zhytnik fed carrots and made a bath for out of an empty ammunition box. In one clip, he joked that it might be a Russian spy.

Mykola Savosik, another soldier serving with Zhytnik, often received care packages from his cousin containing essentials and goodies such as nuts, candy and socks.

As winter set in, Moscow’s firepower advantage was growing as political deadlock in the U.S. held up key aid for Kyiv. Low on artillery rounds, Ukrainian forces in Avdiivka couldn’t prevent Russian infantry from creeping forward and engaging them at close range. President Volodymyr Zelensky visited in December, noting shortages, but signaled the intent to hold on.

Zenit was particularly vulnerable as Russian forces squeezed tighter. In January, Savosik told his cousin to stop sending care packages as it was almost impossible for supplies to reach them. When she asked how he was, he responded: “Alive.”

Pvt. Heorhiy Pavlov had always shielded his mother, Inna Pavlova, from the dangers he faced in Avdiivka, but the burly 29-year-old struggled to stay upbeat as the situation deteriorated. Ukraine’s shortage of artillery shells was so acute that Russian forces were operating out in the open without fear of being targeted, he complained. Many of Pavlov’s fellow soldiers had been in Avdiivka for nearly two years and were exhausted, he said. The need for fresh recruits was increasingly acute, but Kyiv stalled over a politically sensitive decision to expand the draft.

Railing against his commanders, Pavlov talked of earlier battles in which Ukrainian forces held out until it was too late to conduct an organized withdrawal . When Pavlova asked if they were encircled, he said everything was fine. But his outburst had unnerved her. And on Deep State—an app that maps front-line positions using open-source data—the red area denoting Russian advances appeared to be swallowing the city. “If I can see it on Deep State, how come your commanders can’t?” she recalled asking her son.

‘Pray for me’

By early February, the 100 soldiers remaining inside Zenit had almost no food left. Hunkered down under relentless shelling, many appealed to their commanders to withdraw. Russian troops were advancing on the flanks of Avdiivka, threatening to cut the position off. Still, Ukrainian commanders told them to hold on.

Several soldiers who stepped outside the bunker for fresh air were shot by Russian snipers or killed by mortar strikes guided by Russian drones, said Pvt. Viktor Biliak, who had been in Zenit since the start of Russia’s invasion. Only a handful of men from his company were still alive. Biliak said half the unit had been killed, elevating him, a junior serviceman, to company commander.

Viktor Biliak, a junior serviceman, become company commander after many in his unit were killed. PHOTO: SERHII KOROVAYNY FOR THE WALL STREET JOURNAL

On the night of Feb. 13, Sgt. Andriy Dubnytskiy, another soldier in Zenit, called his wife, Lyudmyla Dubnytska, to say he was preparing to leave Avdiivka. The couple’s first child was born several months into the war, but 25-year-old Dubnytskiy had hardly seen his daughter because he had been on the front line in Avdiivka almost nonstop since the start of the war.

“I’ll be in touch whenever I get the chance,” he wrote to Dubnytska on Facebook messenger.

“Promise me everything will be fine,” she said.

“Pray for me,” he replied.

Hours later, Dubnytskiy set out in a group of seven soldiers including Zhytnik and Pavlov, attempting to reach Ukrainian lines in Avdiivka. They had given up waiting for orders to retreat. “Our commanders…wanted us to dig in and keep defending,” Biliak said. “Holding on to a set of ruins without ammunition or food was suicidal.”

The group didn’t get far. Russian reconnaissance drones had been flying over Zenit for days, waiting for the Ukrainians to break cover. A Russian mortar strike immediately killed half the group, Biliak said. He wasn’t in the group but helped bring the wounded back to the bunker, carrying Zhytnik himself. Dubnytskiy and Pavlov were also wounded.

Those who could still walk, including Biliak, set out on foot later the evening of Feb. 14 with Ukrainian drones guiding them to a rendezvous point where an armored vehicle was waiting.

The route to Avdiivka was strewn with the corpses of Ukrainian soldiers, Biliak said. As they reached the evacuation point, he heard a radio exchange that shocked him. A Ukrainian officer from the 110th Brigade asked his commander about evacuating the wounded men who remained in Zenit.

“Leave the wounded,” Biliak heard the commander reply. “And burn everything left behind.”

Distress calls

Around 8 a.m. the following morning, Savosik called his cousin Kateryna to say goodbye. Clutching a grenade, Savosik told her that they were unlikely to see each other again. “He had a wild look on his face,” Kateryna recalled.

The rest of the brigade had withdrawn from Zenit, leaving five wounded men, he told her. Savosik wasn’t injured himself, but had chosen to stay with them. “On a human level I couldn’t leave those boys,” she recalled him saying.

Mykola Savosik’s cousin Kateryna, shown at a fallen heroes memorial in Lviv, Ukraine, spoke to Savosik in Zenit as the Russians closed in. PHOTO: SVET JACQUELINE FOR THE WALL STREET JOURNAL

The commanders had promised to send a vehicle to evacuate them, but there was no sign of it—and Russian forces were almost upon them.

Around the same time, Pavlov called his mother in distress. One of his legs was broken. His back and neck were riddled with shrapnel. Pavlova begged him to surrender for the sake of his 5-year-old son. He still hoped to be rescued by the powerful 3rd Assault Brigade, which had been sent in to shore up Ukrainian positions and beat the Russians back, according to a deputy commander. Large parts of the city had already fallen under Russian control, however, and the brigade ended up covering Ukraine’s retreat.

Dubnytskiy also rang his wife to say he hadn’t made it out of Avdiivka. He was wounded in the groin but tried to make light of it. They would still have a son with his remaining testicle, he joked. There wasn’t much food or water, he said, but a soldier who hadn’t been wounded had stayed behind to care for them.

“Looks like we’ll be taken captive,” he messaged her at noon.

Beside him, Zhytnik was speaking to his own relatives in Zaporizhzhia. “My legs are done for,” he said in a recorded video call.

Dubnytskiy reasoned the vehicle that commanders had promised to send for them might still come, seeking to reassure Zhytnik—and himself.

“The car can’t reach here,” Zhytnik said. “That’s it.”

Savosik’s cousin showed her text messages with him near the end of the Avdiivka siege. PHOTO: SVET JACQUELINE FOR THE WALL STREET JOURNAL

Not long after midday, Zhytnik’s brother-in-law, Shubin, called with good news. The Ukrainians had contacted the Russians and struck a deal: The wounded men would surrender to Russian forces and be freed in a prisoner exchange.

The 110th Brigade later said it hadn’t been possible to go back for the men after the withdrawal from Zenit, but that it asked the authorities responsible for negotiating prisoner swaps with the Russians to seek assurances they would be treated “in accordance with the international customs of war and the laws protecting prisoners of war.” The Russians agreed, the brigade said in a statement.

Zhytnik hung up when the Russians arrived, but Shubin called him back. There was another person in the room now. The Russian soldier looked about 50 and had a short beard, Shubin said.

Zhytnik urged the Russian soldier to speak with his brother-in-law over the phone so they could reach an understanding. “No. Turn off your phone. I’m not talking to anyone,” Shubin heard the Russian soldier say before the call cut off.

Tattoos

The day after Russian troops reached Zenit, a 40-second video appeared on one of Moscow’s propaganda channels. It showed several dead soldiers lying in the mud alongside a Ukrainian flag. Dubnytska immediately recognized a tattoo on one of the men’s hands: It looked identical to the one her husband and two other soldiers had got, symbolizing their faith and brotherhood.

She had reported Dubnytskiy missing earlier that day, taking their nearly 2-year-old daughter to the police station to provide a DNA sample. Returning home, she was scrolling through Russian Telegram channels in search of evidence he had been captured when she saw the clip.

“Everything inside me died,” she said. After contacting another of the soldiers with the tattoo, there was no room for doubt. “It was him.”

The following day, Ukraine announced it had withdrawn from Avdiivka to preserve lives. The Biden administration said the fall of the city was the price of Congress’s failure to send more aid to Ukraine. It was the biggest victory for Moscow in months.

Ukraine’s leadership said the fight had been worth it to grind down Russian forces, although commander-in-chief Col. Gen. Oleksandr Syrskiy acknowledged “certain miscalculations” by commanders.

“If we had retreated in an organized way we could have burned the position without our people there,” said Biliak days after the city fell. He was in a hospital receiving treatment for injuries sustained during the withdrawal, including a cheek half torn open by a piece of shrapnel.

The men’s relatives believe they were killed by Russian forces shortly after being captured after midday on Feb. 15. But they also blame the Ukrainian commanders who left them behind for their deaths, calling it an unnecessary sacrifice. Their priority now is to recover their loved ones’ remains.

In a video released by Russian state-controlled channel RT days after Avdiivka’s capture, a reporter walks through the bunkers of Zenit, rifling through what Ukrainian forces left behind, including several boxes of ammunition and laundry on a line.

Outside, the men’s bodies lay in a heap dusted with snow.

A woman stands in front of the house of a relative that was destroyed in a Russian missile strike, amid Russia’s attack on Ukraine, in Selydove near Avdiivka, Ukraine, February 19, 2024. REUTERS/Thomas Peter

Write to Isabel Coles at isabel.coles@wsj.com and Matthew Luxmoore at matthew.luxmoore@wsj.com