The entrance to Camp 5 and Camp 6 at the U.S. military's detention center at Guantanamo Bay, Cuba, shown in 2014. (Ben Fox/AP)

A federal appeals court in Washington confronted the question Tuesday of whether the Trump administration has the power to indefinitely detain prisoners at Guantanamo Bay, Cuba, more than 15 years after the conflict in Afghanistan began.

The case takes on new significance after President Trump promised in January to keep open the U.S. military prison there and suggested that he may expand its use to hold new terrorism suspects for the first time in a decade.

Attorneys for a Yemeni man who has been held at Guantanamo Bay since 2002 without being charged told the U.S. Court of Appeals for the D.C. Circuit that the president’s authority has expired because the relevant conflict in Afghanistan used to justify his detention after the attacks of Sept. 11, 2001, has ended. Even if the court decides it is the same war, the U.S. government cannot hold him indefinitely, his legal team said.

Moath al-Alwi grew up in Saudi Arabia and spent time in 2001 in northern Afghanistan, where the government said he received military-style training and weapons from the Taliban — and served in a Taliban combat unit commanded by an al-Qaeda leader.

Alwi’s attorney Ramzi Kassem said Tuesday that his imprisonment violates U.S. and international law and he urged the court to determine “how long is too long.”

About 780 prisoners have been held at Guantanamo Bay during Alwi’s detention. There are now 41.

“Congress or the executive could have done something about it, but they haven’t,” Kassem told the court during oral argument. “Someone has to do something.”

Justice Department attorneys countered in court filings that Alwi’s detention is necessary because of “his continued and recent extremist statements” that show he would “be susceptible to recruitment” by enemy forces if released.

The United States “is still fighting the same terrorist group al-Alwi joined in the same country,” government attorney Sonia M. Carson told a three-judge panel made up of Chief Judge Merrick Garland, Judge Thomas Griffith and Judge Karen LeCraft Henderson.

To side with Alwi, the government said, is to “reward the enemy for stretching the conflict to historic lengths by persistently continuing its attacks.”

Although the Obama administration announced an end to the U.S. combat mission in 2014, a resurgent Taliban has reclaimed territory and posed a major threat to the Afghan government, requiring a renewed military investment in the United States’ longest war.

Grappling with a situation that military leaders have labeled a “stalemate,” the Trump administration has increased the number of U.S. troops and given commanders in Afghanistan expanded authority in an attempt to beat back the Taliban and other militant groups.

The three-judge panel did not seem inclined Tuesday to declare the conflict over and one judge, Griffith, noted that the D.C. Circuit had in an earlier decision described the fighting in Afghanistan as “a long war, with no end in sight,” and determined then that the Constitution allows for detention throughout the “duration of hostilities.”

Garland pointed out that the court had already decided in 2011 that Alwi was a “combatant” and that the United States had the authority to detain him.

Stephen I. Vladeck, a law professor at the University of Texas at Austin, said it’s highly unlikely that any three-judge panel of the D.C. Circuit “would conclude that the situation on the ground has changed so dramatically that there’s no longer detention authority” to hold prisoners such as Alwi at Guantanamo Bay.

But, he said, even if the panel sides with the government, the outcome could still be an important legal development if the judges decide that the question of when that authority ends is ultimately up to the court — and not Congress or the president.

Trump’s vow to keep Guantanamo Bay open reversed the Obama administration’s practice of trying to reduce the population. President Barack Obama had pledged to close Guantanamo Bay, but encountered political resistance.

Alwi appealed after U.S. District Judge Richard Leon sided with the Justice Department in February, dismissing the challenge and finding that “the duration of a conflict does not somehow excuse it from long-standing law-of-war principles.”

A separate lawsuit filed in federal court in D.C. in January challenges the legal grounds for detaining 11 men held at the military facility for up to 16 years without being charged. That case, brought by the Center for Constitutional Rights, says the indefinite detention of the men violates their due-process rights.