BERLIN — Bint Dahlia was 33 when she left Germany with her husband and children to start life in the Islamic State’s newly declared caliphate.

She is one of thousands of Europeans who did — and, five years later, one of hundreds trying to come back.

European governments have resisted repatriating their nationals since the caliphate crumbled. Leaders fear domestic attacks and public backlash and have argued that trials should take place regionally.

But now Europe’s hand is being forced. Although Turkey has said it is starting to deport people in its custody with suspected Islamic State links, even more significant are landmark court cases giving governments little choice.

Last week, an appeals court in Berlin ruled that the German government should repatriate Bint Dahlia alongside her three children from al-Hol, a squalid Kurdish-run camp inside Syria. (The woman’s real name was redacted in court documents shared with The Washington Post, and her relatives have asked that The Post use a family nickname for her safety.)

The camp’s conditions, the court determined, were life-threatening, and the children had a right to remain with their mother.

The lawyer for the case said he hopes it will set a precedent for 20 other German mothers and 40 children he represents.

“All the cases are quite similar,” attorney Dirk Schoenian said. The German government’s tactic until now has been to buy time, he said, and that is running out.

A ruling in the neighboring Netherlands likewise ordered the government to work to return 56 children from camps in Syria — and allow their mothers to return if that is necessary for the children’s repatriation. That ruling is open to appeal, but the court said it must act within two weeks regardless.

European governments “are fighting a losing battle,” said Andre Seebregts, a lawyer representing most of the women and children in the Dutch case.

“We have an acute problem now that needs to be taken care of now,” he said.

Estimates vary, but a minimum of 1,200 Europeans are held in camps in Syria, according to a recent study by the Brussels-based Egmont Institute. The majority are children, with Germans and French nationals making up by far the largest contingent. There are 124 German adults and 138 children, the study said.

Human rights advocates have deplored conditions in the camps, where food, clean water and medical assistance are in short supply.

Pressure on European governments to act intensified last month, as Turkey launched an offensive on Kurdish areas in Syria, sparking chaos that led to escapes from Kurdish-run camps.

Still, Schoenian said he expects German authorities to drag their feet for as long as they can, and he is preparing another case against the Foreign Ministry if it does not act.

His client, according to her mother-in-law, has been threatened in the camp since the verdict, with other detainees branding her an unbeliever for working in the Western court system. “I do not understand why the German government is just waiting and doing nothing,” the mother-in-law said.

The German Foreign Ministry said it is examining the decision and looking at how it can fulfill its legal obligations, but the security situation on the ground that presents logistical issues has not changed.

For European nations, the issue of returnees has presented a dilemma.

“No one wants to be responsible for bringing back someone that carries out an attack,” said Sofia Koller, a counterterrorism researcher with the German Council on Foreign Relations.

Countries maintain that they are concerned about the welfare of their citizens, especially the children born or raised in Islamic State territory, and about ensuring a fair judicial process.

But there is concern that security services will be lumbered with costly surveillance if there is insufficient evidence to charge returnees. In Germany, just having left for Islamic State territory does not constitute a crime.

The Kurds overseeing the camps have long pushed for European countries to take responsibility for their citizens. And the United States has added to the pressure, with President Trump repeatedly raising the issue in public.

Secretary of State Mike Pompeo emphasized the point on Thursday.

“Coalition members must take back the thousands of foreign terrorist fighters in custody and impose accountability for the atrocities they have perpetrated,” he said to foreign ministers assembled in Washington.

The United States has offered some countries help with retrieving their citizens. The ruling in the Netherlands has compelled the Dutch government to take up that offer.

A senior State Department official declined to provide any details, in accordance with agency ground rules for briefing the news media, but said the situation with the Dutch is currently under discussion in “diplomatic channels.”

The official acknowledged that U.S. military flights have been used to repatriate the families of foreign fighters from Syria to their home countries. He said it was done on a case-by-case basis and the United States demanded assurances on how the repatriated people would be treated in the legal system.

“It’s not a blanket offer, but we’ve done it with a number of countries,” the official said.

He described the U.S. position as "to be as forward-leaning as possible" to see that the detainees are taken care of or put to justice. He characterized the lack of security in northeast Syria as a "ticking time bomb" for the approximately 10,000 detained foreign fighters and tens of thousands of family members, saying, "We don't want to put them at risk, for humanitarian and other counterterrorism reasons."

In addition to legal cases forcing European countries to act, this week Turkey also said it had begun deporting detainees with suspected Islamic State links that it separately holds, including German, French, U.S., Irish and Danish nationals.

German officials assured the public that all returnees would be investigated, but that the first groups had no links to the Islamic State.

A family of seven that was scheduled to be returned on Thursday also were not Islamic State returnees, said a German security official, who spoke on the condition of anonymity because he was not authorized to speak to the public. An additional two people expected to be returned on Friday escaped from Kurdish camps in Syria, he said.

Turkey says it currently holds 2,280 Islamic State members from 30 countries and intends to deport them all.

Turkish officials have said the deportations are being carried out in line with “international agreements.”

Germany says it cannot deny entry to its citizens if their identities can be verified. Fewer than 20 of those in Turkish custody are German, according to the German Foreign Office, though citizenship has not been definitively established in all of those cases.

The deportations have come amid an uptick in Turkish activity apparently aimed at showing resolve against the Islamic State.

A Turkish offensive into northern Syria last month was criticized, in part, because of the danger that it could lead to an Islamic State revival, as U.S. troops withdrew and Kurdish-led forces responsible for guarding detained militants were called away to the front lines.

Since then, Turkish authorities have publicized raids targeting militants within Turkey and said they have arrested hundreds of Islamic State members in Syria.

Turkey announced on Thursday that a U.S. citizen who had been stranded on the border with Greece since Monday after Turkey deported him there, but Greece denied him entry, will be returned to the United States.

Ankara also said it had begun deportation proceedings for a British national.

London’s Metropolitan Police reported arresting a 26-year-old man, who had flown from Turkey to Heathrow airport on Thursday, on suspicion of terrorism offices. The police described the arrest as “Syria-related.”

Britain has gone as far as stripping some of its nationals of citizenship to avoid allowing them back.

One of the Germans expected to return on Friday is a 27-year-old from Lower Saxony who was detained by the Turks after escaping from Ayn Issa camp in Syria in October, during the chaos of the Turkish offensive.

She contacted her sister when she reached the border with Turkey and told her that Free Syrian Army forces were handing her over to the Turks.

Her sister, who spoke on the condition of anonymity for security reasons, said she had told her family that she was going to Turkey to do an internship in 2014, before later turning up in Syria. Her lawyer said that he doesn’t believe German authorities have evidence of any crime being committed, and the security official said she will not be arrested on arrival.

Germany should have acted much sooner to ensure “controlled repatriation,” said Koller, the researcher. “Now we have to react.”

Mekhennet reported from Washington. Carol Morello in Washington, Luisa Beck in Berlin and Kareem Fahim in Istanbul contributed to this report.