In yet another defeat by the Ukrainian army, Russia has given up the strategically important city of Lyman in the Donetsk region.

The armed forces had been withdrawn because of the risk of encirclement, the spokesman for the Russian Defense Ministry said in Moscow on Saturday.

Ukrainian authorities had previously spoken of around 5,000 encircled Russian soldiers.

According to Ukrainian sources, it initially looked as if the Russian troops were stuck.

"The occupiers asked their leadership to come out if possible, after which they were rebuffed," said the head of the Luhansk administration, Serhiy Hajday, on Saturday morning.

"They now have three courses of action: either they can try to break out or they surrender.

Or they all die together.” Hajdaj said there had never been such a number of encircled Russians in the war.

For Moscow, the withdrawal from Lyman is yet another major setback in the invasion that has been going on for more than seven months.

Russian troops took Lyman, where 20,000 people lived before the outbreak of war, in May.

Since then, Russia has developed the city into a military logistics and transport center.

Now that the city is back in Kiev's hands, the way is open for Ukrainian troops deep into the rest of Donetsk, which together with Luhansk forms the Donbass.

Parts of the areas have been controlled by pro-Russian separatists since 2014.

On Friday, Russian President Vladimir Putin annexed the occupied parts of the Donetsk, Luhansk, Zaporizhia and Cherson regions in the face of international protests.

No state recognizes this breach of international law.

Ukrainian President Volodymyr Zelenskyy had announced that all occupied territories would be liberated.

To do this, he relies on heavy weapons from the West and on military advisors from the NATO countries.