MOSUL, Iraq (Reuters) - U.S.-backed Iraqi forces attacked Islamic State’s remaining redoubt in Mosul’s Old City on Friday, a day after hailing the end of the insurgents’ self-declared caliphate with the capture of an historic mosque that symbolized their power.

Dozens of civilians, mostly women and children, fled across the frontline toward the troops as bullets whizzed through the air. They were thirsty and tired, and some had been wounded.

Commanders of Iraq’s Counter Terrorism Service (CTS) cautioned that with the mostly non-Iraqi IS militants dug in among thousands of civilians and likely to fight to the death, the battle ahead remained challenging.

CTS Major General Maan al-Saadi told Reuters it could take at least four to five days of fighting to capture the last handful of neighborhoods along the banks of the Tigris River, defended by about 200 militants.

“The advance continues to Midan neighborhood,” he said. “Controlling it means we have reached the Tigris River.”

The IS militants themselves denied the setbacks. The group, whose leader declared a caliphate over parts of Iraq and Syria three years ago, still occupies an area the size of Belgium across the two neighboring countries, according to one estimate.

The fall of Mosul would mark the effective end of the Iraqi half of the caliphate, although the group still controls territory west and south of the city, ruling over tens of thousands of people.

Its stronghold in Syria, Raqqa, is also under siege. U.S.-backed forces encircled the city after closing the militants’ last way out from the south, the Syrian Observatory for Human Rights monitoring group said. Islamic State forces launched a counter-attack on Friday..

DESPERATE CIVILIANS

The insurgent position in Mosul is several hundred meters wide and thousands of civilians are trapped there in harrowing conditions, with little food, water, medicine and no access to health services, according to those who managed to flee.

Those who escaped on Friday streamed through alleyways near the Grand al-Nuri Mosque, which Islamic State fighters blew up a week ago.

They scrambled over mounds of rubble in the street, carrying small children and helping the elderly across.

A Reuters correspondent saw smoke billowing over the riverside districts amid artillery blasts and burst of gunfire. Western troops from the U.S.-led coalition were helping with aerial surveillance and mortar fire, he said.

Iraqi Prime Minister Hailer al-Abadi declared the end of Islamic State’s caliphate -- which he called “a state of falsehoood” -- on Thursday after CTS units captured the ground of the ruined 850-year-old mosque.

It was from the mosque’s pulpit that Islamic State leader Abu Bakr al-Baghdadi declared his caliphate three years ago to the day.

The insurgents chose to blow it up rather than see their black flag taken down from its al-Hadba, or Hunchback, leaning minaret where it had been flying since June 2014.

The suffering of tens of thousands whose lives have been wrecked for having lost relatives, their homes or their businesses dampened feelings of victory.

Slideshow ( 16 images )

“I hear victory speeches on the radio but I cannot help feeling sad when you see people without homes and others fleeing with their children under the blazing sun,” said Mahmoud, a taxi driver in the eastern side of Mosul which was taken back from the militants in the first 100 days of the campaign.

GRINDING WARFARE

The symbolic victory of the Iraqi forces came after more than eight months of grinding urban warfare which has displaced 900,000 people, about half the city’s pre-war population, and killed thousands of civilians, according to aid organizations.

Islamic State’s weekly publication al-Nabaa, denying they were losing the battle for Mosul, said the Iraqi army had virtually collapsed and suffered 300 killed and wounded.

Slideshow ( 16 images )

“The epic battle of Mosul is one of the most important battles of Islam and its lessons will be applied in other confrontations, God willing,” read a headline.

A U.S.-led international coalition is providing air and ground support to the offensive, which army and federal police units are also taking part in, attacking from different directions.

“Tight alleyways with booby traps, civilians and ISIS fighters around every corner make the Iraqi security force’s advance extremely challenging,” coalition spokesman U.S. Army Colonel Ryan Dillon said.

Baghdadi’s speech from the Grand al-Nuri Mosque on July 4, 2014 was the first and only time he has revealed himself to the world.

He has left the fighting in Mosul to local commanders and is believed to be hiding on the Iraq-Syrian border, according to U.S. and Iraqi military sources.

The group has moved its remaining command and control structures to Mayadin, in eastern Syria, U.S. intelligence sources said last week, without indicating if Baghdadi was also hiding in the same area.

The secretive Islamic State leader has frequently been reported killed or wounded. Russia said on June 17 its forces might have killed him in an air strike in Syria. But Washington says it has no information to corroborate such reports and Iraqi officials have also been skeptical.

Graphic of Battle for Mosul tmsnrt.rs/2rEoDr4