DEBALTSEVE, Ukraine — For the rebel fighters who seized control of this strategic town, Thursday was a day of jubilation and bragging of victory. The retreating Ukrainian soldiers were grim, stunned and relieved to have escaped with their lives as the scope of their losses became clearer: at least 13 dead and hundreds missing, captured or wounded.

Rebel fighters roamed the debris-littered streets of Debaltseve, laughing, hugging and posing for photos a day after the fall of the furiously contested railway hub. Associated Press journalists found its neighborhoods destroyed and all under the control of the rebels.

On the road out of town, dozens of Ukrainian military vehicles, many riddled with bullet holes and with their windshields smashed, were heading to the government-held city of Artemivsk.

The soldiers inside described weeks of harrowing rebel shelling, followed by a hasty retreat.

“We left under heavy fire, driving on back roads,” said a soldier who gave only his first name, Andrei. “As we were leaving, we were attacked by artillery and grenade launchers. We came under repeated attack by tanks and assault groups.”

As rebels waved separatist flags, Nikolai Kozitsyn, a Russian Cossack leader and prominent warlord in the rebel-controlled east, drove around in a Humvee-like vehicle captured from Ukrainian troops.

All around lay the wrecked remains of Ukrainian armored vehicles. Rebel fighters, many of them Cossacks, searched through the bunkers and tents of an abandoned military encampment, looking to salvage equipment and clothing left behind.

Two rebel fighters inspected an abandoned tank, declaring it a “gift” from the Ukrainian army. They then grabbed a bloodied blue-and-yellow Ukrainian flag and ground it into the frozen earth with their boots.

But in a reminder of the dangers, one vehicle carrying Cossacks hit a land mine, killing one rebel fighter and wounding another.

Cossacks, who spearheaded imperial Russia’s expansion and helped guard its far-flung outposts, trace their historic roots to both Ukraine and southern Russia. They faced persecution under Bolshevik rule but resurfaced after the 1991 Soviet collapse and are now recognized in Russia as an ethnic group who consider themselves descendants of the czarist-era horsemen.

By Thursday, 90 percent of government forces had been withdrawn, a military spokesman said, though he gave no precise figure. Late Wednesday, President Petro Poroshenko said 2,475 soldiers were safely pulled out.

The official toll stood at 13 soldiers killed, 157 wounded, more than 90 captured and at least 82 missing.