Hundreds of Iraqi civilians were being transported to camps for displaced people on Saturday after they fled areas of eastern Mosul which the army had recently captured from Islamic State.
The militants have stepped up counter-attacks on the Iraqi forces in eastern Mosul.
Men, women and children were screened by the security forces in the nearby town of Bartella before being transported to camps on the outskirts of the Kurdish city of Erbil.
An official said the nearly 400 people were from the Samah, Intisar and al-Quds neighborhoods in eastern Mosul.
With cloudy skies hampering air surveillance, Islamic State militants carried out attacks in the districts of al-Quds, Ta'mim and al-Nur last week, residents and security officials said.
Every time Iraqi forces capture a section of Mosul in their offensive against Islamic State, it can take up to a week to ensure it is clear of militants.
Some militants hide in the network of tunnels they have constructed, while others mix with thousands of displaced people or stay behind to form sleeper cells in the crowded neighbourhoods of Mosul, a city of more than one million people.
Residents who had fled said the situation was dire, with their supplies running out.
Iraqi security officials say they have seized nearly a quarter of eastern Mosul.
For more details, watch the full report in the video above