MOSUL, Iraq (Reuters) - Piles of concrete and metal rubble reach up to the second storey of surrounding buildings in parts of the historic quarter where Islamic State is making its last stand in Mosul.

An old bridge destroyed by clashes is seen in the Old City of Mosul, Iraq July 10, 2017. REUTERS/Thaier Al-Sudani

Soldiers passing through the narrow alleyways and abandoned homes of the Old City on Sunday scrambled over stone blocks, reinforced steel poles and sheets of aluminum to inspect the military’s latest gains while their comrades fought on nearby.

Charred bodies, mostly covered with blankets, lay amid the rubble. A man’s hand stuck out from under one cover, another’s dusty feet extended from another. Some were clearly militants but others looked like civilians, including a woman and a child.

As the nearly nine-month U.S.-backed offensive to retake Mosul draws to an end, the Old City has been among the hardest hit areas by the house-to-house fighting backed by air strikes, artillery and heavy machine guns to uproot the insurgents who have resisted with suicide bomb attacks.

The riverside district, whose mosques, churches and markets date to the Medieval Ages and even earlier, were long neglected before Islamic State took over in 2014.

The insurgents have blown up several landmarks there including the iconic Hadba minaret and its adjoining Grand Nuri Mosque, where leader Abu Bakr al-Baghdadi proclaimed a modern-day “caliphate” three years ago.

Several hundred militants were holed up in the Old City among tens of thousands of civilians when Iraqi forces breached the area last month.

Those numbers have dwindled, with a few dozen militants maintaining resistance as Prime Minister Haider al-Abadi traveled to Mosul to declare victory.

Moments before his arrival on Sunday, a half dozen air strikes pounded the last pocket of the city where the insurgents are gathered. The blasts sent unidentified fragments toward the sky including what appeared to be an Islamic State flag.

Slideshow ( 4 images )

The explosions, mixed with sporadic gunfire, continued on Monday as Abadi met with local officials.

CLEARING RUBBLE

Soldiers combing the ruins passed a hole knocked into the side of a building, revealing a relatively intact living room, with cushioned chairs and a couch covered in dust.

Another small room was furnished with foam sleeping mats and scattered with food scraps, indicating it was recently inhabited by retreating insurgents or advancing soldiers, or possibly both in quick succession.

The soldiers walked through a burnt-out elementary school and an outdoor basketball court where a mural painted on one wall bears the adage: “Cleanliness is part of faith”.

A bulldozer was already clearing rubble in an open area nearby. In another section of the Old City with broader streets and taller buildings, federal police dot a moonscape scene.

Storefronts were gutted, a six-storey apartment block had collapsed in on itself and a two-storey home was knocked off its foundations and leaned on its side.

The police showed off explosive vests they found alongside the militants, who they said were of Asian origin. They said they still had to clear tunnels running underneath the Old City to make sure Islamic State fighters were not hiding there.

While some Mosul districts were only lightly affected by the battle, nearly a third of western neighborhood have been heavily damaged according to the United Nations, which estimates it will take more than $1 billion and at least a year just to repair restore basic services to the entire city.

A soldier returning from the front on Sunday unfurled a black Islamic State flag, holding it upside down and posing for pictures. He boasted it is the last of its kind in Mosul.

In reality, military officials say Islamic State has set up sleeper cells across the city and that they are working to prevent a new wave of guerrilla-style attacks as the group goes to ground.