The US Supreme Court has said foreigners held at the Guantanamo Bay military prison have the right under the US constitution to challenge their detention in US civilian courts.
The court ruled on Thursday that detainees in the US jail in southern Cuba "have the constitutional privilege of habeas corpus".
"The laws and constitution are designed to survive, and remain in force, in extraordinary times," said Justice Anthony Kennedy, writing for the court.
The ruling, passed by a vote of five to four, is a setback for the administration of George Bush, the US president.
Bush said later on Thursday that he would abide by the Supreme Court's decision, but that he disagreed with the ruling.
Rob Reynolds, Al Jazeera's senior Washington correspondent, said the ruling was "a very significant milestone in this very long running battle".
"Really its a victory for the proper system of justice. The reason that Guantanamo was chosen was because it was not on American soil ... the White House believed that because they [the detainees] would be on foreign soil they would be beyond the reach of American justice," he said.
"It's been a very long process but through a series of lawsuits ... the justices have chipped away at the unusual means under which these individuals are being detained."
Constitutional rights The court ruled that even if the base was officially on Cuban territory, it was in fact operating as if it were on American soil and therefore detainees had the same constitutional rights as all Americans.
The ruling is the third on Guantanamo that has gone against the Bush administration.
Detainees and their legal teams could now demand that the government reveal the evidence against them to justify their continued detention.
The government has refused to do this arguing it would be against the interests of national security.
Detainees have long protested that they had been mistreated, and rights groups have questioned the legality of the Guantanamo Bay military tribunals.
But it was not immediately clear whether the ruling would lead to prompt hearings for the detainees, some of whom have been held more than 6 years.
About 270 so-called enemy combatants remain at the prison facility.