After nine months of vicious street-to-street fighting to drive the Islamic State out of Mosul, it could take many years more to fully remove explosives and other munitions from one of Iraq’s most populous cities, U.S. State Department officials said.

“When I look around the world in some ways there’s nothing like Mosul that we’ve encountered.” said Stanley Brown, the director of State’s Office of Weapons Removal and Abatement. “The level of contamination though is not one of those where we’re talking weeks and months, we’re talking years and maybe decades.”

Over three years of occupation, the Islamic State mined and booby-trapped large sections of Mosul. Heavy combat has also littered the city with unexploded ordnance such as artillery shells and hand grenades. In the western reaches of the city, where the fighting was especially fierce, massive debris fields will need to be removed to clear the ground beneath.

Pehr Lodhammar, the senior program manager for the United Nations Mine Action Service, or UNMAS, in Iraq said that the State Department’s clearance estimate could be accurate, but added that his team is still assessing explosive contamination levels in western Mosul.

“It’s hard to grasp the scope,” he said.

The Islamic State’s grip on the city, which began in the summer of 2014, allowed the militants to experiment with, refine and even industrialize their improvised explosive devices, or IEDs. While the explosives in the weapons are fairly basic, their triggering devices are some of the most complex de-miners have ever seen, according to U.S. and U.N. officials. They often involve multiple anti-tampering mechanisms and triggers that are undetectable to metal detectors, the officials said.

In addition to booby traps, the tens of thousands of rounds of explosive ammunition fired by Iraqi and U.S.-led coalition forces are estimated to have had a roughly 10 percent failure rate, said Lodhammar, adding that the Islamic State, with its home-built munitions, had an even higher failure rate. All of that material will have to be disposed of and destroyed.

“It sounds like a nightmare problem for bomb disposal technicians,” said John Ismay, a former Navy Explosive Ordnance Disposal officer who is now a senior crisis adviser at Amnesty International.

“The hazard won’t be gone until every last bit of rubble is cleared away,” he added.

Solomon Black, a program manager at the Office of Weapons Removal and Abatement, said the amount of explosives remaining in Mosul is “incomparable to anywhere else we’ve encountered in Iraq.” He added that Iraqis on the ground have said that many of the explosive devices have been planted around key infrastructure in the city, 90 percent of which is damaged, adding to the difficulty of clearance.

“They want to keep the water from running, they want to keep the lights out and they want to keep people from coming back to their homes,” Black said of the Islamic State. Both U.S. and U.N. efforts are concentrated on demining areas with water treatment, power plants and other critical infrastructure in a bid to restore some semblance of normalcy in the city.

Mosul had a prewar population of nearly 2 million, but tens of thousands of residents have died or fled from the fighting and will have to navigate the risks from unexploded munitions when they return home.

Both the U.N.’s Mine Action Service and the State Department have dedicated significant resources to warning civilians about the dangers of unexploded munitions and booby traps. At entry points into Mosul, the U.N. is handing out leaflets for residents returning to their homes and holding classes at some of the refugee camps on the city’s outskirts.

“They turned our house into a weapon against the army,” said a young woman in east Mosul who gave her name as Qammar. “I grew up in that home. They turned something so beautiful into something so ugly. It makes me cry when I think about it.”

Islamic State booby traps have been found in vacuum cleaners, couches, ovens and other everyday items, officials said.

Residents evacuated from several of Mosul’s western districts also said this week that the militants had also mined the road residents had tried to flee along. For 23-year-old Muhammed Nabila that meant watching from the window as his cousin died testing the route.

“The explosion seemed to come out of nowhere,” he recounted. “He lost both his legs at the side of the road. No one was allowed to recover his body for days.”

A lack of enough trained personnel and resources remains one of the biggest impediments to clearance operations. Iraqis working with U.S. and European contractors will have to be taught how to handle some of the more sophisticated booby traps; Iraqi forces have already suffered significant casualties from mine clearing.

David Johnson, vice president for strategic development at Janus Global, a State Department contractor that provides mine-clearing services in Iraq and Syria, said that $100 to $200 million will likely cover the cost of clearance around key infrastructure in Mosul, but more will be needed to clear the entire city.

“If you look at the fact that we’re still cleaning up unexploded ordnance in Southeast Asia and we’ve been there 20-plus years; in Afghanistan our program started in the 1988-1989 time frame and there’s still a lot of work to do,” Brown said. “We’re talking years, if not over a decade to get everything done.”

Louisa Loveluck reported from Mosul. Mustafa Salim in Mosul contributed to this report.