A sniper from the Iraqi Federal Police in the Dawasa neighborhood of Mosul on March 30.
Emanuele Satolli for TIME
April 13, 2017 7:05 AM EDT

The gunmen came in the afternoon.

Wearing the drab and baggy uniform of the Islamic State, they arrived at the door of Bashar Abu Ali’s home in western Mosul to commandeer it as a sniper’s nest. There were seven or eight of the militants, all Iraqis. They used an upstairs bedroom to shoot into the broad road outside.

In those days in late February and early March, the Islamic State was falling back quickly. The Iraqi military swept into the city, backed by ferocious American airstrikes and artillery. The militants had already lost the eastern half of the city and were now scrambling to mount a defense of the west side. That meant seizing some vehicles to make car bombs, setting fire to others to create smoke screens and taking over hundreds of civilian houses like Abu Ali’s, militarizing both the urban and the suburban landscapes of the city.

Then the battle began. For 11 days, the 43-year-old coffee-shop manager cowered with his family in terror in downstairs rooms while the ISIS fighters held the high ground, taking shifts shooting at the top of the stairs. American and Iraqi warplanes rained bombs around them. “I was 90 to 95% sure we were going to die there,” said Abu Ali. There was no thought of leaving. Better to die in your own home, he thought.

When the Iraqi military and police arrived in their neighborhood, the gunmen fled in a panic. What they left was a landscape of bombed-out buildings and twisted metal, the burnt skeletons of cars and trucks flung aside by massive explosions. There is no electricity, no running water and few shops selling food. A defused car bomb in a narrow street looks like a battle wagon from Mad Max, steel plates where the windshield and hood should be. “Do you want to see the body?” a resident asks, and leads the way to the corpse of a “Russian”–shorthand used for foreign fighters from former Soviet nations, who spoke Arabic poorly. Killed at least two weeks earlier, his burnt body still lies in the street, one charred arm protruding from under a blanket.

After six months of fighting, the end is in sight in the battle for Mosul–a victory that, when it comes, will mark a turning point in the broader war against the Islamic State. Iraq’s second city has embodied the group’s claim that it was in fact building a state–and a warning that Iraq might not be one much longer. When the city of 2 million fell to ISIS in June 2014, it took only hours and demonstrated less the military might of the insurgents than the hollowness of Iraq’s sovereignty under a government ruled on sectarian lines: many Sunnis in Iraq’s north and west preferred Sunni militants over a Baghdad government responsive only to Iraq’s Shi’ite majority.

But ISIS has now been ousted from more than half the city by a massive force marshaled against it: 100,000 Iraqi government troops and Shi’ite, Sunni and Kurdish militia fighters, backed by more than 5,000 American troops and crucial air support from the U.S., France, Britain and Australia. The battle is the largest in Iraq since the U.S.-led invasion of 2003, and brutal proof of the maxim that war is the continuation of politics by other means.

At great cost, the forces backing the fragile Iraqi republic have recaptured the entire eastern section of the city up to the Tigris River and are now besieging the militants on the western bank. The west side includes some of the poorer neighborhoods of Mosul, a once prosperous and diverse city that before the arrival of ISIS had been home to Sunni, Shi’ite and Christian Arabs as well as Kurds. Here the fighting is denser and deadlier than in the east. In the packed neighborhoods on the edges of Mosul’s centuries-old core, soldiers trade fire with the ISIS gunmen among the houses. Iraqi infantry are now within reach of an icon of the Islamic State’s collapsing empire, the Mosque of al-Nuri. It was here in July 2014 that ISIS leader Abu Bakr al-Baghdadi ascended to the pulpit to herald the establishment of a new caliphate, stretching at that time from the Turkey-Syria border to the outskirts of Baghdad.

Victory is no longer a real possibility for ISIS in Mosul. The estimated 2,000 militants in the besieged area know that there is no escape and that, unlike the men upstairs at Abu Ali’s, they are fighting to the death. Their weapons may remain as crude as their propaganda–car bombs, booby traps and hundreds of human shields–but the feeling is different as the end draws near. “There’s a change in desperation,” says U.S. Army Lieut. Colonel James Browning, who advises the 9th division of the Iraqi army in the Mosul campaign. He said the Iraqi soldiers on the ground have come to consider each ISIS fighter a potential suicide attacker. “They know they have an enemy that is still willing to die for their cause, and maybe even more so now than they were before.”

Iraqi troops on the front lines believe the gunmen arrayed against them are some of the group’s most combat-hardened, many of them foreign fighters with no expectation of going back to Saudi Arabia or Belgium or Tunisia. According to Iraqi soldiers and medics in the area, they include seasoned snipers. “Last night three [soldiers] came to us dead, and all of them had, I mean, I hate saying the word, but impressive head shots,” says Jonathan Reith, an American volunteer medic at an Iraqi special-operations-forces field hospital in west Mosul on April 1. “It’s like the person took the time, lined up the shot.”

