MOSUL (Reuters) - Islamic State militants shelled areas recaptured by Iraqi forces in western Mosul, hitting civilians fleeing the fighting early on Wednesday as troops edged their way through the narrow, dangerous streets of the Old City.

Heavy mortar fire killed at least five civilians and wounded more than 20 in Mosul Jadida and Rifak districts - areas that the militants had recently lost to Federal Police and Rapid Response brigades, military officials said.

The battle for Mosul, Islamic State’s last stronghold in Iraq, is entering its sixth month with Iraq forces backed by a U.S.-led coalition air strikes and advisers now controlling the east of the city and more than half of the west.

Fighting is focused on capturing the strategic Al Nuri mosque in the Old City, where Islamic State leader Abu Bakr al—Baghdadi declared his caliphate in July 2014 after the militants had seized large areas of Iraq and Syria.

As many as 600,000 civilians remain in the western sector of Mosul, complicating the battle. Thousands escape daily to camps or areas in the government-controlled east.

Baghdadi and other leaders are believed to have left Mosul, but Islamic State fighters are countering with snipers hiding among the population, car bombs and armored suicide trucks smashing into Iraqi positions around the Old City.

“Daesh shelled liberated, populated areas to distract our troops. They have wounded dozens,” a federal police spokesman said.

Slideshow ( 2 images )

At federal police frontlines near the Old City, forces blocked off roads with earthen barricades to stop suicide car bombers reaching their troops. Tanks and rocket teams stood guard at barricades while troops with RPGs manned rooftops.

“We are clearing streets and buildings of booby-traps and roadside bombs,” a federal police officer said.

On another front, Counter Terrorism Service forces advanced in Yabsaat district and the old industrial area in the west of the city, Maan al-Saadi, a CTS officer told state television.

Losing Mosul would be a symbolic blow for Islamic State whose forces are also coming under attack in the Syrian city of Raqqa across the border.

Aid agencies are rushing to cope with surging numbers of displaced from the west, building new camps and supplying food and water. The number displaced from both sides of Mosul since the start of the offensive has reached 355,000, according to government figures.

U.S. officials estimate around 2,000 fighters remain inside the city.