A federal appeals court in Washington, D.C. on Thursday struggled with how to draw a line extending habeas rights to some prisoners captured abroad and not to others.

The Justice Department is fighting the extension of habeas rights to prisoners held at the Bagram Airfield detention center in Afghanistan. Last year, Judge John Bates of the U.S. District Court for the District of Columbia ruled in favor of three detainees whose circumstances, he said, justified access to U.S. courts to challenge continued detention.