The threat to civilians caught up in the cross fire is now greater than ever. As many as half a million remain in the ISIS-controlled section of Mosul, with dwindling supplies of food, fuel, water and medicine. “[They’re the] main obstacle we’re facing,” says Jafar Jawad Qadem, a sergeant in the federal police stationed in the area. “Every time we advance, there are a lot of people inside. We can’t use our artillery. We can’t use mortars.”

They do use airpower, however, and it’s the biggest threat to noncombatants. Reported civilian casualties from the U.S.-led air war soared to an all-time high in March, with more than 1,700 people allegedly killed in Iraq and Syria. An airstrike in the New Mosul neighborhood reportedly killed more than 200 civilians on March 17, causing worldwide consternation. As the Pentagon investigates, coalition commander Lieut. General Stephen Townsend said on March 28 that there was a “fair chance” the U.S. was responsible.

President Donald Trump took office just a few weeks before the western Mosul offensive began, after a campaign in which he promised to “bomb the sh-t” out of ISIS. The U.S. military denies that the rules of engagement have changed since he took office, blaming the brutal tactics of ISIS, including human shields, for the increase in civilian casualties. “What you see now is the result of fighting an evil enemy,” the U.S. Central Command said in an email response to TIME’s inquiry.

Still, intense use of airpower in densely populated cities risks alienating the ordinary people whose cooperation the coalition needs for the political contest at the heart of things.”If you’re doing a lot of damage to civilians, ISIS is going to be able to shape the message,” says Lieut. Colonel Jay Morse, a retired U.S. Army judge advocate now with the Center for Civilians in Conflict. “You increase the likelihood that you’re going to fight this exact same fight in another city on another day.”

The next city where the Trump Administration will need to tackle this question is Raqqa in Syria, the last bastion of ISIS rule, whose liberation presents a tangle of new issues–especially as the U.S. deals with the consequences of its strike on a Syrian airfield on April 6. U.S.-backed Syrian militias are poised on the edge of the city, but it remains unclear when and how they plan to take the city. The Trump Administration is also putting more U.S. troops on the ground in the Raqqa campaign, opening the door to a prolonged deployment in Syria.

Then there’s the thorny question of the U.S. future presence in Iraq after Mosul falls. The issue surely came up during the April 3 visit to Baghdad by senior White House adviser Jared Kushner, the President’s son-in-law, the sight of whom, chatting with officers in a flak jacket over his blazer, was a snapshot of an Administration still finding its feet on foreign policy.

Under ISIS, Mosul was a laboratory for an experiment in jihadist governance. Today remnants of its rule litter the liberated areas of the city. In the once upscale Dawasa neighborhood, the militants had taken over a restaurant, converting it into an office for registering cars–ISIS’s version of the DMV. Scattered outside, among the bombed-out buildings, lie Islamic State–issued license plates.

For all its pretensions of governance, though, most Mosul residents remember the ISIS period as a time of petty brutality. Toward the end of their 33-month tenure, the jihadists seized cars and other valuables, carting their assets across the border to Syria as they braced for the Iraqi offensive. “This wasn’t a state. It was a gang,” says Jasem Ahmed, 57, a truck driver in Dawasa, after picking through some of the left-behind ISIS documents in the abandoned vehicles office. “If you want to build a state, you have to build something, and they took everything.”

Today ISIS controls only 7% of Iraqi territory, down from 40% at its peak, according to the Iraqi military. Although it still controls Raqqa, the group’s claims to a caliphate–a territory to hold out as beacon to all the world’s Sunni Muslims–will be in tatters once Mosul is freed. But ISIS will remain a potent movement, albeit in a different form. Already it is stepping up efforts to maintain its global profile with attacks far from the theater of conflict. In recent weeks, the group has claimed terrorist strikes in St. Petersburg, London, Stockholm and Egypt, where dozens of Coptic Christians were killed as they celebrated Palm Sunday. Over time, ISIS will look less like a state and more like a terrorist group in the mold of its forebear al-Qaeda, generating headlines not by seizing territory but through spectacular acts of killing.

“Even as they lose territory, I think it’s likely that they’ll maintain relevance, by shifting strategy toward asymmetric insurgency,” says Noah Bonsey, a senior analyst for the Brussels-based International Crisis Group. That goes not only for targets in the West, he adds, but also for the battlefields of Iraq and Syria where the group made its name. “It’s not as if they’re going to be unable to operate in what will still be quite weakly governed, if governed at all, territory.”

In Mosul, the chaos they leave behind is visible on every corner. In the Aqeedat neighborhood, TIME was led to a heap of dead bodies sprawled in an alleyway. Women, children, two old men with white beards, they are 16 in all, their faces bloated with blood now, at least a week after they were killed.

One Iraqi federal police officer said he witnessed the family die after triggering a booby trap. Another was certain they had been shot dead. In its morbid details, the debate took in both the physical horrors and the mentality abroad in a country now 14 years at war. “In our experience, if it’s a mine, you’ll see body parts everywhere. But as you can see, there are bullets everywhere,” the officer says. “ISIS wanted to make an example of them, for others who try to flee.”

This appears in the April 24, 2017 issue of TIME.

Contact us at letters@time.com.

Read More From TIME

Related Stories

EDIT POST