BEIRUT, Lebanon — As pro-government troops drove Islamic State fighters from a central Syrian town over the weekend, the retreating militants killed scores of civilians, dumping some bodies into wells and leaving others in the street, local residents and the Syrian state-run news media said on Monday.
The apparent mass killing is the latest example of the brutal reprisals that have taken place when territory changes hands in Syria’s multisided war, with civilians often bearing the brunt of the pain.
The carnage showed how the Islamic State can still spread havoc even as it loses major parts of its territory that once included large areas of Syria and Iraq.
At least 67 bodies had been identified in the town, Qaryatayn, northeast of Damascus, the capital, by Monday afternoon, according to local activists who posted an online list of the victims’ names.
The Syrian Observatory for Human Rights, which monitors the conflict, said that as many as 128 civilians had been killed in Qaryatayn in the past several weeks before the Islamic State fighters retreated.
“I knew most of these people — farmers and electricians and teachers,” said Abdullah Abdulkarim, a resident and citizen journalist who fled to the northern province of Aleppo a few years ago but keeps in close touch with contacts in Qaryatayn.
“I know for a fact that most of the victims were not involved in anything against ISIS,” he said, using an acronym for the Islamic State. “Just 10 of them were collaborators with the regime, but this doesn’t justify executing them.”
Mr. Abdulkarim said that the youngest victim was in his teens and the oldest was 57, adding, “Some of the bodies were dumped in wells, which makes it harder to find them.”
Several were members of his extended family, he said, including five of his father’s cousins, one of whom was a local mukhtar, or leader. “They were all shot and left on the streets for others to take as an example,” he said. “They all were accused of collaborating with the regime.”
Qaryatayn, like many places in Syria, has been through many phases of war. Local youths formed makeshift rebel groups early in the uprising, which began in 2011 after the government cracked down violently on largely peaceful political protests.
The groups withdrew in late 2013 to spare the town from the government shelling that had befallen many rebel-held areas; Mr. Abdelkarim, an online advocate for the rebels, fled with them to rebel-held areas farther north.
The government held the town until 2015, when the Islamic State seized it, destroying a 15th-century monastery and prompting thousands of Christians to flee. The town changed hands several more times, with Islamic State fighters seizing it again in late September and the government retaking it last weekend.