Soon enough, many of them were objecting to anybody who would listen there on the highway that they had never fought for pro-Russian separatists, and in fact had no idea how they ended up in a prisoner exchange in eastern Ukraine.

“I am a civilian and I was included just to fill out the numbers,” Nikita Podikov, 17, said in an interview. Ukrainian soldiers arrested him in a town near the front lines two weeks ago as they pulled back during a retreat, he said.

Mr. Podikov said the authorities accused him of belonging to a gang of pro-Russian assassins working behind enemy lines, but never gave any proof. “I never fought, I never killed anybody,” he said.

“They arrested me, beat me for two days and then kept me for trading,” he said. On Sunday, he wound up in a prisoner swap of 27 men and one woman, only seven of whom were rebel fighters.

In interviews at their point of release and in a dormitory where former detainees are housed in Donetsk, a dozen men freed in exchanges over the weekend by the Ukrainian Army gave similar accounts.