Western countries are scrambling to figure out what to do with the thousands of their citizens who joined the Islamic State, as the militant group loses the last of its territory in Syria and a U.S. military pullout puts pressure on the camps where many have been living.

In public, many countries appear to be doing their best to avoid taking back former fighters and their families. Although President Trump has insisted that Europe repatriate its fighters, the United States is contesting the citizenship of a New Jersey-born woman who wants to return home. Britain said it was stripping the citizenship of a 19-year-old from London who fled four years ago to become an “ISIS bride.” Belgium is appealing a court order that it repatriate six children and their Islamic State mothers.

But some governments have begun quietly exploring what would be involved in retrieving their nationals. Even when the political will is there, officials are confronting a thorn-studded array of diplomatic and practical issues. Here are a few. 

The problem of negotiating with the Kurds

Many of the former Islamic State sympathizers are in prison or refu­gee camps in northeastern Syria operated by Syrian Democratic Forces, a militia dominated by Kurds. But the militia isn’t an internationally recognized authority. And negotiating with the Kurds is a sure way to anger Turkey, which fears Kurdish separatism inside its borders and doesn’t like other countries giving Kurds legitimacy. So countries have to keep their discussions with Kurdish forces inside Syria quiet.

The problem of transit through Turkey

Because Turkey doesn’t like the Kurds and doesn’t recognize Kurdish authorities, governments can’t bring their citizens directly into Turkey from Kurdish-controlled Syria. Even with foreign military or diplomats serving as escorts, Turkey would resist. It’s still possible for people to be smuggled into Turkey. But national governments can’t contract with smugglers. And there would need to be an extradition process from Turkey to the fighters’ home countries. Could enough money channeled toward Ankara solve the problem? Sometimes money can lubricate diplomacy — but then European and U.S. leaders would face the politically unpalatable prospect of paying significant sums to bring back their citizens.

The problem of transit through Iraq

The other obvious route out of northeastern Syria would be through Iraq. That’s the route Russia has opted for, organizing flights to Chechnya for women and children from the Islamic State. The repatriations were initiated by Chechen strongman Ramzan Kadyrov — and have drawn praise from human rights advocates who typically criticize Kadyrov for his violent approach to political opponents, gays and lesbians, journalists and others who don’t fit with his vision for the autonomous Chechen Republic in Russia. “Russia has actually been proactive about approaching Iraqi authorities,” said Gina Vale of the London-based International Center for the Study of Radicalization.

But European officials say transporting their nationals through Iraq would raise a whole set of issues. They say Kurdish authorities in Syria and Kurdish authorities in Iraq don’t work very well with each other, so there would be practical challenges. Additionally, while the Iraqi government may have been okay with a couple dozen Russian citizens, it is not super enthusiastic about thousands of people who are potentially still radicalized coming over the border. A further issue for European countries is that Iraq has the death penalty, and the European Union, which bans the practice, has strict rules about exposing its citizens to charges in foreign countries where capital punishment is a possible penalty.

The problem of talking to Assad

Some governments are contemplating discussions with Syrian President Bashar al-Assad, according to officials familiar with the conversations. That would be a little awkward, since Assad is on the other side of the fight and Western nations blame him for an eight-year conflict that has claimed hundreds of thousands of lives and displaced millions. Still, he has declared himself an opponent of the Islamic State, and it’s possible that he would allow the former caliphate residents out of Syria — for a price.

But how do Western countries, most of whom have cut off diplomatic relations with Syria, even carry out a conversation with Assad? And how can they guarantee the safety of their citizens in and out of the conflict zone? Journalists and aid workers have been able to get in and out of the camps in the Kurdish-controlled northeast of Syria, but official delegations face diplomatic barriers, and trickier consequences, when they cross frontiers without permissions.

The problem of holding people accountable

One of the greatest fears among European leaders is that they will repatriate people who pose a security threat, only to find that prosecutors don’t have enough evidence to convict and imprison them. Distinguishing who fought for the Islamic State and who was merely a bystander may be difficult in many cases.

Kurdish officials have said they don’t have the resources to conduct trials in their camps. Some European leaders favor establishing an international tribunal on the ground in Syria or Iraq. Belgian Prime Minister Charles Michel has called for such a court and plans to discuss it with fellow heads of state this weekend at a summit of E.U. and African leaders in Egypt. Belgian officials suggested that the U.S. decision publicized Thursday to leave a skeleton force of troops in northeast Syria might help support international trials. But whose law would apply? U.S. penalties for membership in the Islamic State, for instance, are far steeper than in Belgium, which imposes only a five-year prison sentence.

Some Belgian officials are privately skeptical of the idea of a tribunal, saying it might be more of a delaying tactic on the part of their leadership more than a realistic proposal. And there would still be the question of where people would go once they were convicted or released.