BRUSSELS — European leaders have hammered the United States for nearly two decades about the injustice of Guantanamo Bay, where prisoners are held indefinitely at a detention camp outside the normal U.S. justice system.

But faced with what to do about European nationals who went to fight for the Islamic State and ended up in Syrian detention camps, the continent’s leaders are proving reluctant to bring their citizens to trial at home.

Three months after the collapse of the Islamic State, about 2,000 foreign fighters are imprisoned in Syria and Iraq, and about 800 of them are believed to be European, according to U.S. officials. Those figures don’t include the thousands of wives and children with foreign citizenship.

European leaders have made little movement to repatriate their citizens, even as U.S. and Kurdish authorities beg them to take back their people. Some security officials warn that inaction could enable future attacks, and human rights advocates deplore the conditions in overcapacity camps.

“It’s obvious that there is a humanitarian crisis unfolding in the camps in northeast Syria and the prisons in Iraq that are holding thousands of foreigners,” said Letta Tayler, a global terrorism researcher at Human Rights Watch. “Western Europe’s response has been to look the other way. It just goes against everything that Western Europe says it stands for.”

European leaders have taken a hard look at what their domestic populations want — and blinked. Popular opinion is overwhelmingly against bringing back the European fighters. The anger sharpened after terrorist attacks in Paris in 2015 and Brussels in 2016, in which some of the perpetrators had visited the caliphate. 

“Ordinary Belgians want them to be taken care of over there,” said Koen Metsu, a Belgian lawmaker who has worked on security issues. The Europeans who joined the Islamic State “knew up front what they were about to do,” he said.

Even bringing back the children of the fighters is unpopular. France and the Netherlands have taken back orphans in recent days, because those children are free from the leaden political baggage of having parents who might also want to return alongside them. Belgium last week announced plans to do the same. Britain, meanwhile, has sought to strip suspected Islamic State sympathizers of their citizenship.

Some fighters and sympathizers have been convicted in absentia — unable to appear at their European trials because they were in Syria. But authorities have little appetite to bring people home to serve their sentences. 

European countries have also begun to outsource prosecutions to Iraqi courts. Justice is swift, the burden of proof light, access to lawyers minimal and the punishment consistent: death by hanging, according to human rights groups who have witnessed the proceedings. In recent weeks, 11 French citizens, among others, have been sentenced to death. France, which opposes the death penalty, signaled it will not stand in the way of the trials, saying it respects Iraqi sovereignty.

Advocates of shifting prosecutions to Iraqi courts, including Metsu, acknowledge that some fighters may have fought in Syria only, not Iraq, raising questions whether Iraqis truly have jurisdiction. But they say justice is better served close to where crimes were committed and where witnesses and evidence are nearby.

The question of whether to reclaim fighters and their families is less pressing for the United States, because only a few dozen U.S. citizens are known to have traveled to join the Islamic State, according to counterterrorism analysts. But America has started to bring its people home. This month, six children and two women were flown back from the al-Hol camp to be resettled in the United States, according to Syrian Kurdish authorities. Three men and a woman are awaiting U.S. trial. Three others agreed to plea deals. And one Virginia man is appealing a sentence of 20 years for providing material support to a designated terrorist organization.

U.S. officials, having made greater progress than their European counterparts, have sought to claim the moral high ground and to impress that the current situation is not sustainable. 

“It is not a solution to leave these people in camps in northeast Syria. This is a burden on the people of northeast Syria,” James Jeffrey, the U.S. special representative for Syria engagement, told reporters last week. “It is absolutely imperative that countries take action as necessary to deal with their own citizens.”

The challenge bloomed as a U.S.-led coalition took over the final pockets of Islamic State territory in Syria and Iraq. That sent a wave of refugees and ex-fighters into the already fragile camps in Kurdish-controlled northeast Syria. Many of the men are in improvised prisons. Women and children are not under the same tight control, but those suspected of Islamic State sympathies are not allowed to move freely.

