ARTEMIVSK, Ukraine — Government soldiers pulled out of a ferociously contested railway hub in eastern Ukraine Wednesday, ending a siege so intense the retreating troops said they couldn't get water or food amid relentless shelling by Russian-backed separatists. At least six soldiers were killed in the withdrawal and more than 100 wounded.

President Petro Poroshenko sought to portray the fall of Debaltseve in a positive light, saying the pullback was carried out "in a planned and organized manner," despite assertions by exhausted and dirt-caked soldiers, some of whom made their way out on foot, that their forces suffered heavy losses.

No matter the circumstances, the retreat appeared to be an acceptance by the Ukrainian leader of a humiliating defeat in exchange for a chance at pushing a shaky truce agreement forward and securing the pullback of heavy weapons.

The loss of Debaltseve was a serious setback for the army. The town is a strategic railroad junction that lies on the most direct route between the separatist east's two major cities, Donetsk and Luhansk. By taking control of it, rebels gain significant transportation connections to boost their regions' capacity to function as a unified entity.

Its strategic importance kept the battle raging even after a cease-fire between Ukrainian forces and the Russia-backed rebels went into effect Sunday and appeared to be mostly holding elsewhere after fighting that has killed more than 5,600 people since April.

Relinquishing the town could remove the major impediment to a lasting cease-fire and begin the next step that was agreed to in a peace deal last week — the pullback of heavy weapons by both sides to create a buffer zone at least 50 kilometers (30 miles) wide.

But the images of traumatized soldiers and their stories of deprivation will be another wound to a national psyche already bruised by Russia's annexation of the Crimean peninsula last March and the vicious fighting in the east, where Ukrainian forces suffered heavy losses at the hands of rebels they and the West claim got a huge boost from Russian equipment and troops.

Semyon Semenchenko, a battalion commander and a member of parliament, accused the military command of betraying the country's interests in Debaltseve.

"We had enough forces and means," he said in a Facebook post. "The problem is the command and coordination. They are as bad as can be."

Semenchenko's words cut especially hard because he became well-known during another major rebel rout of Ukrainian forces in the battle for Ilovaysk last summer. Semenchenko, who was wounded in the fighting, was critical of the government for allegedly abandoning volunteer troops there.

A top separatist official, Denis Pushilin, meanwhile, contended that the government pullback Wednesday wasn't a retreat at all, but that rebels had overpowered most of the soldiers, killing them or forcing them to surrender.

Poroshenko told a late night meeting of his national security council that six soldiers were killed during the withdrawal and more than 100 were injured, the Interfax news agency said.

He called on the body to consider asking for a U.N. peacekeeping mission, a move he previously opposed, apparently fearing they would include troops from Russia or its client states. The new proposal suggests a mission be made up of security forces from European Union countries. Russia, as a permanent member of the U.N. Security Council, has the power to veto any peacekeeping mission.

Associated Press journalists were blocked from access to Debaltseve making it impossible to independently assess circumstances there. Russian television ran footage of rebels raising the flag of Novorossiya, as they call their nominal republic, over a building in the town, and images of several dozen captured Ukrainian troops being escorted along a village road by the rebels.

In the nearby town of Artemivsk, several dozen weary Ukrainian soldiers arrived on Wednesday morning.

One soldier spoke of heavy government losses, while another said they had not been able to get food or water because of the intense rebel shelling. A third spoke of hunkering down in bunkers for hours, unable to even go to the toilet because of the shelling. They smoked cigarettes in the frigid winter air and gratefully accepted plastic cups of tea.

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

Some retreating troops said they never received any reinforcements in Debaltseve and had been walking for a whole day. One Ukrainian soldier who introduced himself only as Nikolai said he was not even sure if his unit was retreating or being rotated elsewhere.

Earlier, Poroshenko portrayed the troop pullout as taking place "in a planned and organized manner" and characterized their stand in Debaltseve as a success by default because "we managed to show to the whole world the true face of the bandit-separatists backed by Russia."

Separatist officials have insisted the cease-fire agreed to last week by Poroshenko and the leaders of Russia, France and Germany did not apply to Debaltseve.

"Debaltseve was under our control, it was never encircled," Poroshenko asserted. "Our troops and formations have left in an organized and planned manner.

"The Ukrainian troops... gave a blow in the teeth to those who were trying to encircle them," Poroshenko said at a Kiev airport before flying to eastern Ukraine to "shake the hands" of the soldiers leaving Debaltseve.

Whether that contention will be widely accepted is uncertain.

"Many will be disappointed, especially in the camp of the patriots," said Kiev-based political analyst Vadim Karasyov. But he said he did not view Poroshenko as being in political danger, because polls show support for him is fairly strong. "The political position of Poroshenko, I don't think this affects it fundamentally," he said.

Poroshenko faces knotty challenges if the peace process laid down in the Minsk agreement is to go forward. The agreement obliges Ukraine to pass laws granting a yet-undefined degree of autonomy to the separatist regions, including the highly emotional issue of status for the Russian language.

The deal foresees Ukraine regaining control of its border with Russia in the separatist region only by the end of the year. Many fear that delay and the expanded powers for the region will allow Russia leverage to keep Ukraine destablized, thereby reducing any likelihood it could seek membership in NATO.

NATO Secretary General Jens Stoltenberg accused the separatists of refusing to respect a cease-fire 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 scoffed at by Western nations and Ukraine, who point to NATO satellite pictures of Russian weapons in eastern Ukraine.

At a barricade outside the town of Vuhlehirsk, in rebel-held territory, reporters were barred from the road into Debaltseve by a group of fighters. Some of the men identified themselves as coming from Russia's Far East and bore the typical Asiatic features of native people there.

Viktor Ponosov, a rebel commander at the checkpoint, said Ukrainian forces appeared to have run out of ammunition and food.

"We have heard that they are calling their relatives and friends from within the encirclement and saying to them: 'Please help us, because they are killing us and destroying us,'" Ponosov said.

____

Heintz reported from Kiev. Associated Press reporters Peter Leonard in Vuhlehirsk, Ukraine; Nataliya Vasilyeva in Moscow, Yuras Karmanau in Minsk, Belarus; Sylvie Corbet in Paris, Geir Moulson in Berlin and John-Thor Dahlburg in Brussels contributed to this report.