Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

OUTSIDE BAGHOUZ, Syria — They were living in holes in the ground, with only dry flatbread to eat at the end. Those injured in an intense military campaign had no access to medical care, and those who were sick had no medicine.

Yet, if it were not for the call from their leaders to leave, they would have stayed.

Such is the devotion of several hundred men, women and children who were evacuated Friday from the last speck of land controlled by the Islamic State group, a riverside pocket that sits on the edge of Syria and Iraq. Hundreds, if not thousands, more remain holed up in Baghouz.

They include militants, of course, but also their family members and other civilians who are among the group's most determined supporters. Many of them traveled to Syria from all over the world. And they stuck around as the militants' control crumbled.

At least 36 flatbed trucks carried the disheveled, haggard crowd out of the territory to a desert area miles away for screening following airstrikes and clashes.

The civilians are expected to be sent to a displaced people's camp, while suspected fighters will go to detention facilities. Previous evacuations have already overwhelmed camps in northern Syria, and at least 60 people who left the shrinking territory have died of malnutrition or exhaustion.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

The evacuees included French, Polish, Chinese, Bengali, Egyptians, Tajiks, Moroccans, Iraqis and Syrians.

It is impossible to know if all are wholeheartedly behind the militant group or how many expressed support out of fear of reprisals. But many vehemently defended ISIS, arguing the group was down — but not out — and said they only left because of an order from the remaining religious leader in the area.

All those interviewed gave nicknames or spoke on condition of anonymity because they feared for their safety.

"Baghouz maybe is the most difficult moments of all my life," said 21-year-old Um Youssef, a Tunisian-French woman who came to Syria at 17 with her mother. "I didn't make Hirjah (migration) for the food, or for the good life. It is jihad (holy war) for the sake of God."

She said she had no regrets and was at "peace," describing the last few weeks as "the best" since she moved to Syria because they taught her life lessons.

Women and children who fled the Islamic State's last embattled holdout of Baghouz, Syria wait to evacuate the area on Feb. 22. DELIL SOULEIMAN / AFP - Getty Images

It was hard to see how that could be. A four-year international campaign has reduced the self-proclaimed caliphate — which once sprawled over nearly a third of Syria and Iraq — to a tent encampment and a few homes.

An estimated 300 militants are besieged there. The presence of so many civilians has surprised the U.S-backed Syrian Democratic Forces (SDF) and slowed down the expected announcement of the extremist group's territorial defeat.

Recapturing Baghouz would mark an end to the militants' territorial rule, but few believe that will end the threat posed by an organization that still stages and inspires attacks through sleeper cells in both Syria and Iraq. The group also has a presence online, using social media to recruit new members and promote its attacks.

In the past few weeks, nearly 20,000 people have left Baghouz on foot through the humanitarian corridor.

In the dusty clearing where the evacuees were being screened Friday, a 16-year-old mother of two from Aleppo said she has not had food for a couple of days, opting to feed her children instead.

But of over a dozen people interviewed by The Associated Press, only four said they didn't want to be in Baghouz.

"Order or no order, I wanted to get out," said Aya Ibrahim, an Iraqi mother who said she was unable to secure medicine for her children. "Many families died from airstrikes. Many kids died from hunger."

Food prices have been soaring. About 2 pounds of sugar went for nearly 30,000 Liras or $70, more than 30 times the price in other parts of Syria, while a quarter-gallon of cooking oil cost $23.

For some, the order to leave is not the end.

"Islamic State is over? Says who?" asked a 14-year-old Syrian girl who refused to give her name. "Wherever you go there is Islamic State."