WASHINGTON (CNN) -- The president retains the power to hold indefinitely and without charges some accused terrorists at the Guantanamo Bay, Cuba, military detention camp, a federal judge has ruled.
A guard talks with a detainee at Guantanamo Bay, Cuba, earlier this year.
The decision by District Judge John Bates said those prisoners the United States deems responsible for the 9/11 attacks, or those who are or were al Qaeda or Taliban members, can be detained. But he limited the Obama administration's power to imprison those who it says "support" terror or enemy forces.
The decision comes as the White House and Congress face a showdown over what to do with hundreds of Guantanamo prisoners when the facility at the U.S. naval base in Cuba is closed, a move President Obama has promised will occur before February. Many lawmakers opposed housing the prisoners in the United States.
"The president has the authority to detain persons that the president determines planned, authorized, committed, or aided the terrorist attacks that occurred on September 11, 2001, and persons who harbored those responsible for those attacks," Bates wrote in an opinion issued late Tuesday.
"The president also has the authority to detain persons who are or were part of Taliban or al Qaeda forces or associated forces that are engaged in hostilities against the United States or its coalition partners, including any person who has committed (i.e., directly participated in) a belligerent act in aid of such enemy armed forces," the Washington-based judge said.
Late Wednesday, the Senate passed a bipartisan compromise amendment calling for the administration to provide Congress with a threat assessment of each of the detainees held at Guantanamo.
The assessment would include whether a detainee "may return to terrorist activity after release or transfer" from the base.
The Senate also passed a non-binding resolution urging the military to consult with state and local authorities before transferring any detainees into their jurisdictions.
Among the top-level prisoners in custody at the Guantanamo Bay facility is Khalid Sheikh Mohammed, the alleged mastermind of the 9/11 attacks.
CNN's Ted Barrett contributed to this report