FALLUJAH, Iraq - Clumps of hair from hastily shaven beards littered floors and filled wastebaskets in houses in the Iraqi city of Fallujah's western neighborhood, a dense block of low-rise homes that were the Islamic State militants' last stand before they largely fled, melting into the sprawling Anbar desert in the face of advancing Iraqi forces.

Iraqi officers said they bombed convoys of fleeing militants this week, destroying dozens of vehicles and purportedly killing scores of ISIS fighters.

But the way ISIS abandoned the long-held urban stronghold also underscores the group's ability to adapt and regroup, long after defeat on the battlefield.

In the city's Julan neighborhood, Iraqi Cpl. Sahar Najim kicked through the refuse of facial hair with his boot, saying that he has seen similar scenes in other cities and towns retaken from ISIS. As the militants realize they are losing, they quickly shave off their beards to disguise themselves and escape among fleeing civilians, he said.

Blow to organization

Losing Fallujah was a huge blow to the Sunni militant group, depriving it of bomb-making facilities, a safe haven for training recruits and sources of income through taxing the local population.

To the east, in the city's industrial neighborhood, dozens of car repair shops had been converted into car bomb factories. A garage advertising Toyota repairs was stocked with plastic jugs filled with chemicals.

Iraqi forces declared Fallujah liberated Sunday, after government troops routed the remaining ISIS fighters from the city's north and west under the close cover of U.S.-led coalition airstrikes. The battle, which began May 22, was the latest in a string of territorial defeats for ISIS in Iraq in the past year.

At the height of the group's power, in 2014, ISIS rendered nearly a third of the country out of government control, having blitzed across large swaths of the north and west and capturing Iraq's second-largest city of Mosul. Now, it's estimated to control only 14 percent of Iraqi territory, according to the office of Iraq's prime minister.

More than 500 ISIS fighters managed to flee Fallujah throughout the five-week offensive, an Iraqi officer told the Associated Press on Thursday. Earlier this year, more than 1,000 ISIS fighters were estimated to have fled the operation that retook Ramadi, the Anbar provincial capital.

Coalition officials initially estimated that only 500-700 ISIS fighters were inside Fallujah, but once the operation began, Iraqi officers said it quickly became evident there were many more. Iraqi Lt. Gen. Abdul Wahab al-Saadi gave an estimate of 3,000.

Some Iraqi officials say the haphazard method in which ISIS fled - in convoys traversing open desert where the militants were exposed to airstrikes - indicates the extremists are in their last throes and nearing total defeat.

Down, but not out

But mobilizing hundreds of fighters, just days after the declared fall of Fallujah shows ISIS exercises a significant degree of command and control, according to Nathaniel Rabkin, managing editor of Inside Iraqi Politics, a political risk newsletter.

"IS are masters at going to ground and living to fight another day," Rabkin said, adding that while the Iraqi military has learned to recapture towns and cities from ISIS, the extremists will be a threat once they go underground.

Hunting down ISIS forces who have gone into hiding, Rabkin said, "that is a more difficult challenge."