The capture of Andriivka was announced by Ukraine's general staff, a day after claims it had been retaken were deemed premature.
The military said it "liberated Andriivka in the Donetsk region, inflicted significant losses on the enemy in terms of manpower and equipment, and entrenched at the occupied frontiers".
Andriivka is about 15km south of Bakhmut, the frontline town that was occupied in May after a months-long siege by Russian troops and mercenaries.
Kyiv's forces have pushed back around the flanks of the city as part of the Ukrainian counter-offensive that began in June.
Generals have reported modest gains after Ukraine went on the attack with the help of tanks and weapons suppled by western allies.
There was confusion about Andriivka's fate on Thursday after Ukraine's Deputy Defence Minister Hanna Malyar said the village was "ours" before the claim was rejected by soldiers.
An assault brigade fighting in the eastern Donetsk region said the statement was premature and that "important battles" continued in Andriivka. Ms Malyar backtracked, blaming a communications failure.
She said on Friday that the general staff had now "officially confirmed that our troops captured Andriivka yesterday as a result of fighting".
"It was difficult and the situation changed very dynamically several times yesterday," she added.
Ms Malyar said Ukraine had regained 50 square kilometres of land around Bakhmut during the counter-offensive. The general staff said troops had inflicted substantial losses on Russia in the Zaporizhzhia region farther south.