GISMA, Iraq — The convoy rumbles through this village along the dusty road that has taken it across the Tigris and to the fraying edges of the Islamic State.

We are now about 60 kilometers, or 40 miles, from Mosul, captured by ISIS in 2014 and by far the biggest city under its control.

By the roadside, children flash broad smiles and wave at the dozen or so Humvees and U.S.-made pick-up trucks bristling with machine guns of all calibers. The line of vehicles swerves past the charred hulk of a burned-out armored personnel carrier before taking a sharp turn and slowly pulling into a walled compound.

The village, Gisma, was retaken from ISIS the previous day, as Iraqi security forces inch towards Mosul, once second most populous city in the country and still in the hands of the jihadist group.

Earlier this week, U.S. President Barack Obama met with Iraqi Prime Minister Haider al-Abadi and declared the fight to retake Mosul could “move forward fairly rapidly.” But that conversation was in New York. The test will come in places like this.

Today, Maj. Gen. Najim al Jabouri, one of the key commanders of the campaign, decided to pay Gisma a visit, dropping in for lunch at the invitation of the villagers.

Stepping out of his Humvee, the general is greeted warmly by the village elders, who usher him into a house where he takes the seat of honor at the head the dining room. Soon, groups of officers and elders sit around huge tin trays laden with meat, flatbread and bulgur wheat. Several sheep have been slaughtered in the morning, an incredible act of hospitality in a village suffering severe shortages after more than two years of ISIS rule.

After months and years of Islamic State terror, the once maligned Iraqi army is welcomed in the Sunni areas near Mosul—at least by those who did not actively join the ranks of the insurgents.

"It’s an honor to receive the army here, because they are our people,” Hamed, the host, tells the Daily Beast. “We were living in darkness, and now the darkness is gone."

When ISIS stormed across the Syrian border to conquer about a third of Iraq in 2014, it was aided by widespread discontent amongst the Sunni population. For years, at least since the American forces in Iraq began to draw down, the Shia-led government in Baghdad had marginalized and discriminated against the Sunni minority, and even sent in the army to shoot up peaceful protests.

In Mosul, the Shia-dominated army was seen as little more than a hostile army of occupation.

But the Islamic State's cruel fanaticism quickly alienated many of those who initially welcomed the insurgents.

In Gisma, everyone has a story to tell about ISIS brutality. Jamal, the septuagenarian head of a 40-strong family, mourns the murder of one of his sons, a police officer. After coming to the village, the jihadists "took him away and sent us a message telling us that they had killed him," says Jamal. Another son, also a police officer, barely escaped with his life by fleeing to the town of Beiji.

Munder, a 14-year-old with a slight frame and bright blue eyes, recounts how ISIS butchered one of the villagers.

"They killed the man and poured gasoline over him so the dogs wouldn’t eat him. They paraded his body around the village on the back of a pick up," he says in disgust.

Gen. Jubouri is keen to build on the present goodwill towards the army and police forces. It is a key reason he is in Gisma today, even as mortar rounds from nearby ISIS positions continue to land in the village.

A Sunni himself, he served as the mayor of the town of Tel Afar during the U.S. occupation of Iraq, working alongside the Americans to expel al Qaeda from the city that is now under the control of ISIS, originally a spin-off of al Qaeda in Iraq.

When the death threats against al Jubouri and his family mounted, he fled to the United States before returning to Iraq to continue the fight against Islamist extremism.

"Up to now, the relationship between the security forces and the people south of Mosul is very good," he says. "We will try and continue to build bridges between the security forces and the people."

That had better work. If the local population in and around Mosul decides to reject the army, then recapturing Iraq's second largest city will be a near impossible task, Al Jubouri believes. But if Mosul's inhabitants turn on the insurgents, the few thousand fighters holding the city will quickly be isolated.

In other towns and villages near Mosul recently liberated from ISIS, Iraqi troops have been well received by the locals just as they were here in Gisma. Under Jubouri's command, soldiers have been keen to avoid civilian casualties, and to treat the population with respect.

But Jubouri's efforts could be in vain if Shia sectarian militia groups join the battle for Mosul. These militias are known as the Popular Mobilization Forces, or PMF, and many them are directly supported by Iran. They have made a valuable contribution beating back ISIS, but also have a track record of killing and torturing Sunni civilians in areas where they operate. Al Abadi’s weak government in Baghdad has only limited control.

Many experts believe that throwing the Shia militia into the battle for Mosul would play into the hands of the Islamic State, as fearful residents would rally around the ISIS fighters. Deploying the PMF would lead to a "sectarian polarization that makes ISIS appear as the least worst option for Sunnis," says Kyle Orton, a Research fellow with the Henry Jackson Society.

Jubouri is guarded when we ask about Shia militia involvement in the Mosul campaign. "I don't know," is his answer as to whether the PMF should take part. "Not all the PMF are bad people," he says.

Even if the Shia militias stay away, the Iraqis that joined ISIS will fight with the desperation of those who have nothing to lose. The villagers of Gisma are furious at the locals who threw in their lot with the insurgents, and who fled with the retreating jihadists.

"Those who joined Daesh cannot come back,” says Hamed, using the Arabic acronym for ISIS. “Their houses will be razed to the ground. What they did to the people is going to happen to them."

Hamed estimates that between 30 and 50 men from the village of around 5,000 souls sided with the Islamic State. There will be no mercy for their families either.

"They can't stay here, because they didn't stop their sons from joining Daesh," he says.

While al Jubouri lunches with the villagers, the men who took the village patrol the streets and guard the compound. Two members of the SWAT police unit that fought its way into Gisma a day earlier stand in the courtyard, their black uniforms and battered Kalashnikovs setting them apart from Jubouri's lavishly equipped security detachment.

The men, Ali and Yasser, say they fought for three hours to retake the village, during which ISIS launched four suicide car bombs against them.

The two are veterans of the struggle against jihadist groups, having battled a string of militants since the U.S. invasion in 2003 kicked off a brutal insurgency in Iraq.

"Al Qaeda, Jaish al Mujahideen, Daesh, we've fought them all," Yasser says wearily.

Their unit hails from Mosul, and was the last to withdraw when ISIS routed the army in the city in 2014, resisting until they were ordered to pull out, according to Ali. To break their defenses, the jihadists drove trucks filled with explosives into their lines.

Since then, they have been deployed across Iraq to first halt and then push back the insurgents. After campaigning in nearby Salahaddin province, they were part of the force that took Qayyarah airbase, were U.S. Marines and Special Forces are helping prepare for the final push on Mosul. (And where ISIS reportedly launched a rocket or artillery shell on Tuesday that contained mustard gas.)

After a string of victories, the morale within the SWAT unit is high. Many have family members in the Mosul, and they are keen to avenge their humiliation two years ago.

"Soon we will return," says Yasser.