DIBIS, Iraq — The prisoners were taken to a waiting room in groups of four, and were told to stand facing the concrete wall, their noses almost touching it, their hands bound behind their backs.

More than a thousand prisoners determined to be Islamic State fighters passed through that room last week after they fled their crumbling Iraqi stronghold of Hawija. Instead of the martyrdom they had boasted was their only acceptable fate, they had voluntarily ended up here in the interrogation center of the Kurdish authorities in northern Iraq.

For an extremist group that has made its reputation on its ferociousness, with fighters who would always choose suicide over surrender, the fall of Hawija has been a notable turning point. The group has suffered a string of humiliating defeats in Iraq and Syria, but the number of its shock troops who turned themselves in at the center in Dibis was unusually large, more than 1,000 since last Sunday, according to Kurdish intelligence officials.

The fight for Mosul, Iraq’s second-largest city, took nine months, and by comparison, relatively few Islamic State fighters surrendered. Tal Afar fell next, and more quickly, in only 11 days. Some 500 fighters surrendered there.