Six Ukrainian servicemen were killed during the withdrawal from the fiercely contested town of Debaltseve, the country's president has said.

The Interfax news agency also cited Petro Poroshenko as telling a meeting of the national security council late tonight that more than 100 were injured in the pullout.

Earlier, Mr Poroshenko had announced the withdrawal from the town where Ukrainian forces had been under intense siege from Russia-backed separatist rebels.

He told the security council that, in total, nearly 2,500 servicemen had left.

The Russia-backed separatists reported taking hundreds of soldiers captive as they continued their onslaught on the strategic railroad junction.

Associated Press reporters saw dozens of Ukrainian troops retreating from Debaltseve with their weapons. Some were driving to the nearby town of Artemivsk in trucks while several others were on foot. One soldier spoke of heavy government losses, while another said they had not been able to get food for days because of the rebel shelling.

"We're very happy to be here," said one soldier. "We were praying all the time and already said goodbye to our lives a hundred times."

Mr Poroshenko said: "Debaltseve was under our control, it was never encircled. Our troops and formations have left in an organised and planned manner."

He spoke at a Kiev airport as he travelled to eastern Ukraine to "shake the hands" of the soldiers who were pulled out of Debaltseve.

Rebel spokesman Eduard Basurin said hundreds of Ukrainian soldiers had surrendered in Debaltseve. Russian state-owned television showed images of Ukrainian troops being escorted along a village road by the rebels.

Kiev admitted that some soldiers had been taken prisoner in Debaltseve, but gave no details on how many were seized.

Russian President Vladimir Putin, on a visit to Budapest, had called on Kiev to admit defeat in the contested town, saying "the only choice" of the Ukrainian troops was to "leave behind weaponry, lay down arms and surrender".

Fighting around Debaltseve, which links the two major separatist cities of Donetsk and Luhansk, had raged on despite a ceasefire deal brokered by European leaders which went into effect on Sunday.

Some retreating troops said they had not received any reinforcements from the government in Debaltseve and had been walking and retreating for a whole day.

"Russia and the separatists have to immediately and fully implement the commitments agreed to in Minsk, in line with yesterday's UN Security Council resolution, starting with the respect of the ceasefire and the withdrawal of all heavy weapons," he said.

The separatists have raised a flag in triumph over the embattled town.

Nato secretary-general Jens Stoltenberg accused the separatists of refusing to respect a ceasefire agreement and urged Russia "to end support for separatists and to withdraw forces and military equipment from eastern Ukraine".

Russia has denied supplying the separatists with troops and weapons, a claim dismissed by Western nations and Ukraine, who point to Nato satellite pictures of Russian weapons in eastern Ukraine.

The German government condemned the rebels' advance on Debaltseve. Chancellor Angela Merkel's spokesman Steffen Seibert described the onslaught as "a serious strain on the (Minsk ceasefire) agreement as well as hopes for peace in eastern Ukraine".

Semyon Semenchenko, a volunteer battalion commander and a member of the Ukrainian parliament who was critical of the government's decision to retreat, said in a statement that 167 injured soldiers have been evacuated from Debaltseve. He mentioned a high death toll and said some bodies had been left behind but did not give specific numbers.