In the last two weeks, thousands of people have been streaming out of the village of Baghuz, the last speck of land under Islamic State control in Iraq and Syria, an area where the group once ruled a dominion the size of Britain.

That state is all but gone. In the last month, the group went from holding three villages to two to just one.

The militants are now trapped in an area about the size of Central Park.

To the west, they are hemmed in by Syrian government forces. To the south is the Iraqi border, where Iraqi troops are holding the line. From the north and east, they are being fought by an American-backed Kurdish and Arab militia known as the Syrian Democratic Forces.

As the noose has tightened, even those who joined the caliphate in its earliest days are trying to save themselves.

Most of those who have made it to this spot in the desert in recent days are the families of the militants — their multiple wives and numerous children — with only a small number of locals originally from the area mixed in, Kurdish officials said.