Sunni participation in the election represents an existential threat for ISIS. It could reintegrate Sunnis into a political process they’ve felt marginalized from. Such reintegration could cut against the resentment and hatred that ISIS uses to feed its ideology and attract recruits. “After ISIS, the fault lines have been shifting. I believe it has changed from before,” Hisham al-Hashemi, a former security adviser to the Iraqi parliament, told me. “At the beginning, the Sunnis believed the solution was weapons. Now they’ve turned to politics, dialogue, and foreign relations.”

ISIS and its precursors were born out of Sunni rage in the chaos and violence that swarmed Iraq after the United States toppled Saddam Hussein’s regime in 2003. That cataclysm ended the centuries-old hegemony of Iraq’s Sunnis, paving the way for a new class of Shia politicians like former Prime Minister Nouri al-Maliki, as well as political parties backed by Iran or rooted in its brand of religiously inflected populism. During the worst of the sectarian bloodshed after the fall of Saddam, Sunni jihadists attacked Shia civilians and symbols, giving rise to Tehran-backed Shia militias that targeted Sunni civilians. This deadly dynamic gave birth to al-Qaeda in Iraq, which eventually mutated into ISIS.

The fighting of those years still comprises a core part of ISIS’s mythology. “Iraq is the ‘University of Jihad,’” the group proclaimed in an article in the latest issue of its weekly newsletter. “The experiences gained by the mujahideen in their ongoing war against the Crusaders and the rejectionists [Shia] and the [Sunni] Awakening will be lessons for the mujahideen everywhere.”

When Haider al-Abadi became prime minister of Iraq in 2014 shortly after the disastrous fall of Mosul to ISIS, he was a humdrum compromise candidate chosen by lawmakers and the power brokers of his Dawa Party, agreeable to both Washington and Tehran. But he has since come into his own. Heading an electoral list for the first time, he has reached out to Sunnis, including tribal leaders and prominent politicians who have joined his slate. Abadi, unlike Maliki, grew up in Baghdad’s upper-middle-class Karada district, surrounded by a cosmopolitan mix of Shias, Sunnis, Christians, and even Sabeans, an ancient Middle Eastern religious minority. He has gone to great lengths to cool sectarian tensions that reached a peak during Maliki’s final years in office, during which he used the courts to hunt down Sunni political rivals and the armed forces to crush mostly peaceful protests in Anbar province.

Other Shia politicians are following Abadi’s lead. Former Shia militia leader Hadi Ameri, a founder of the powerful Iranian-backed Badr Brigades, has recruited Sunni militia commanders who once fought alongside him against ISIS to run on his Fatah electoral list. Moqtada al-Sadr, the Shia cleric and politician who last year made a rare visit to Saudi Arabia and has long championed the cause of Iraq’s Sunnis, has partnered with Sunnis as well as Iraq’s Communist Party for his Alliance of Revolutionaries for Reform list.