At least 200 Yazidis were freed on Sunday after being held captive by the Islamic State group for over six months in Iraq. Most of the prisoners were either children or elderly people who may have been slowing down the militants, a Kurdish military official said on Sunday, according to media reports.

“It probably became too expensive to feed them and care for them,” Shirko Fatih, a commander of the Kurdish peshmerga forces in the northern Iraqi city of Kirkuk, reportedly said, adding that almost all of the freed prisoners, who had been held by ISIS in the city of Tal Afar since June last year, showed signs of abuse and neglect.

An Iraqi government official said that the condition of those released was “very bad,” while many were under immense psychological distress. “Regarding other diseases we are providing first aid and the most important medical treatment,” the government official in the northern city of Erbil said, according to media reports.

Yazidis, who belong to an ancient religion that predates Islam and Christianity, have suffered intense persecution at the hands of ISIS, which has accused the former of being “devil worshippers.” Since August last year, it is believed that hundreds of Yazidis have been killed and tens of thousands have been displaced after being forced to flee their homes in the Sinjar mountains in Iraq’s north. Nearly 60,000 Yazidis have fled to the mountains outside Sinjar since the beginning of the ISIS onslaught, according to the United Nations.

In December last year, Amnesty International reported that thousands of women and girls, many of them as young as 12, belonging to the Yazidi community were raped, tortured and beaten by ISIS militants who sold them to sexual slavery.