BAGHDAD — Thousands of people suspected of having ties to the Islamic State group are facing widespread rights violations in Iraqi custody, Human Rights watch said Tuesday.

The New York-based rights group said some 20,000 people are believed to be in Iraqi custody on suspicion of ties to IS. Many are held in inhumane detention facilities and not granted due process, according to the watchdog’s 76-page report, based on information gathered in Baghdad and northern Iraq from November 2016 to July 2017.

Iraq’s Prime Minister Haider al-Abadi dismissed the report, saying much of its findings were “unverified” and that Human Rights Watch should devote more attention to the crimes committed by the extremists.

As Iraqi ground forces backed by the U.S.-led coalition have slowly retaken nearly all of the territory once held by IS, thousands of men, women and children suspected of having ties to the group have been arrested and detained.

The prisoners have overwhelmed Iraq’s already weak judicial system.

Screening processes are flawed, many detainees are being held in inhumane conditions and suspects are largely being tried under broad counterterrorism laws with harsh sentences, the report said.

An innocent person wrongfully identified as an IS member in the screening process “may spend months in mass arbitrary detention during the course of their judicial investigation,” the group found.

Prosecuting IS suspects under Iraq’s counterterrorism laws is “easier,” Human Rights Watch said, as a court would only need to prove membership in IS, rather than establish that individual acts violated Iraqi criminal codes.

Under counterterrorism laws, Iraqi authorities can sentence people who worked as doctors or cooks within IS with the same harsh penalties — including death or life in prison — as IS members who carried out violent acts, the report said.

“This approach makes it less likely that the process will establish a more comprehensive judicial record of the crimes committed,” Human Rights Watch warned, ultimately depriving IS victims of justice and potentially undermining future attempts at reconciliation in Iraq.