The remains of hundreds of mainly Shiite inmates killed by Islamic State militants when they overran a prison in northern Iraq more than two years ago have been unearthed by forces retaking the area from the group, a spokesman said.

An Iraqi Shiite paramilitary group made the discovery after driving the militants from the Badush area where the prison is located, as part of a wider U.S.-backed campaign to dislodge Islamic State from the city of Mosul.

As an array of forces dismantle Islamic State’s self-proclaimed caliphate across Iraq and Syria, more evidence is emerging of the war crimes committed by the Sunni Islamist militants, who targeted Shiite Muslims and religious minorities as well as opponents from their own sect.

“Initial checks of part of the mass grave revealed remains with prison uniforms and lined up in a way that indicates they were shot dead in groups,” said Karim Nouri, spokesman for the Hashid Shaabi, a state-run umbrella for Shiite paramilitary groups.

One of those groups — the Abbas Division — is fighting alongside the regular Iraqi army, which in recent days jointly completed the encirclement of Mosul, about 10 km (6 miles) southeast of Badush.

The militants used the prison to hold their own captives including thousands of members of the Yazidi religious minority, but blew it up some time before Iraqi forces drew near.

Human Rights Watch said in a report that as many as 600 people were killed in the Badush prison massacre, which took place on the same day that Islamic State militants captured Mosul in June 2014.

The militants corralled the inmates, who had been serving sentences for a range of crimes — from murder and assaults to nonviolent offenses — onto trucks and drove them to an isolated stretch of desert about 2 km (1 miles) from the prison, HRW said.

There, they separated a few Sunni and Christian inmates from the rest, who were overwhelmingly Shite, before forcing them to form one long line along the edge of a ravine and machine-gunning them down.

The report was based on the testimony of more than a dozen men who survived by playing dead or because they were shielded by the bodies of other prisoners who fell on top of them.

“We are waiting for forensic teams and human rights officials to begin unearthing the grave to uncover the whole story of how the ruthless criminal Daesh (Islamic State) killed them in cold blood only because they were from a certain sect,” Nouri said.