Russia's Defence Ministry on Saturday said it had pulled Russian troops out of the key town of Lyman in eastern Ukraine citing the "threat of encirclement" by Ukrainian forces.
Russian state news agencies said the troops had been withdrawn "to better positions".
The capture of Lyman is a major setback for Moscow after President Vladimir Putin proclaimed the annexation of the Donetsk region, along with three other regions, at a ceremony on Friday.
Two grinning Ukrainian soldiers taped the yellow-and-blue national flag on to the "Lyman" welcome sign at the town's entrance in Donetsk region's north, a video posted by the president's chief of staff showed.
"October 1. We're unfurling our state flag and establishing it on our land. Lyman will be Ukraine," one of the soldiers said, standing on the bonnet of a military vehicle.
Russia had an estimated 5,000 to 5,500 troops at Lyman, which it used as a logistics and transport hub for its operations in the north of the Donetsk region.
Its fall marks Ukraine's biggest battlefield gain since a lightning counteroffensive in the northeastern Kharkiv region last month.
The Ukrainian military spokesperson said the capture of Lyman would allow Kyiv to advance into the Luhansk region, whose full capture Moscow announced at the beginning of July after weeks of slow, grinding advances.
- 'We became more Russian than we were,' says Moscow-born artist in Paris
- Putin signs document incorporating occupied areas of Ukraine into Russia
"Lyman is important because it is the next step towards the liberation of the Ukrainian Donbas. It is an opportunity to go further to Kreminna and Sievierodonetsk, and it is psychologically very important," he said.
Donetsk and Luhansk regions together make up the wider Donbas region that has been a major focus for Russia since soon after the start of Moscow's invasion on 24 February in what it called a "special military operation" to demilitarise its neighbour.
Putin proclaimed the Donbas regions of Donetsk and Luhansk and the southern regions of Kherson and Zaporizhzhia to be Russian land in Friday's ceremony, a swathe of territory equal to about 18 percent of Ukraine's total surface land area.
Ukraine and its Western allies branded Russia's move as illegal. Kyiv vowed to continue liberating its land of Russian forces and said it would not hold peace talks with Moscow while Putin remained as president.