BEIRUT — Fleeing terror in the Islamic State’s last Syrian strongholds, tens of thousands of civilians have become stranded in harrowing conditions across barely functional displacement camps.

As the militant group’s grip in Syria crumbles and U.S.-backed forces push through its de facto capital, Raqqa, about 40 camps across the country’s northwest host between 2,000 and 10,000 people, with more arriving every day.

For one young couple escaping Raqqa, the journey to a displacement camp took more than 10 hours on foot through 110-degree heat. For those with larger families — many carrying infants or parents on their backs — the journey stretched to weeks.

“Conditions are very shocking,” said Ingy Sedky, a spokeswoman for the International Committee of the Red Cross. “Some of the worst I’ve seen.”

On arrival, newcomers in some camps said they found neither a place to sleep nor a doctor to assess their needs. They were depleted from days of dehydration on top of months of fear under Islamic State rule.

“I arrived and I just fell down. The water they revived me with was dark with oil, so I just lay there on the ground exhausted and humiliated,” said one woman who arrived in the eastern al-Arisha camp on Thursday. She asked that her name be withheld out of concern for her husband’s safety in an Islamic State prison in the western province of Deir al-Zour.

Aid workers say that at least some of the nearby camps are without basic medical services. Water is limited as temperatures soar and few have electricity or toilets. The consequences can be deadly.

On a recent visit to the largest camp, Ain Issa, Sedky’s delegation met a father whose newborn had died because of a lack of medical care in the heat. “It was heartbreaking. He kept pulling out his phone to show us photographs,” she said.

Children wait for their families to be processed in a transfer tent after arriving at the Ain Issa camp in July. Hundreds of thousands of Syrians have been displaced from Raqqa. (Hussein Malla/AP)

More than 200,000 people have fled Raqqa since April as a U.S.-backed offensive edged first through the surrounding countryside and then toward the city center. Tens of thousands have also fled the area around Deir al-Zour, where the U.S.-led coalition is launching heavy airstrikes and Syrian-backed forces are pushing through the province’s western countryside.

To reach the larger and better-equipped displacement camps, the new arrivals often move first through what are known as transit points — camps where Kurdish fighters from the U.S.-backed Syrian Democratic Forces attempt to screen out Islamic State militants by confiscating identification cards.

Aid workers say the process is chaotic and confusing. When newcomers arrive with little more than the clothes on their backs, they can be stranded for weeks without explanation.

Muhammed, a 29-year-old from the western Deir al-Zourcountryside who asked that his second name not be used because of safety concerns, said he slept in the open air at the al-Karama camp for four days as his documents were checked.

Doctors express particular concern for the psychological welfare of children who have escaped. “Their faces are just frozen. They don’t cry, they don’t laugh. It’s a shocking thing to witness,” said Rajia Sharhan, a pediatrician with the United Nations’ children’s agency, UNICEF.

According to Doctors Without Borders, some civilians have spent weeks nursing battle wounds behind front lines. Escapees and activists still living under Islamic State rule report that services have deteriorated as the group’s finance sources dry up and U.S.-led coalition combing raids hit vital infrastructure, including hospitals.

Inside Islamic State-held Raqqa and Deir al-Zour, food prices are rising rapidly, leaving many families with little to survive on. Escape often depends on a smuggler charging hundreds, if not thousands, of dollars, a price that depletes resources to a level that means those who flee often have little left.

“The people who end up in these camps have done so because they have no choice,” said Vanessa Cramond, the northern Syria coordinator for Doctors Without Borders. “The challenge is big enough when we’re treating people arriving during the summer months. We’re really struggling to meet needs now and I fear for what lies ahead when the temperatures drop.”

People walk the dusty corridors of the Ain Issa camp. (Hussein Malla/AP)