Men identified by Iraqi security forces as suspected Islamic State militants are presented at a media conference at the Iraqi military intelligence directorate in Baghdad, Iraq September 28, 2017. Khalid al Mousily

At the height of its power in Iraq, Islamic State controlled 40 percent of the country’s territory and the daily lives of millions of Iraqis. Tens of thousands of Iraqis came to serve the IS administration, including as doctors, teachers, judges, cooks, and lawyers, arguably contributing to the group’s control of the cities it occupied.

Just as Iraqis were forced to join the Baath party under Saddam Hussein, many in IS-controlled areas say they were forced to join the group to keep their jobs – though no doubt some also supported IS’s extremism.

But today, under Iraqi law – and as urged by various United Nations resolutions – Iraq is trying to prosecute them all. Those convicted face life in prison or the death penalty merely for IS membership. But such broad prosecutions would be a grave mistake if Iraq is ever to establish some modicum of national reconciliation.

There is global sympathy for Iraqi popular demands for justice against the IS criminals who mercilessly, even proudly, caused unimaginable suffering, death, and destruction in Iraq (and Syria) for three years. Our 21st century is now scarred with the modern medievalism of captive Yezidi women sold as slaves and journalists in orange jumpsuits beheaded with giant swords on live camera. Beyond the daily tyranny IS inflicted on Iraqis under their control, from public killings for minor offenses to strict codes of religious conduct ensnaring ordinary families, it caused the deaths and injuries of thousands of Iraqi soldiers deployed to defeat it. And IS militants certainly showed no respect for the laws of war or human decency in how they treated captured Iraqi soldiers.

The UN has established a special investigative team to gather evidence of IS crimes to assist Iraqi courts in their prosecutions. But the international community has chosen to look away from the mass vengeance still under way at the hands of Iraqi soldiers: grotesquely torturing, beating, and executing IS suspects while arbitrarily detaining thousands of IS-related women and children in makeshift camps and prisons.

While this vigilantism in the heat of war may well subside, the trials, jailing, sentencing, and execution of at least 10,000 IS suspects will go on for years, sustaining new grievances for a much greater number of Iraqi families, tribes, and communities. Our research into these prosecutions shows that they are rife with the same due process violations that have for decades tainted the Iraqi judicial system – detention in inhumane conditions based on flimsy evidence; allegations of severe torture to coerce confessions; no prisoner access to lawyers or families, who often don’t even know if their loved one is alive; and summary trials, some lasting as little as 15 minutes but resulting in hastily-issued death sentences.

Sadly, these trials don’t even have the merit of establishing a judicial, historical account of IS’s crimes against the Iraqi people and a real sense of justice for the victims. Instead, the only charge IS suspects regularly face is “membership in Islamic State,” quite easy to prove with a one-sentence confession, but with no effort to establish the full record of crimes, such as genocide under international law or rape and murder under Iraqi criminal law. There’s no strategy to prioritize prosecution of those most responsible for the gravest abuses, instead of the “first in, first out” factory-line process, where, as one senior Iraqi judge insisted to us, “the Islamic State cook is as guilty as the Islamic State fighter.”

Victims of IS crimes, who should be able to testify about abuses they suffered and have the satisfaction of seeing the wrongdoers face justice in a court of law, are not included in these trials, leaving a vast disconnect between victims and the justice system. We already know that Iraqi courts have prosecuted at least 7,282 IS suspects under the counter-terrorism laws, and executed 92. Without a dramatic shift in approach, we will see hundreds more, if not thousands, executed, and ten times that number clogging Iraqi courts and prisons for decades.

There is an alternative to this disappointing and dangerous outcome and it is well within Iraq’s practical reach, if not within its immediate political will. Iraq can, and should, find alternatives to prosecution for the thousands of IS suspects who carried out no serious crimes or acts of violence. Let’s face it: The reasons someone may have joined IS are complex and touch upon a long history of Sunni isolation, for which many in Iraq are to blame.

A better (though no doubt imperfect) way to address the community betrayal such membership most deeply represents is to allow these IS members to participate in a national truth-telling mechanism that can also create a meaningful record of IS crimes, and to make amends through service to the Iraqi communities to which they and their families ultimately belong. There is ample precedent for this. In many other post-conflict situations, governments have decided to choose such alternatives to prosecution as the best way forward. Given the deeply fractured state of Iraqi society, this may also be its best chance to unite and rebuild a peaceful country.