President Volodymyr Zelensky said Thursday that Ukrainian forces were "holding our ground" in Avdiivka, after Moscow said it had improved its position in the frontline eastern town.
The Donbas town is symbolically and strategically important to Kyiv and near the Russian-controlled city of Donetsk, seized by separatist forces in 2014.
"Avdiivka. We are holding our ground," Zelensky said on social media, sharing pictures from the frontline town.
"It is Ukrainian courage and unity that will determine how this war will end," he said.
"Our defenders are courageously holding the defense: they have repelled more than 10 enemy attacks in the Avdiivka area," Andriy Kovalev, spokesman of the General Staff of the Armed Forces of Ukraine, said in televised comments.
Russia's Defense Ministry on Wednesday said its forces had improved their position close to Avdiivka, which had around 31,000 inhabitants before the war and is dominated by a huge coke plant.
About 1,600 civilians remain, according to local authorities.
Avdiivka's Mayor Vitaliy Barabash said on television: "We withstood everything, we held our positions, all the attacks were repulsed. In some places (we) even tried to counterattack."
The mayor said the situation there was "very tense," calling it the "largest offensive" on Avdiivka since last year's full-scale invasion.
"For the third day, the fighting around the town has not subsided, with shelling both on positions and on the town itself," the mayor said, adding that a missile attack hit the town overnight.
The coke plant, currently mothballed, is "constantly under fire from rockets and artillery," Barabash said.
Rybar, an influential pro-Russian Telegram channel that has good sources in the military, said Russian troops had captured an important slag heap north of the town.
Rybar also said that Russian forces had entered the village of Stepove northwest of Avdiivka and that there was fighting there, while Ukraine said it had repelled attacks east of the village.
Military analysts reported that Russia appeared to have suffered significant losses of equipment, based on images and videos of the area.
Avdiivka, an industrial hub, has been fought over since 2014, when it was briefly captured by Russian-backed separatists. It now has no intact buildings, mains water or electricity.