MOSUL, Iraq (Reuters) - Taking aim through a telescope on his rifle, the police officer opened fire on an Islamic State sniper from the top floor of a tower in Mosul before quickly pulling back to take cover.

A machine gun is seen on the floor next to a map drawn to show distances, on the wall of a sniper's nest in a building controlled by Iraqi forces fighting the Islamic State in Mosul, Iraq, April 6, 2017. REUTERS/Andres Martinez Casares

“Hit the sniper at the mosque,” his commanding officer told him as he aimed at his target in the Old City, one of the only districts still in the militants’ hands in their last major urban stronghold in Iraq.

Iraqi forces are trying to advance through the narrow, maze-like streets toward the symbolic al-Nuri mosque, where Islamic State leader Abu Bakr al-Baghdadi declared a caliphate in 2014.

But progress is much slower than in the early phases of the campaign, during which government forces took nearly three quarters of the city within five months.

The front line has hardly moved in the past three weeks, and the militants, along with roughly 400,000 residents, are trapped inside a ring of Iraq troops.

The soldiers expect the militants to fight to the death.

“Daesh fighters are resisting on a professional level because they have no escape routes left,” said a second policeman Hussein Qassem, using an Arabic acronym for the militants.

“They are resisting until they are killed. God willing we will not leave any Islamic State fighters. We will fight till the end.”

But advances are hard-won and fragile.

On Thursday, members of the Federal Police co-leading the advance said it was not safe to go to Mosul museum, which they had retaken three weeks ago.

“There is a lot of sniper activity over there behind that building,” a third police officer said, pointing toward an area behind the museum about 100 meters (yards) away.

Just days ago, they had taken journalists to the museum, and other areas closer to the front line.

“It’s now only about snipers and car bombs,” said an officer deployed from a Baghdad unit, as gunfire rang out and soldiers took cover among troop carriers and Humvees behind piles of sand. “They don’t have many snipers but they move around.”

They now face an extra danger.

Late on Thursday, the militants shot down a helicopter providing air support for the Federal Police, the first aircraft downed by Islamic State over Mosul since the start of the U.S.-backed offensive in October.