An American citizen fighting for the so-called Islamic State is currently in the U.S. military’s custody. If Donald Trump decides to keep him there, it could spark a far-reaching legal challenge that could have a catastrophic effect on the entire war against ISIS, leading national security lawyers say.

The unnamed American, whom the Pentagon says surrendered to U.S.-allied forces battling ISIS in Syria around Sept. 12, is currently held by the military as an enemy combatant. Multiple officials told The Daily Beast that the Trump administration has yet to decide whether that will be his long-term fate.

Neither the Defense Department nor the Justice Department would comment Monday on active deliberations concerning whether the American will face criminal charges in the United States or remain a military detainee. “The disposition for any detainee is ultimately determined by what best supports the national security of the United States and of our allies and partners, consistent with domestic and international law,” said the Pentagon’s detentions spokesman, Maj. Ben Sakrisson.

Should the Justice Department ultimately take custody of the American and charge him with a terrorism-related crime, further legal controversy is unlikely, at least beyond the specifics of his case.

But Trump has long indicated he would take a different, more contentious route. Throughout the presidential campaign, Donald Trump indicated that his preference was toward military custody for ISIS fighters, even going as far as to be open to Guantanamo detention for a U.S. citizen facing a military tribunal—which would be illegal, as the Military Commissions Act of 2006 applies only to “alien unlawful enemy combatant[s].”

Asked if the Defense Department believes it can hold a U.S. citizen at Guantanamo, Sakrisson indicated it was a complex question.

“There is nothing that prohibits detaining a U.S. citizen as an enemy combatant at Guantanamo,” Sakrisson said. “But the actual likely disposition for any potential detainee would take into account what would be appropriate with respect to legal, diplomatic, intelligence, security, and law enforcement considerations.”

But Karen Greenberg, director of Fordham Law’s Center on National Security, pointed to George W. Bush’s seminal Nov. 13, 2001 executive order on detentions, which explicitly says that only someone “who is not a United States citizen” was eligible for military captivity.

“It’s only for foreigners,” said Greenberg, who wrote a book on the early days of Guantanamo Bay detentions.

Sakrisson disputed that interpretation. “United States citizens are excluded from being tried by Military Commissions, but nothing in that document prohibits detaining U.S. citizens who have been identified as unlawful enemy combatants,” he said.

Keeping the unnamed American detained by the military—according to several attorneys with deep experience with post-9/11 detention-law questions—risks a showdown in court over the very foundations of the war against ISIS.

That’s because the legal authority for the U.S. to attack ISIS is the fateful 2001 Authorization to Use Military Force (AUMF), passed by Congress days after the Twin Towers fell to avenge the 9/11 attacks. As the path of least political resistance, Barack Obama based the war against ISIS on the AUMF, despite ISIS not having existed on 9/11. Obama instead treated ISIS’ high-profile split from al Qaeda in 2014 as a legally insignificant fact.

Repeated efforts at passing a new AUMF to cover the anti-ISIS war have foundered. The Trump administration has ruled out seeking “additional authorizations” to replace or update the AUMF for an era of ISIS, according to a letter the State Department sent to Capitol Hill last month.

That decision has implications for the current debate on whether ISIS detainees are a military or civilian matter. Military detainees have the right to challenge the basis for their detentions in federal court, the Supreme Court has ruled, a fundamental right known as habeas corpus. U.S. citizens, like the man detained last week, possess habeas corpus rights under the Constitution.

Not only would a U.S. citizen be able to challenge their military detention in court, attorneys say, but doing so would permit a judge to rule whether the AUMF applies to ISIS—and potentially invalidate it. Those attorneys suspect the Trump administration holds a weak hand, even if it wants to risk a judge ruling that the war against ISIS is illegal, and are watching closely to see if Trump reverses his rhetoric and charges the American detainee in a civilian court.

“The Obama and Trump administrations have relied on a very controversial, stretched interpretation of the 2001 AUMF to cover their military operations against ISIS, but there hasn’t been much opportunity for anyone to challenge that interpretation in court,” said Matthew Waxman, a Columbia University law professor who served as a senior Pentagon detentions official in the Bush administration.

“A habeas corpus suit brought by a citizen-detainee like this could be that opportunity.”

The Obama administration evaded that opportunity by charging ISIS detainees—even those captured on an active battlefield—in federal court with specific violations of U.S. law. Trump’s thus-far unfulfilled pledge to load Guantanamo Bay up “with some bad dudes” has also forestalled a legal reckoning. Waxman noted that “bringing captured ISIS detainees, even non-Americans, to Guantanamo,” carries the potential of a legal challenge to the AUMF as the basis for the war against ISIS, “since all Guantanamo detainees have a right to bring habeas challenges.”

Thus far, the Trump administration has drawn a line short of openly endorsing U.S. military detention. Trump has yet to sign a long-expected executive order opening Guantanamo to new detainees. This summer, the Justice Department charged an al Qaeda suspect—someone whose connections to the AUMF are stronger than an ISIS suspect’s—captured overseas in federal court.

Steven Vladeck, a University of Texas law professor and national-security law expert, said receiving a habeas petition from an ISIS detainee was “the most obvious way that a court would be asked—and would have to decide” the applicability of the AUMF to ISIS. “Why the administration might choose a test case where the detainee is also a U.S. citizen (which would make that argument that much harder) is, frankly, beyond me,” Vladeck emailed.

With each passing day the administration keeps the detainee in military custody, the prospect grows less hypothetical. An attorney with the Center for Constitutional Rights, Wells Dixon, said that the human rights group was currently attempting to ascertain the American detainee’s identity, locate his family, and see if the family wishes to challenge his military detention.

“We will consider filing a habeas case on his behalf,” Dixon told The Daily Beast—something Dixon said carried “massive political, diplomatic, and legal consequences,” as it would be the first challenge to ISIS applicability of the AUMF in the three years since the U.S. war against the jihadist group began.

“If a court was to conclude the AUMF does not cover ISIS, that could collapse the entirety of U.S. military operations against ISIS, including in Syria,” Dixon said.

“Why would the Trump administration want to buy that problem? The president could wake up on wrong side of bed, make an impulsive decision to send [the American] to Guantanamo,” Dixon continued, “and then we’re off to court.”