HAWIJA, Iraq — The jubilant outpouring that erupted in the heart of Hawija on Friday, the day after Iraqi forces claimed victory there, celebrated more than the fact that the Islamic State militants had finally been routed from the city, their last major urban stronghold in Iraq.

For many of the Shiite Muslim militiamen, who sped through the streets in pickups, flying militia colors and blaring religious music on loudspeakers, and the federal paramilitary police, who feasted on mutton and rice, their swift two-week victory represented the beginning of the end for militants who just three years ago ruled a third of Iraq.

“Game over,” said Gen. Sabah al-Aboda of the Iraqi police, as he chewed a date in the shade of a collapsed storefront. “When they lost Mosul, they were broken.”

General Aboda and other officers said the militants had been badly led and poorly supplied since they were driven from Mosul, Iraq’s second-largest city, after a punishing nine-month battle that ended in July. They lost some of their best commanders and cadres, the commanders said, and their supply lines to Syria were cut by Iraqi forces.