KYIV, Ukraine — Ukraine’s military said on Saturday that it had beaten back multiple attacks in fighting around the partly encircled city of Bakhmut, which has come down to a yard-by-yard battle for the roads that are the vital lifelines of supply for the city’s defenders.

Ukrainian soldiers inside the city are now encircled on three sides by a combined force of the Russian Army and the Wagner private military company, which includes fighters recruited from prisons.

On Friday, the company’s owner, Yevgeny V. Prigozhin, taunted President Volodymyr Zelensky of Ukraine in a video, saying that only one road remained open to the west of Bakhmut, a city in the Donbas region of eastern Ukraine. Ukrainian commanders have offered a different assessment, saying that a counterattack this past week had pushed Russian forces away from a second artery into the city, easing resupply for troops inside.

In either case, the seven-month battle for Bakhmut — Russia’s longest-running sustained assault in the war — is now being decided by such seesaw fighting around the rural roads, which cut through rolling, grassy hills and small villages to the west of the city.

Much is at stake. Although military analysts say it is unlikely that Russia could steamroll deeper into Ukrainian territory if it captured Bakhmut, the city’s fall would hand President Vladimir V. Putin of Russia a symbolic prize as the first major city overrun by his forces since July.

In waves of assaults by Wagner’s forces through the fall and winter, and with relentless artillery, Russia inched toward the city from the south and the north. By late this past week, Russian troops were within about 700 yards of one of the access roads and could open fire with heavy machine guns at passing vehicles, a Ukrainian commander said in a television interview on Friday.

The Ukrainian military said in its morning battlefield assessment on Saturday that Russia had continued its efforts to encircle the city over the past 24 hours. “The defenders rebuffed multiple assaults,” Ukraine’s military said of its forces, providing few details other than to list yet another Russian assault on a village straddling the road Ukraine that asserted it had recently safeguarded.

Britain’s military intelligence agency said Saturday that two key bridges had been blown up. One led from Bakhmut to the village of Khromove, along a key supply route to the west; the other was a pontoon crossing over the small Bakhmutka River within the city.

In the British assessment, only one road — which is now of unclear utility because of the destroyed bridge — was described as remaining open for the Ukrainian military. “The Ukrainian defense of the Donbas town of Bakhmut is under increasingly severe pressure, with intense fighting taking place in and around the city,” the agency said.

The Ukrainian military, if it retreats, would likely do so stealthily, trying to fall back with minimal casualties, military analysts have said. It may pull back to the city’s western neighborhoods, using the Bakhmutka River as a defensive line inside the city.

In a worst case, the thousands of Ukrainian troops fighting in Bakhmut could become surrounded, starved of ammunition, and be killed or pushed to surrender.

But on Saturday, Ukraine’s military continued to express resolve. It said that Gen. Viktor Khorenko, the head of Ukraine’s special operations forces, had visited Bakhmut, just a day after the commander of the ground forces went to the city. Ukrainian commanders say they want to hold on and degrade Russian forces as long as they can.

General Khorenko had “worked out a number of urgent issues regarding the provision and organization of the work” of units, the command said in a statement.

Russia’s defense minister, Sergei K. Shoigu, paid his own visit to troops elsewhere in the Donbas region, Russia’s Defense Ministry said on Saturday. He inspected a frontline command post in the southern part of Donetsk and was updated on “the current situation and troops’ action,” according to the ministry, which released a video showing him awarding medals and touring through the rubble.

Cassandra Vinograd contributed reporting.