When fighters with the Islamic State of Iraq and Greater Syria swept across Iraq in the summer of 2014, the largest prize they claimed was the city of Mosul. The jihadists forced the Iraqi military and a large portion of the city’s population to flee. With roughly 600,000 residents remaining, Mosul is the largest population center under ISIS control, a key source of prestige and resources and a living advertisement for the group’s claim that it is building a state.

In March, the Iraqi government announced the launch of a military operation to retake Mosul, but so far the campaign has only made incremental progress, reclaiming a series of villages with the help of the U.S.-led military coalition against ISIS. The Iraqi military lacks the troops to launch a full-scale assault on the city, and in late May the government committed troops to a separate campaign to retake Fallujah, another key ISIS-held city that lies closer to Baghdad. Pro-government forces retook the center of Fallujah on June 17. Iraqi Prime Minister Haider al-Abadi declared on Twitter, “Fallujah has returned to the nation and Mosul is the next battle.”

But Mosul won’t be easy, and it’s not just because of the military challenge. The Mosul campaign is complicated by a political stalemate within Iraq. The military is expected to rely on powerful Kurdish militias to help pave the to Mosul, but the semi-autonomous Kurdish government in northern Iraq has yet to commit to the operation, claiming they are not properly equipped for an attack on the city. In Fallujah and other battles, the government has relied on Shi’ite-majority militias called “hashd al-shabi,” or popular mobilization forces. Prime Minister Abadi said in February that the militias would join the battle for Mosul, but to date none of them have been sent to the front lines approaching the city. Rights groups have accused some of those groups of of war crimes, and critics say that sending the militias into a Sunni-majority city like Mosul could cause further sectarian violence.

While the battle for Mosul has yet to begin in earnest, members of the Iraqi military, Kurdish militias, and the U.S. military are already fighting and dying in the battle against ISIS. Iraqi civilians are fleeing by the thousands, and hundreds of thousands of others remain trapped under ISIS rule. The jihadists continue to counterattack the opposing forces, harassing the troops holding the front lines.

In May I visited the front lines surrounding Mosul with the war photographer Yuri Kozyrev. We spoke with Iraqi, Kurdish, and U.S. soldiers involved in the battle against ISIS. The resulting report—on the cover of this week’s international TIME—is a rare glimpse at the situation on the front lines and the looming battle for Mosul.

Our reporting took us to several places that had recently been wrested from ISIS control, a set of devastated towns now under the control of an array of competing forces. We visited a village south of Mosul called Kharbardan that had been retaken by the Iraqi military in March. The Iraqi troops there are in control of a deserted hamlet, with ISIS forces just out of sight in an adjacent village. The troops there had repelled an ISIS ambush only two days before we arrived. “Every Thursday we have a party to welcome them,” one soldier said of the attackers.

Map data as of June 13, 2016

Everywhere, front line forces said they faced frequent counterattacks from ISIS. In the town of Bashir, south of Kirkuk, Iraqi police said ISIS had fired chemical weapons at them, injuring at least 46 people. The town itself was reclaimed from ISIS by both Kurdish forces and an ethnic Turkmen unit of the Shi’ite Popular Mobilization forces. Armed men from both groups waved to each other as they patrolled the bombed out streets of the town in pickup trucks, even though Kurdish and Turkmen fighters had fought deadly gun battles in a town just an hour’s drive away. It was just one example of the kaleidoscope of armed groups operating on the ground in Iraq, and the tensions among forces that may share little more than an enemy.

Backed by U.S.-led airstrikes, Kurdish forces retook the town of Sinjar from ISIS in November 2015, seizing a site where ISIS forces committed some the worst atrocities during their march across Iraq. ISIS jihadists killed hundreds of people and captured and raped thousands of women and girls from the Yazidi religious minority. Like other recaptured towns, Sinjar today is an empty shell, and only a handful of locals have returned.

The ruins of Sinjar illustrate double-edged nature of the U.S.-led air campaign supporting the fight against ISIS. While the local forces battling ISIS depend on the airstrikes for support, the raids can also result in immense destruction. Coalition airstrikes have killed at least 1,323 civilians in Iraq and Syria since the war began in 2014, according to a rigorous count by the London-based group Airwars. (The U.S. government puts the toll at 42.)

The ruins also underscore the daunting task ahead for Iraq’s weak state institutions, which are still struggling to recover from the destruction of the U.S. invasion in 2003 and the mismanagement of the occupation in the years that followed. Recapturing cities like Mosul and Fallujah will only spawn a deeper set of problems of reconstruction, governance, and counterinsurgency.

The only way to defeat ISIS is to retake lost territory and dismantle it so-called caliphate. But victory, ironically, would transform the conflict from a contest over territory to an endless battle against a determined jihadist group that has a proven ability to carry out or inspire attacks far beyond its territorial core. And retaking territory from ISIS in Iraq poses the question of what comes after victory. How can Iraq restore state control in Sunni areas where residents are deeply skeptical of the Shi’ite-dominated government in Baghdad. Over the long term, winning the war against ISIS will require answers to some of Iraq’s deep political and social dilemmas—dilemmas this country has never been able to solve.