Foreign suspects held in Guantanamo Bay have the right to challenge their detention in US civilian courts, the US Supreme Court has ruled.
It overturned by five to four a ruling that upheld a 2006 law that took away the rights of suspects to seek full judicial review of their detention.
It is not clear if the ruling will lead to prompt hearings for the detainees.
Some 270 men are held at the US naval base, on suspicion of terrorism or links to al-Qaeda and the Taleban.
The court said the detainees "have the constitutional privilege of habeas corpus".
Justice Anthony Kennedy said: "The laws and constitution are designed to survive, and remain in force, in extraordinary times."
This is the Bush administration's third setback at the highest US court since 2004 over its treatment of prisoners who are being held indefinitely and without charge at the base in Cuba.
The court has ruled twice previously that Guantanamo inmates could go into civilian courts to ask that the government justify their continued detention.
But each time, the Bush administration and Congress, then controlled by Republicans, changed the law to keep the detainees out of civilian courts.
Last week, five detainees, including key suspect Khalid Sheikh Mohammed, appeared before a military tribunal in Guantanamo Bay.
Khalid Sheikh Mohammed dismissed the trial as an "inquisition".