Three men — the middle one a suspected ISIS fighter — are detained in a basement by Iraqi forces. Felipe Dana/Associated Press

When US-backed Iraqi security forces and Iranian Shia militias cleared ISIS' final Iraqi stronghold in Hawijah, they met weak resistance and a massive surrender from a once fearsome army.

In 2015 and 2016, ISIS, the terrorist group also known as the Islamic State, carried out suicide attacks around the globe at a historic rate.

The group, founded in June 2014, has long demanded that its militants fight or die, and it often sends young men and even children on suicide-bombing missions.

But as the group weakens on the ground, it seems to have shifted course.

A US Department of Defense release on the battle for Hawijah cites "many sources reporting more than 1,000 terrorists surrendered."

Unlike the battle for Mosul, once ISIS' largest Iraqi stronghold, the terrorist group "put up no fight at all, other than planting bombs and booby traps," Kurdish officials told The New York Times.

Strikingly, the same officials reported that ISIS commanders had ordered their fighters to turn themselves in, on the grounds that the Kurds would take prisoners while other opponents would be harsher.

Indeed, after three years of brutal conflict, the Iraqi Security Forces fighting have admitted to engaging in acts of savagery against defeated ISIS fighters.

In July, Iraqi officers said they took part in extrajudicial killings of many unarmed ISIS fighters, with one vowing a "slow death" as revenge for killing his father.

ISIS territory in Iraq and Syria as of this month. Live UA Map

After suffering defeat after defeat on the ground, ISIS has upped the aggression of its media operation in an attempt to save face. Recently the group released audio it said came from its top leader, Abu Bakr al-Baghdadi, who was rumored to be killed or at least injured by airstrikes.

After last week's shooting in Las Vegas, the deadliest mass shooting in modern US history, ISIS also made the dubious claim that the gunman was one of its followers.

US officials have shot this claim down, and ISIS' claims do not match evidence that has since emerged on the gunman's preparation for the attack.

An Iraqi Shi'ite fighter firing artillery during clashes with Islamic State militants near Fallujah, Iraq. Thomson Reuters

In its early months and years, ISIS enjoyed a surge of battlefield victories. The group had political support in Sunni Muslim areas, where many felt disenfranchised by Iraq's Shia-run government.

But it has since been ground down for years by US-led coalition airstrikes and a wide range of militias and national armies on the ground.

With the fall of Hawijah, only a small strip of territory along Syria's border remains in ISIS' control.