Iraqi security forces closing in on the city of Mosul have faced a fierce onslaught as they breached the first neighborhoods of the city this week.

Military commanders had previously said they were not sure whether the militants would dig in and fight to the death, knowing that the city would eventually be lost. Those questions appear to have been put to rest.

Brig. Gen. Yahya Rasoul, spokesman for the Iraqi military, said Friday’s fighting, as elite counterterrorism forces made a push into several neighborhoods of the city, was the toughest Iraqi forces ever faced against the militants.

They have had more than two years to build their defense lines, and images released by Stratfor and obtained by AllSource Analysis show just how hard they’ve dug in.

The aerial photographs show the militants have cleared a large swath of land on the southern outskirts of the city.

“By destroying the buildings, the jihadists are likely trying to transform the edge of Mosul's fortified city center into a wall from which they can target approaching adversaries,” Stratfor said. “The large open areas the Islamic State has cleared to the south of its positions will enable it to watch and engage advancing forces from a greater distance.”

Other images show lines of concrete blocks barricading roads into the city and large earthen berms designed to slow the advance of security forces. Rasoul said the militants are doing whatever they can to hang onto the city, including using civilians as human shields.

Unseen from the air, however, are the extensive tunnel networks they have dug.