AL-HUD, IRAQ - The mutilated bodies of Islamic State group fighters were still strewn on the ground of this northern Iraqi town Wednesday. One was burned. Another’s face was flattened.

Iraqi troops on the march toward Mosul moved into al-Hud a day earlier and declared it liberated. The residents, they found, had risen up and killed many of the militants in the town themselves.

With the offensive to recapture Mosul in its third day, Iraqi forces advancing from the south and east are fighting to retake the towns and villages that dot the plains and line the Tigris River leading to the city. At times, they’ve met fierce resistance, with the militants sending explosives-packed vehicles careening toward the troops’ positions.

This area has been under the control of the militants since the summer of 2014, when IS fighters captured Mosul and much of the north in a lightning advance.

Iraqi army soldiers celebrate on the outskirts of Iraqi army soldiers celebrate on the outskirts of Qayyarah, Iraq, Oct. 19, 2016. When troops arrived at a nearby village, they found the residents had risen up and killed Islamic State fighters. Iraqi army soldiers celebrate on the outskirts of Qayyarah, Iraq, Oct. 19, 2016. When troops arrived at a nearby village, they found the residents had risen up and killed Islamic State fighters.

Residents see their chance

In al-Hud, a Sunni Arab town on the Tigris, residents saw their chance to get rid of them. On Monday, a man paraded through town with an Iraqi flag in a show of defiance, residents told The Associated Press. IS fighters shot and killed him.

The news spread among the hundreds of people living in the town, and soon a crowd turned on the militants.

One resident, Ahmed Mohammed, said he and others shot a militant who was hiding by an outhouse behind a shop.

“That didn’t work,” he said. “Then one of our guys came and threw a grenade on him from the top.”

Gasim Mohammed said his father was killed in the uprising against the militants. He kicked the head of one of the bodies.

“This one smells like a dog,” he said. “I hate them. Anyone I catch, I’ll drink his blood. Even if it’s a child.”

It was not clear how many militants had been in the village or how many were killed. The Associated Press saw at least five bodies.

The head of the Iraqi military’s operations command for Nineveh province, where the offensive is taking place, confirmed the residents’ account.

“Before we reached the village, they fought them and killed many of them,” Maj. Gen. Najim al-Jobori said.

On Wednesday, residents were celebrating. Children ran toward an Iraqi military convoy waving peace signs while others threw stones at the bodies of the dead IS fighters. Residents fired celebratory rounds into the air, and cars along the main road still flew white flags of surrender.

The Commander of the Joint Military Operation Com The Commander of the Joint Military Operation Commander, Army Lt. Gen. Talib Shaghati, called on Iraqis fighting for the Islamic State group in Mosul to surrender, Oct. 19, 2016. The Commander of the Joint Military Operation Commander, Army Lt. Gen. Talib Shaghati, called on Iraqis fighting for the Islamic State group in Mosul to surrender, Oct. 19, 2016.

IS urged to surrender

At Qayyarah air base, near al-Hud, a senior Iraqi general called on Islamic State group fighters in Mosul to surrender. Lt. Gen. Talib Shaghati told reporters that up to 6,000 IS fighters are in the city.

East of Mosul, troops have moved about a kilometer (half-mile) from Hamdaniyah, a historically Christian town also known as Bakhdida, to the east of Mosul, an Iraqi officer from the 9th Division told the AP.

Over the past day, IS sent 12 car bombs against the troops, all of which were blown up before reaching their targets, he said, adding that Iraqi troops suffered a small number of casualties from the mortar rounds. The officer, who spoke on condition of anonymity because he was not authorized to talk to reporters, did not provide specific figures.

FILE - Workers set up a camp for displaced Iraqis FILE - Workers set up a camp for displaced Iraqis in Khazer, Iraq, Oct. 19, 2016. More than 25,000 troops have mobilized for the fight to free Mosul, Iraq's second largest city and the largest urban area controlled by the Islamic State militants. FILE - Workers set up a camp for displaced Iraqis in Khazer, Iraq, Oct. 19, 2016. More than 25,000 troops have mobilized for the fight to free Mosul, Iraq's second largest city and the largest urban area controlled by the Islamic State militants.

Thousands flee

At least 5,000 people fled the Mosul area to a refugee camp in northeastern Syria in the last 10 days, with another thousand waiting to enter at the border, Save the Children said.

Tarik Kadir, head of the group’s Mosul response, said conditions there are “among the worst we’ve seen.” More than 9,000 people in the camp only have access to dirty, untreated water and have to share 16 latrines, leaving the area polluted by human waste “with a looming risk of disease,” the group said.

U.N. humanitarian chief Stephen O’Brien told the U.N. Security Council that no large-scale displacement of civilians has been reported since the operation began.

But he said the U.N. anticipates “some 200,000 people over the coming weeks, with up to 1 million displaced in the course of the operation in a worst-case scenario.”