A US federal judge in Washington has ruled that special military tribunals being used to try hundreds of detainees at Guantanamo Bay in Cuba are illegal.
Many inmates have been held without charge or access to lawyers
Judge Joyce Hens Green said the tribunals denied the detainees their basic rights under the US constitution.
Her ruling is a blow to the Bush administration, which argues the inmates have no constitutional rights.
But a BBC correspondent says the decision is unlikely to be the end of the matter.
Judge Green said the tribunals in 11 cases she had examined were unconstitutional, and that the detainees were not accorded due process of law.
She noted the widespread allegations that detainees were abused during interrogations and said this cast doubt over any confession made under such circumstances.
The war on terror "cannot negate the existence of the most basic fundamental rights for which the people of this country have fought and died for well over 200 years," she wrote.
The BBC's Adam Brookes in Washington says the ruling effectively challenges the Bush administration's assertion that it has the right to detain indefinitely anyone it defines as a terrorist suspect.
But after a series of conflicting legal judgments, he says higher courts may have to make a final decision.
Only two weeks ago, Judge Richard Leon dismissed a lawsuit filed by seven detainees. He backed the view that foreign nationals captured and detained outside the US had no recognisable constitutional rights.
He said it was up to the US Congress, not the courts, to decide the conditions of imprisonment.
Both lawsuits followed a ruling by the US Supreme Court last June that inmates did have the right to challenge their detention.
Many of the 540 or so inmates at the US naval base in Guantanamo Bay, Cuba, have been held without charge and access to lawyers since the 2001 invasion of Afghanistan.
They are suspected members of al-Qaeda or the Taleban, and the US government accuses them of being enemy combatants.
Four Britons and an Australian, held at Guantanamo Bay for more than three years, were allowed to return to their respective countries last week without having to go before a military tribunal.
The Britons were freed after being interviewed by police officers in London, but the US government said it continued to believe the men posed a "significant threat".