Prisoners at Guantanamo Bay (search), Cuba, must challenge their detention in the District of Columbia, a federal appeals court has ruled.

The San Francisco-based 9th U.S. Circuit Court of Appeals (search) said the U.S. District Court for the District of Columbia was the appropriate venue for the 595 detainees given that they are overseas and are suing the federal government.

Thursday's decision was the first time an appeals court had determined where the challenges should be lodged.

The detainees won the right to seek their freedom last month after the Supreme Court rejected the Bush administration's argument that the men could be kept in military custody indefinitely, without charges or trial, because they were picked up overseas on suspicion of terrorism.

In overruling the administration, the Supreme Court ordered the San Francisco appeals court to determine the proper venue for a Libyan captured in Afghanistan to challenge his two-year detention. Lawyers representing other detainees have said they planned to sue in the nation's capital.

Faren Gherebi filed his case in California well before the Supreme Court ruling.

The San Francisco court's decision came a day after the government announced the military would review the individual cases of the prisoners to determine whether they are being legally held. Officials said the move was in preparation for the flood of litigation from detainees following the Supreme Court's ruling.