Almost all on board heavily-guarded convoy were families who had escaped ISIL-held territory.

Two roadside bombs struck a convoy carrying Iraqi families fleeing an ISIL-controlled town in the north of the country late on Friday, killing at least 18 people, a police officer said.

The bombs targeted a truck carrying people from Hawija, about 120kms south of ISIL’s stronghold in Mosul, as they were being taken to the town of Al Alam, next to the River Tigris.

Seventeen of the dead were from the displaced families, regional police Colonel Nemaa al-Jabouri told the Reuters news agency. One policeman in an accompanying patrol car was also killed.

READ MORE: Is it wrong to call Mosul battle a ‘liberation’?

Pictures published on social media by a group linked to Iraq’s defence ministry showed several blackened corpses next to the twisted wreckage of the lorry.

“The victims were being transported there by Iraqi armed services, so even though they felt they were safe in this convoy, they were still attacked,” said Al Jazeera’s Mohammed Jamjoom, reporting from Khazir, north of Mosul, at a camp site for people fleeing the fighting.

The Islamic State of Iraq and the Levant ISIL group, also known as ISIS, took control of Mosul in 2014.

Last month, two years later, Iraqi troops and special forces, Shia militias, Kurdish Peshmerga fighters and other groups backed by US-led air raids launched a campaign to retake the city.

READ MORE: Can Mosul survive ISIL?

The attack on the convoy came as Iraqi special forces cleared buildings on Saturday in neighborhoods they entered in eastern Mosul a day before, after pushing out ISIL fighters.

Fighting continued in the morning, with both sides firing mortars and automatic weapons at each other’s positions, while Iraqi troops also responded with artillery.

Clashes were most intense in the al-Bakr neighbourhood. Sniper duels played out from rooftops in the mostly residential areas, where the majority of buildings are two stories high.

“[ISIL] is in the city centre and we must be very careful as our forces advance,” said Major General Sami al-Aridi of the Iraqi special forces.

With more densely packed neighbourhoods ahead, his forces will be challenged to avoid both higher military and civilian casualties.

As he spoke, dozens of civilians in the Tahrir and Zahara districts emerged from their homes, some of them carrying white flags, and headed towards the troops to be evacuated from the battlefield.