At al-Hol, more than 73,000 people are packed into facilities built to house about half that. The camp population includes 3,200 foreign women and 7,900 foreign children, alongside more than 60,000 Syrians and Iraqis, according to Kurdish authorities. There are just three mobile clinics at the camp, and shortages of medicine are acute. 

The Kurdish forces who operate the jammed camps have few resources. Some of them complain they are being forced to lavish more money on their defeated enemies than on their own war-frayed population. 

Meanwhile, President Trump has said he wants to withdraw U.S. forces from the region. A pullout could threaten the viability of the camps, because the U.S. military has been a crucial source of support for the Kurds.

Trump tweeted his frustration at the end of April: “European countries are not helping at all, even though this was very much done for their benefit. They are refusing to take back prisoners from their specific countries. Not good!”

The inaction by European politicians also comes over the objections of some of their own security officials. Many who work to keep Europeans safe — but who don’t have to win their votes — would prefer to keep terrorism suspects and convicts close by, where they can be watched, instead of running the risk they could vanish abroad and plot future violence. 

“There is a disconnect between the political world that is very concerned about the political risks that are associated with the repatriation of terrorists, and the various services that are dealing with counterterrorism daily,” said Thomas Renard, a terrorism expert at the Brussels-based Egmont Institute. “Having these individuals here, prosecuting them here, is not only feasible but also probably less problematic.”

“Purely from a security point of view, we should not make the mistakes of the past. We should not create a new Guantanamo Bay,” said one senior European security official, who spoke on the condition of anonymity to discuss sensitive assessments that do not line up with those of national leaders.

The Post's Souad Mekhennet visited four prisons in Belgium and Germany to see how officials are trying to stop Islamic State fighters from recruiting inmates. (Michael Pohl, Souad Mekhennet, Sarah Parnass/The Washington Post)

Many of Europe’s objections to Guantanamo, the U.S. detention facility in Cuba, had to do with torture. But other factors that led the United States to detain people there — a lack of confidence in civilian courts to handle terrorism trials and a fear of the political backlash of bringing terror detainees onto U.S. soil — echo in the European decisions, the official said.

European sentences for terrorism-related charges tend to be lighter than in the United States — the lightest offenses are punishable with two- to five-year sentences. Prisons can be hotbeds of radicalization. And European politicians warn that mustering the battlefield evidence necessary for convictions on serious charges can be difficult. Some countries, such as Sweden, never criminalized travel to Syria, making it difficult for law enforcement to charge people for basic association with the Islamic State.

“It’s political suicide to try to bring them back, because the public doesn’t want them back,” said Magnus Ranstorp, a counterterrorism expert at the Swedish Defense University. “They’ve committed atrocities, but you cannot convict them. And if you can convict them, it won’t be for that long unless you can prove murder. It’s a ripe mess.”

Swedish leaders are advocating a different approach.

“We said we will not repatriate terrorists to Sweden,” said Swedish Home Affairs Minister Mikael Damberg in an interview. Damberg has pushed for an international tribunal near Syria to prosecute Islamic State crimes. He said that would provide a way to process the detainees without bringing them to Europe. 

“Not doing anything in the region, close to evidence and witnesses, is also complicated, and risks not actually prosecuting and condemning them,” he said.

Skeptics of the effort, including the U.S. government, say setting up a tribunal could take years, by which time evidence would be lost and memories faded. They also say it would force an even bigger burden on Iraq, which is already struggling to rebuild after Islamic State occupation. The Iraqi government is in talks to take back about 30,000 of its own citizens who traveled to Syria to live under Islamic State rule.

Some families of terrorism victims say they would prefer that justice be served closer to home.

“We want those trials to happen in France,” said Georges Salines, whose daughter, Lola, died in the 2015 Paris terrorist attacks. “We really want for those people to be heard by judges. We want to know how they got radicalized.”

Quentin Ariès contributed to this report.