TAL AFAR, Iraq - Iraqi forces advanced Wednesday towards central Tal Afar, one of the Islamic State group's last strongholds in the country, as aid workers braced for an exodus of civilians fleeing the fighting.

Armoured personnel carriers full of soldiers and fighters of the Hashed al-Shaabi paramilitary coalition moved into Al-Nur district early in the morning as warplanes flew overhead, said an AFP photographer on the ground.

They encountered trucks parked across roads with earthen embankments aimed at stopping them, as well as sniper fire and mortar shelling.

Six weeks after routing the militants from Iraq's second city Mosul, the Iraqi forces launched an assault Sunday on Tal Afar, where an estimated 1,000 militants are holed up.

They retook three first districts of the city on Tuesday, but as with the gruelling nine-month campaign to recapture Mosul, their convoys face an onslaught of suicide and car bomb attacks.

On Wednesday they "entered the neighbourhood of Al-Kifah North... and headed towards the centre of the city," said Ahmed al-Assadi, spokesman for the Hashed al-Shaabi paramilitary coalition fighting IS alongside the army and police.

"All the lines of IS defence outside the city have been broken and the troops are advancing from all directions towards the inner quarters of the city," he added.

As they advanced, troops said they discovered a network of underground tunnels used by the militants to launch attacks behind lines of already conquered territory, or to escape.

In a bid to counter these surprise attacks, the Iraqis dropped leaflets overnight calling on civilians to help by marking houses where the militants are located.

The International Organization for Migration said "thousands of civilians" had fled Tal Afar since the offensive began. But around 30,000 civilians are trapped in the fighting, according to the United Nations.

Caught between the two sides, those still inside the city have been pounded by Iraqi and US-led coalition aircraft for weeks, as well as intense artillery fire since Sunday.

The UN refugee agency (UNHCR) fears they could be "used as human shields" and that "attempts to flee could result in executions and shootings," said the spokesman for UN Secretary General Antonio Guterres.

The United Nations and aid agencies are working to establish shelters for the displaced.

Those who flee through desert areas face temperatures of up to 43 degrees Celsius (109 Fahrenheit), sometimes for periods of more than 10 hours, putting them at risk of dehydration, said Viren Falcao of the Danish Refugee Council.

Tal Afar was once a key supply hub for IS between Mosul - which lies around 70 kilometres (45 miles) to the east - and the Syrian border.

The Iraqi forces massed around Tal Afar on Tuesday before the militants responded with artillery fire.

Army, police and of the Hashed al-Shaabi paramilitary coalition later took "full control" of the Al-Kifah, Al-Nur and Al-Askari districts, the Hashed said

The Iraqi forces had encircled the city despite what Hashed spokesman Assadi called "intense" fighting. He said the battle for the city would probably last weeks, in contrast to the months-long battle for Mosul.

After meeting Iraqi Prime Minister Haider al-Abadi in Baghdad on Tuesday, US Defence Secretary Jim Mattis said the militants were "on the run".

"Cities have been liberated, people freed from ISIS, from Daesh," Mattis said, using alternative names for IS.

The militants had not been able "to stand up to our team in combat, and they have not retaken one inch of ground that they lost," he said.

Mattis declined to make any predictions about the battle.

"ISIS's days are certainly numbered, but it's not over yet and it's not going to be over anytime soon," he said.

At the time, its population of around 200,000 was overwhelmingly Turkmen, one of Iraq's largest ethnic minorities.