The Ukrainian military says it has advanced despite fierce resistance from Russian troops north and south of Bakhmut, putting greater pressure on Moscow’s forces to devote resources to the battle as they prepare for a wider Ukrainian counter-offensive.

Bakhmut, once a city of 80,000 known for its sparkling wine and salt mines, has been the site of some of the deadliest urban battles in a generation. After nearly a year of fighting, Russian forces have taken control of about 90 percent of the destroyed city. But after months on the defensive, Ukraine last week launched a series of coordinated counterattacks and in days retook ground around the city that it took Russian forces months to take.

Hanna Maliar, a Ukrainian deputy defense minister, said on Tuesday that Kiev forces had recaptured 20 square kilometers, or 7.7 square kilometers, north and south of Bakhmut “within days.”

“At the same time, the enemy advances somewhat in Bakhmut itself,” she wrote on messaging app Telegram about the fierce battles within the city limits.

Just a day earlier, Colonel Serhiy Cherevaty, a spokesman for the Ukrainian forces fighting in the east, said on national television that over the past 48 hours, Ukraine had been able to build on last week’s successes, advancing about two kilometers in some directions.

Without elaborating, he said that on some fronts the advance had been slower, with battles over areas roughly the size of three football fields. Colonel Cherevaty also said that Russian forces counterattacked in some areas. While his claims could not be independently verified, Russian military bloggers have also noted Ukrainian gains around Bakhmut over the past week.

The gains are still small geographically — a few dozen square kilometers at most — but they represent a shift in momentum that Ukrainian commanders say they hope to build on as they launch their long-awaited counteroffensive elsewhere along the 600-mile front.

They also present Russia with a difficult decision about the cost it is willing to pay to continue fighting for the devastated city, potentially drawing resources from other areas that may soon come under attack.

The looming Ukrainian counteroffensive is not an isolated incident, according to Ukrainian commanders and military analysts. President Volodymyr Zelensky warned last week that it may be delayed without more allied weapons, but it was not clear whether it was misdirection, and Ukraine has in recent weeks stepped up its attacks on Russian positions deeper behind enemy lines.

Despite an influx of Western weapons to aid in the counteroffensive, Ukrainian commanders do not expect the fight ahead to be easy. Andriy Biletsky, the commander of Ukraine’s third assault brigade, which made the first breakthrough to the Russian lines around Bakhmut last week, said in an interview over the weekend that Russian “tank units are being pulled up, new units are being pulled up.” As he spoke, the sound of nearby fights echoed in the distance.

The battles for Bakhmut are fluid, but the Ukrainian military and Russian military blogs provide a picture of where the most fierce battles are taking place.

To the south, Ukrainian soldiers and commanders have reported an advance through a pocket of forests south of the village of Ivanivske as they move in the direction of Klishchiivka, a small village that Wagner is forcing alleged to have captured at the end of January. The village is seen as strategically important because it is located on high ground directly east of roads into Bakhmut that could serve as supply routes.

In the north, both sides reported fighting around the highlands surrounding the Berkhovskoye Reservoir. The Russian Defense Ministry said over the weekend that its forces were regrouping around the reservoir to “increase the strength of the defense line.”

The Russian military blogger Gray Zone, which is linked to Wagner, reported on Friday that newly gained Ukrainian positions give them “an advantageous tactical position, which allows them to conduct reconnaissance and effectively use all types of weapons” on Russian troops in the valley below and into the city itself.

But as Russian forces have lost ground around the city, Ukrainian officials say the attack on Ukrainian soldiers inside the city has only intensified.

“The enemy is primarily trying to capture the city itself and is making desperate efforts for this,” said Colonel Cherevaty.

Natalia Novosolova and Anastasia Kuznetsova contributed research.