On Friday March 17, the American-led coalition launched airstrikes targeting the western part of ISIS-controlled al-Mosul in northern Iraq. This operation killed over three hundred civilians and forced many more to flee the city. Hundreds of bodies have been left in the streets with no one to bury them. Almost four million Iraqi citizens are now displaced, and Mosul’s destruction has cost billions of dollars.

At this price, we must ask if winning the war against ISIS will end terror in Iraq.

ISIS’s appearance in Iraq on June 10, 2014 surprised many, but, in fact, Mosul had fallen under its partial control, albeit indirectly and informally, since 2004. ISIS only announced its existence in 2006 and has spent the past decade building its military and ideological powers.

We should attribute their emergence, first and foremost, to the American war on Iraq, which empowered Al Qaeda to take root as a resistance both to the US-led coalition and to the new Shia-led national government and its ally, Iran. Baath party members, defeated after Saddam Hussein’s regime collapsed and marginalized in the new order, joined them.

These groups organized themselves under headings like Naqshbandis, Ansar al-Islam, and the Moujahideen Army, and their aim was to retake control. The cooperation between Al Qaeda and the remnants of the Baath regime reached its peak with ISIS’s establishment.

The politicization of sectarian identity during the American occupation made ISIS’s occupation of Mosul possible. The US-installed regime oppressed citizens in western Iraq, classified as “the Sunni triangle.” The army’s corruption exacerbated the situation, as it abandoned the city of two million people. It took less than two thousand ISIS fighters to storm Mosul from the west and advance forty miles closer to Baghdad.

Iraq’s internal sectarian conflict has regional and international sponsors. The government in Baghdad sought military support from Iran, which generously provided arms, military leadership, and knowledge. Hezbollah in Lebanon also helped its Shia allies. Turkey, Saudi Arabia, Kuwait, and Qatar aided the Sunni political parties in Mosul, each nation hoping to find a foothold in Iraq.

The battle for Mosul has been costly. While it seems nearly at an end, there’s no indication that the sectarian conflicts that have plagued Iraq since 2003 will disappear with ISIS. Since the war to retake Mosul started in October of last year, many civilians have been caught in the crossfire between coalition air strikes, Iraqi ground troops, and ISIS militias. Causalities have reached the hundreds of thousands.

Iraqi troops had originally asked people to stay in Mosul, while ISIS was shooting at anyone leaving the city, but the battle has so intensified that it now moves from suburb to suburb, from house to house. ISIS regularly uses civilians as human shields, and some classify the American air strikes as war crimes. Shia militias have also been accused of sectarian atrocities. Some allege that they have deliberately targeted hospitals and educational institutions.

Those lucky enough to escape from ISIS-controlled areas live in camps in Kurdistan and other surrounding areas. These four million people represent the largest number of internally displaced persons in Iraqi history.

Furthermore, since the Mosul offensive started, terrorist attacks on Baghdad and other cities have increased. They could intensify even more if ISIS is defeated. Both Iraqi officials and the United States describe the battle to “liberate Mosul” as part of a “war on terror.”

But as long as sectarian conflict persists, even the defeat of ISIS will not guarantee peace and security. At stake is not just religious ideology, but a war over who controls the Iraqi state, which determines who controls the nation’s essential oil revenues.

As part of the postwar reconstruction, the United States introduced a political structure based on sectarian and nationalist division called muhasasa. This agreement institutionalized sectarian power-sharing and distributed state revenues to religious and national groups, corresponding to each organization’s size.

Since the vast majority of Iraqis identify as Shia, they received that largest share of power in parliament, government, and other state institutions. Sunnis and Kurds formed minorities and control a smaller share.

Muhasasa represents a radically new way of dividing power in the country, which fueled conflict not only between religious sects but also between national groups. Now, as the war in Mosul is approaching its final stages, the local powers are preparing for the post-ISIS era. Each group is trying to reposition itself to benefit the most from this new political reality.

The Shia militia hopes to be crowned the liberators of Mosul and won’t share this victory with their competitors. Through Iraq al-Hashd Al-Shabi (or People’s Mobilization Forces), the Shia recruited hundreds of thousands of young men from central and southern parts of the country. This new force won what it perceived as a parliamentary victory when the government recognized it as independent, despite the fact that the Shia-led government taxed four million government employees a compulsory 4 percent of their salaries in order to fund al-Hashd Al-Shabi.

The post-ISIS fate of this militia remains to be seen: it might disband or it might try to consolidate its political power by claiming the right to participate in the coming elections. It aspires to no less than the role the Islamic Revolutionary Guard plays in Iran. To avoid this possibility, Sunni political groups resisted al-Hashd’s participation in the battle of Mosul from the outset.

Sunnis in Western Iraq may feel that they taught the Shia-led government a hard lesson by opening their doors to ISIS. They are looking forward to gaining more power, claiming the right to rule areas that are classified as majority Sunni, without Shia intervention, as they did before 2014. Supported by Turkey, Saudi Arabia, and other international players, they held two conferences in Geneva and Ankara as well as meetings in Jordan, Doha, and the Tanzanian capital Dar es Salaam, with this aim in mind. They want to press the Shia government to adopt a strategy for the “equal distribution of wealth.” Given these demands, Islamic Sunni parties may cooperate with ISIS or other new groups if they do not receive a fair share of power in post-ISIS Iraq.

For Al-Barzani, the president of Kurdistan Regional Government (KRG), the war in Mosul represents an opportunity to retake what his party sees as Kurdish land. Hoshyar Zebari, former Iraqi finance and foreign minister, promised that Kurdistan will hold an independence referendum in 2017.

Sectarianism gave the Shia a powerful justification for taking control of Iraq’s political and economic structures, making a fair distribution of power impossible. The struggle over state resources has been waged under sectarian slogans, so we can’t assume that this discourse will vanish with ISIS.

Sectarianism provides groups with legitimacy to represent their communities and grants them an effective tool for mobilizing their constituents. While both Islamic Shia political groups and Sunnis have adopted cross-sectarian discourse over the last few months, we should not take this change seriously. Why would Shia parties depart from their sectarian platform after liberating Mosul from ISIS?

Corruption also makes finding a solution among these sectarian groups difficult. In a state with no rule of law, those who have access to the state’s resources have no motivation to give up their share.

The post-ISIS era remains uncertain, but the institutionalization of sectarianism and corruption will make fertile ground for more violent conflicts. The Iraqi people must not only push for a civilian state, but also demand a secular state as a precondition for ending the war based on religious and sectarian identities.