The landmark opinion issued on Monday could prevent military trials of alleged enemy combatants held at Guantanamo Bay.
It was the first time a court has stalled hearings in the military commissions, resurrected from the second world war and heavily criticised by lawyers, legal observers and human rights groups.
A competent tribunal should have evaluated whether Salim Ahmad Hamdan was a prisoner of war under the Geneva Conventions, Judge James Robertson of the US District Court in Washington ordered in an opinion issued on Monday.
The judge added that Hamdan should not be tried unless rules of the military commissions were changed to conform to the Uniform Code of Military Justice.
Hamdan's defence team said the 34-year-old from Yemen was "ecstatic".
Right to tribunal
The court ruled in favour of Hamdan's habeas petition and against the US government's contention that Hamdan and other detainees were not prisoners of war but "enemy combatants", a classification affording fewer legal protections.
Core points in the ruling included Hamdan's right to a tribunal that looked at whether he qualified as a prisoner of war and his right to challenge all the evidence against him.
"What people in the United States haven't realised is that if we don't comply with them [the Geneva Conventions], no other country is required to comply with them, looking at our example"
Barbara Olshansky, from the Centre for Constitutional Rights
He is only allowed to hear unclassified evidence against him.
The US Justice Department said it would appeal.
Barbara Olshansky of the Centre for Constitutional Rights said the judge's emphasis on the Geneva Conventions was a key point in his ruling.
"What people in the United States haven't realised is that if we don't comply with them, no other country is required to comply with them, looking at our example," Olshansky said. "That places our own soldiers at risk whenever they are fighting abroad."
US supports Bush
Justice Department spokesman Mark Corallo said the government stood behind President George Bush's assertion that the Geneva Conventions did not apply to members of al-Qaida and said with the ruling, "the judge has put terrorism on the same legal footing as legitimate methods of waging war".
Most of the 550 prisoners at Guantanamo were classified as enemy combatants before they arrived at the US prison camp.
It was only after a Supreme Court decision in June that allowed them to challenge their detentions in a federal court that the government established the Combatant Status Review Tribunals to evaluate their cases.
Hamdan's case went before the tribunals last month.
More than 300 of the cases have gone before the three-member tribunals but only one person has been released.
Rules must change
None of the detainees are allowed lawyers for the proceedings and they are allowed to hear only portions of the evidence against them.
In its decision, the court also said unless military commission rules were changed to conform to the Uniform Code of Military Justice, Hamdan should not be tried by the commissions and should be moved from a prison wing for those awaiting trial to the general population.
None of the detainees has been
allowed lawyers at hearings
The ruling suggests anyone deemed an enemy combatant whom the government wants to try must first go before a panel to determine whether he is a prisoner of war.
Hamdan is charged with conspiracy to commit war crimes, including attacking civilians and murder, but he says he never supported "terrorism" and was not an al-Qaida member.
He says he earned a pittance driving the al-Qaida leader bin Ladin.
Civil rights victory
Civil rights groups have condemned the military commissions because the panels are made up of military officers - many of whom have no judicial experience - and because defendants are excluded from hearings where classified evidence against them is raised.
"This is a clean victory," said Eugene Fidell, president of the National Institute of Military Justice, a non-government group. "He [Hamdan] is entitled to a full trial in a proper military court and it doesn't get any better than that.
Defendants are prevented from
hearing all the evidence
"This ruling rightly demolishes the Bush administration's argument that the Geneva Conventions did not universally apply to prisoners detained in Afghanistan," said Amnesty International in a statement.
"This ruling should put the final nail into the coffin of the military commissions," said Jamie Fellner, director of the US programme at Human Rights Watch.
"They should never have been created in the first place and their implementation has been a disaster."
Military lawyers have argued that Guantanamo detainees should not get prisoner-of-war status under the Geneva Conventions because they are not fighting for a state but for al-Qaida.
The judge responded by saying: "That argument is rejected."