With the Mosul battle raging and the Raqqa offensive possibly weeks away, U.S. policymakers and government attorneys will be facing a familiar kind of problem: What is going to be done with the inevitable ISIL fighters captured in the battle?

The answer to that question is not going to be easy, as evidenced by the ongoing legal and policy debates surrounding the U.S. military prison in Guantanamo Bay, Cuba, where hundreds of detainees tied to the conflict with Al Qaeda and the Taliban were brought following the 9/11 attacks in 2001. Of those, 60 remain.

With the future of Guantanamo and the fate of those remaining detainees still far from resolved, the Obama administration is bracing for a new wave of detainees stemming from its fight against ISIL.

“We do recognize that a successful ISIL plan in Iraq and Syria has the potential to result in an increasing number of detainees,” said Brian Egan, the chief legal officer at the State Department, at an international law conference being held at Fordham University School of Law on Friday.

The legal dilemmas are particularly acute in Syria, where the US is not partnered with government forces. The problem there is not just what will the US do with the ISIL fighters it captures, but what is the US legally required to do to compel the rebel forces it’s supporting to abide by international law when they take prisoners.

“I think it’s very dangerous territory, frankly, and the US government knows that that’s the case,” said Just Security’s Oona Hathaway, professor of international law at Yale Law School and former special counsel to the Defense Department’s general counsel, speaking on the same panel as Egan.

The Pentagon’s train and equip program for Syrian rebels included building up forces and training them in the basic requirements for dealing with and detaining those they were fighting in humane ways, Hathaway said.

But that program has significantly shifted.

“We’re now increasingly working with non-state actor groups that we have less control over, and yet we’re providing substantial support for,” Hathaway said. “These groups that we’re working through, frankly, are not in a very good position to abide by their Common Article 3 obligations.”

For the US, “the question is what can we do and what legally must we do” to make sure these partner forces comply with basic standards, Hathaway said.

On Friday at Fordham, Charlie Savage, Washington correspondent for the New York Times and the author of Power Wars, asked Egan whether he could say if the US government agrees that it has an “affirmative responsibility to prevent allied rebel groups from slaughtering” the ISIL fighters they capture.

Egan said “the legal test that would be most relevant would be the Law of State Responsibility, where there is some disagreement on exactly what the legal contours are there, but it’s something we’ve taken a position on in the government, and aiding and abetting could also conceivably be relevant.”

[Editor’s note: For more on aiding and abetting liability, read Ryan Goodman’s Just Security post from September.]

Meanwhile in Iraq, it’s a slightly clearer picture, because Iraqi forces will be in charge of the vast majority of detainees, but even there, human rights advocates worry about prisoner abuse, torture, and the lack of basic due process.

“We’ve worked with our Iraqi partner forces to ensure that the conduct of detention operations they undertake are consistent with their international legal obligations, including their requirements of Article 3 in the Geneva Conventions,” Egan said.

“Given that US forces have a pretty limited role in this campaign, we don’t expect the United States to detain large numbers of individuals, but we do see it as a possibility that we will detain some,” he said.

The US forces “in our own operations have already captured some members of ISIL in this campaign,” Egan said.

Egan highlighted the case of Nasrin As’ad Ibrahim, known as “Umm Sayyaf,” who was captured in May 2015 in a raid that killed her husband, the ISIL oil and gas “emir” Abu Sayyaf.

“We held her in US custody, first of all, in conditions that met Common Article 3 standards,” Egan said. “We provided the International Committee of the Red Cross with notice of her capture. And then we ultimately transferred her to the Iraqi regional government authorities in Kurdistan, and we did that when we were assured that her continued detention could be conducted consistent with the applicable legal and policy requirements.”

The panel also discussed the fate of the detention facility at Guantanamo, and turned to the prospect of reform.

With a new Congress, if statutory restrictions are ever lifted, one option for the remaining detainees is to move them into a facility or facilities in the US, allowing for the closure of Guantanamo.

“I think that is a huge mistake,” said Just Security’s Jen Daskal, Associate Professor of Law at American University Washington College of Law and former counsel to the Assistant Attorney General for national security at the Department of Justice, also speaking on the panel. “Once you build a detention facility in the United States, you create this risk of not just indefinite, but perpetual detention continuing and persisting,” she said, adding, “If you build it, they will come.”

If the US builds or supports detention facilities for ISIL fighters, anywhere in the world, will it too produce that kind of result?

The two topics—ISIL detainees and Guantanamo 2.0—may not just raise similar questions, but have much closer connections.

[Editor’s Note: For more on this topic, read Jonathan Horowitz, The US’ Failure to Plan for ISIL Detention Operations is a Flawed Approach, Just Security, May 19, 2016]

Image: Iraqi soldiers from 2nd Battalion, 71st Brigade, enter a room after breaching the doorway to ensure that it is clear at Camp Taji, Iraq, Jan. 10, 2016. DoD, Army photo by Sgt. Kalie Jones.