WASHINGTON - Inmates at the notorious Guantanamo Bay prison have constitutional rights and may seek release in US court, the country's Supreme Court ruled on Thursday in a rebuke to the Bush administration and Congress on their handling of accused terrorists. The justices, voting 5-4, said a 2006 law unconstitutionally stripped Guantanamo prisoners of the right to file habeas corpus petitions. The majority rejected arguments that a system of limited judicial review set up by Congress was adequate to protect inmate rights. "The costs of delay can no longer be borne by those who are held in custody," Justice Anthony Kennedy wrote for the majority. "The detainees in these cases are entitled to a prompt habeas corpus hearing." The ruling bolsters the legal rights of the 270 inmates at Guantanamo's Camp Delta, set up in 2002 to detain accused al-Qaeda fighters captured after the Sept 11 attacks. More broadly, the decision may mean a more powerful wartime role for the judiciary. Justices John Paul Stevens, Stephen Breyer, Ruth Bader Ginsburg and David Souter joined Kennedy's opinion. Chief Justice John Roberts and Justices Samuel Alito, Antonin Scalia and Clarence Thomas dissented. Scalia took the unusual step of reading a summary of his dissent from the bench. "The nation will live to regret what the court has done today," Scalia said in his written opinion. The Bush administration contended that the Constitution and its guarantee of habeas rights don't cover enemy prisoners held outside the country, in this case on Cuban territory that the US occupies under a 1903 lease. Habeas corpus is a legal device that dates back to 14th-century England and lets inmates claim they are being wrongfully held. Kennedy wrote that Guantanamo "while technically not part of the United States, is under the complete and total control of our government." He said the constitutional habeas guarantee "has full effect at Guantanamo Bay." The justices were reviewing appeals by 37 inmates being held as "enemy combatants." The group includes six Algerian natives seized in Bosnia in 2002 and a larger group of men who were taken into custody in Afghanistan or the bordering areas of Pakistan. None of those inmates have been criminally charged, although today's ruling may affect those who have been. The military plans on prosecuting about 80 inmates, including Khalid Sheikh Mohammed, the self-proclaimed mastermind of the Sept 11 attacks. Prosecution efforts have stalled in recent months, and at most a handful of trials are likely to go forward this year. All Guantanamo inmates appear before a Combatant Status Review Tribunal, or CSRT, a military panel that decides whether the men are "enemy combatants" who should remain in detention. A 2005 law gives inmates only a limited right to appeal that conclusion to a federal court in Washington. Lawyers for the prisoners say those procedures are a poor substitute for habeas rights. During CSRT hearings, shackled inmates appear before a panel of three officers. The inmates can't have a lawyer present, are barred from seeing much of the evidence against them and in most circumstances can't call witnesses in their defence. In a number of cases, a second CSRT was convened after the first panel concluded an inmate wasn't an enemy combatant. Officials at Guantanamo say the CSRTs have led to the release of more than three dozen prisoners.