PRESIDENT TRUMP’S hypocrisy seldom comes packaged in such a neat bundle as it did recently when he insisted that European governments “take back” hundreds of their citizens captured while fighting for the Islamic State. Five days later, he proudly asserted the United States refuses to do the same in the case of an American woman who married three Islamic State fighters and is now in custody in Syria.

In fairness to the president, he is not alone in struggling to balance the competing demands of security, international law and morality in this matter.

Security argues against repatriating former fighters, who present a credible threat — whether as potential terrorists if free, or as agents of radicalization in prisons on their home soil if prosecuted and convicted. International law and morality suggest that nations have a responsibility to their own citizens, who cannot be cavalierly rendered stateless and thereby foisted on to someone else’s list of thorniest problems.

For most Western nations, inertia has served as policy until now. They were content to watch as U.S.-backed forces captured foreign fighters who had flocked to Syria when the Islamic State was ascendant, often embracing the group’s radical agenda and acting as cogs in a caliphate they imagined would last forever.

Now, most are prisoners of the Kurdish-led Syrian Democratic Forces in a remote corner of northeast Syria, where the looming drawdown of U.S. troops, ordered by Mr. Trump, puts the status quo in question. As the U.S. presence wanes, so will the Kurds’ ability to detain the foreign fighters and their families.

On a menu of bad choices, among the worst would be to release the fighters or allow them to escape — a recipe for instability that would pose long-term dangers in a region that has already consumed too many Western resources and lives. The threat of reconstituted Islamic State forces is real; feeding that threat would be folly.

The least bad option is to subject as many of the fighters as possible to prosecution in functioning and fair courts. That precludes the Kurds, who have no real judicial system. It means that Western countries, including the United States, need to step up.

In a limited and wrongheaded way, U.S. officials are starting to come to terms with that eventuality. Pentagon officials, along with a handful of Republican senators and Mr. Trump himself, have raised the prospect of transferring a few high-value foreign fighters to Guantanamo, which has received no new prisoners since 2008. That would hand a propaganda bouquet to radical groups the world over while doing very little to bring the fighters to justice. (Guantanamo’s military commissions have struggled to conduct trials.) Moreover, European allies, who condemned the indefinite detentions of suspected terrorists at Guantanamo in the past, are unlikely to cooperate in the case of their own citizens being held there.

Britain and other countries have tried when possible to offload the fighters to third countries where they might have dual citizenship. That’s also not likely to work in many instances. Countries are ultimately responsible for their own citizens, even when those citizens are a danger. It is likely to be expensive, difficult and politically unpopular for European nations and the United States (from which only a relative handful of former Islamic State militants originate) to repatriate and prosecute the fighters. Those who cannot be convicted and go free will also impose a burden on intelligence and domestic security agencies. Unfortunately, there’s no better option.

Read more: