The Islamic State’s physical territory has dwindled to a ramshackle camp only a few square kilometers wide in eastern Syria’s Deir Ez Zor province. But as the so-called caliphate’s end nears, questions remain about what will become of the roughly 1,000 ISIS fighters who have been detained by U.S. troops and local allies.

While some of the ISIS detainees are front-lines troops and untrained cannon fodder, a significant cohort of them are also more capable militants trained as external operation planners and master bomb makers who pose a threat to the U.S. and its allies.

“It’s closer to a thousand than it is hundreds already in detention, with more to potentially come,” Army Gen. Raymond Thomas, III, who helms U.S. Special Operations Command, said at a Senate hearing Thursday. “[It’s] a huge area of concern for us, especially because they’re being detained by the non-nation state that’s otherwise known as the Syrian Democratic Forces."

U.S.-backed SDF troops, who fought to clear ISIS out of the eastern portion of Syria, have been in limbo ever since the Trump administration announced that U.S. forces would eventually depart the country after ISIS’ defeat.

Early on in the anti-ISIS campaign, some within the SDF hoped to create their own nation. But Syrian reunification looks more likely at the moment, potentially creating a chaotic transition phase during which detained ISIS fighters can slip through the cracks and plot attacks abroad.

“How we reduce that threat and keep those people properly detained and handled over time is of paramount importance right now," Thomas said.

Most of these detainees are foreign fighters from roughly a dozen different countries, he added.

The U.S. State Department has been calling on the origin nations of foreign ISIS militants to repatriate and prosecute the detainees.

× Fear of missing out? Sign up for the Early Bird Brief - a daily roundup of military and defense news stories from around the globe. Thanks for signing up. By giving us your email, you are opting in to the Early Bird Brief.

“I’ll give kudos right now to some of the countries that have stepped up, particularly some of the smaller countries that have capacity challenges, but nevertheless have started to assume the burden,” Thomas said.

Members of Syrian partner forces approach a target objective to conduct clearance operations during a final combat assessment in the Dayr Az Zawr Province, Syria, Dec. 6, 2018. (Sgt. Arjenis Nunez/Army)

“We have empty beds at Guantanamo Bay, don’t we?” Arkansas Sen. Tom Cotton asked during the hearing. “Maybe we should consider that for some of those really bad guys in Syria.”

A U.S. official told the Associated Press that the American base at Guantanamo Bay, Cuba, is the “option of last resort.”

Speaking on condition of anonymity, the official said that roughly 50 detainees in Syria have been identified as “high value” suspects that could be held at Guantanamo if they are not repatriated.

Thomas was hesitant to call the end of ISIS’ physical caliphate a “victory” when probed by senators. Instead, he characterized ISIS’ loss of land as a great accomplishment but one that will transition the terror proto-state into an insurgency movement.

“The [counter-terrorism] threat between 2001 and 2011 wasn’t measured in territory, it was measured in terrorist threat, and that’s still there, isn’t it?” Maine Sen. Angus King asked during the hearing.

“Correct,” Thomas said. “The [counter-terrorism] threat is in the throws of transformation. ... They’re still very dangerous.”

Pentagon review calls for changes to how US investigates, reports civilian war casualties The study calls for greater collaboration between the U.S. military and humanitarian groups, the declassification of investigations when appropriate, the investment in tools to assist ground force commanders in developing greater situational awareness, and the standardization of how U.S. combatant commands should address wrongdoing.

External threats from violent extremist organizations can still emanate from Syria, according to Thomas.

“We’re on the verge of diminishing the threat and in the process of determining what residual capability needs to remain in place in the region to ensure that we’re securing that objective,” Thomas said.

How a residual presence will look may largely depend on President Donald Trump, who has been eager to end American involvement in Syria. He has said, however, that he is interested in keeping a U.S. presence in Iraq in order to keep an eye on Iranian activity in the region.

During the Senate hearing, Thomas said that ISIS has attempted to launch operations in Iraq. He also commended the Iraqi government for reinforcing its sovereignty and taking charge of the security situation within its borders.