NINEVEH PROVINCE, Iraq—Night has fallen as Haitham Alwan enters his cousin’s house in a quiet suburb of Mosul. It will be his home for a few days, then he will move on. Perhaps to his godparents', who have already taken in his two children.

The 44-year-old former soldier is cloaked in a worn-out winter coat which he wears over a filthy thobe. A man on the run, he has neither time nor money to improve his appearance.

“I never stay in one place for very long. I’m scared that ISIS will find me,” he says.

When talking, Haitham’s left eye scans the room nervously. The right eye stares ahead rigidly, its pupil blotted white. It is a memento of his time fighting the so-called Islamic State in Mosul, where he spearheaded attacks in an armored bulldozer to clear barricades and mines in the claustrophobic battle for the city.

Heavily wounded by an RPG that hit his vehicle and penetrated the driver’s cabin, he left the army before the battle was out. Haitham was back in his native village near Mosul when then-Prime Minister Haider Abadi declared the war against ISIS won.

But in the remote, barren countryside of northern Iraq, the war was never really won. Soon, marauding bands of surviving ISIS fighters began setting ambushes, planting mines and attacking soldiers and civilians.

Dozens of checkpoints and army bases dot the area around Mosul. Many are guarding the main highway connecting the city to Baghdad. Less strategic stretches of land are not protected. The soldiers in the bases—a few houses or containers surrounded by earthen berms—point to the horizon and shrug their shoulders. We have no bases over there, that’s bandit country, they say.

But even Haitham’s home village of Bijwaniya, which lies only a couple of miles off the highway, is not safe, as he was soon to discover. One night in November, five men knocked on his door. They claimed to be part of a local militia, but when Haitham became suspicious and refused to open they began shooting. The rounds of their assault rifles tore through the door and hit the wall of the mud hut. Three bullets hit Haitham’s wife Ayda. Haitham, crouched beside the door firing his rifle, managed to fight off the attackers, but his wife died from her wounds.

After the attack, Haitham fled his village. Too many of its inhabitants still sympathize with the terror group, he says.

“Because of the support from the locals, ISIS is roaming the area unhindered. There are not enough soldiers around to prevent attacks on villages,” says Haitham.

The terror group’s survival is nourished by the glaring poverty of rural Iraq. ISIS benefits from the frustration at the government, which has made no effort to divert any of Iraq’s plentiful oil receipts to villages like Bijwaniya. The cluster of mud huts is not connected to the power grid or a water supply; there are no paved roads. Most of its residents are unemployed.

The situation is not much different in nearby Mosul. In the metropolis on the Tigris, poverty abounds. Swathes of the city have been devastated by the war, but reconstruction efforts by the government are paltry. The historic old town on the banks of the Tigris lies in ruins, and bodies are still recovered from the rubble.

Most of the reconstruction is funded privately, with families spending their money to rebuild their homes or businesses. Barely any of the city’s infrastructure has been repaired. According to the Norwegian Refugee Council, almost $900 million is needed to restore basic services. The government has committed only a fraction of that, much of which has been eaten up by corruption.

“We have beaten ISIS, and the city is safe. The next step is to rebuild Mosul, to help the people and give them jobs. But we are only making very slow progress on this important step,” says Major General Najim al-Jubouri, the commander of security forces in Mosul.

Jubouri has set up his headquarters in a sprawling palace complex built by Saddam Hussein. The palace itself was destroyed by U.S. bombs during the Second Gulf War, and the major general has his offices in a spacious side building instead. The vast palace complex is a reminder that Iraq’s oil wealth tends to benefit the country’s rulers, not its people.

A drive from the palace in the city center to Mosul’s periphery confirms that impression.

“The only time we see politicians here is during the elections. They come and tell us that everything will get better if we vote for them,” says Fathi Khedir, a taxi driver living in the suburb of Tanak. The area is right on the edge of Mosul, where the city peters out into the muddy expanses of the Nineveh plains. There are few paved roads, and electricity is mainly generated by noisy truck engines that belch exhaust fumes into the neighborhood. Employment is scarce.

Areas like Tanak proved a fertile recruitment ground for ISIS. Discrimination against Mosul’s Sunni population by the Shia-dominated government added to the resentment, and throughout the city a dense network of terror cells wrested control from security forces even before ISIS stormed it in 2014.

“Mosul was lost before ISIS took the city,” says Lieutenant Colonel Muhsin Mtewti. The officer commands a police station in the 17 Tamuz neighborhood that lies adjacent to Tanak in West Mosul. Because the station building was destroyed in the war, Mtweti has commandeered the house of an ISIS family that has been expelled from the city. Cordoned off by concrete blast walls, it is a base from which heavily armed police officers start their patrols in huge American pick-up trucks. While the men remain alert, their relationship with the population has improved, says Mtewti.

“The people are on our side now, they hate ISIS. And it has to stay that way. I always tell my men to behave well towards the population,” says the officer.

Fathi the taxi driver concurs. After having lived through three years of tyrannical ISIS rule, few people want the jihadists back, he believes.

“We have all suffered a great deal,” he says.

But it would not be Iraq if the government was not doing its best to squander its hard won moral victory.

On a ridge leading down to the Tigris, a solidary house stands out from the devastated old city. It belongs to the family of Rajab Younis Rajab, a 23-year-old politics student. The family used money from an aid organisation to repair the house after the war, and painted it pink in defiance of the bleak destruction surrounding it.

Despite the fresh start, Rajab is troubled by what he sees outside his house. It’s not the rubble that worries him, but the gangs of young boys scavenging bombed-out houses for electrical wiring and other metals that can be sold for scrap. Having lost their homes and often their fathers, these boys are the breadwinners of their families, which have been left to fend for themselves.

There are many families like that, says Rajab. Anger, and desperation, will make them susceptible to the next wave of extremists challenging the government, he believes.

“Some people don’t even have enough to eat. They would kill for a bit of money,” he says with a resigned sigh. “People will radicalize under these conditions.”