"The (Uniform Code of Military Justice) conditions the president's use of military commissions on compliance not only with the American common law of war, but also with the rest of the UCMJ itself," Justice Stevens writes. "The procedures that the government has decreed will govern (detainee Salim Ahmed) Hamdan's trial by commission violate these laws."
Joining Justice Stevens' opinion were Justices Anthony Kennedy, David Souter, Ruth Bader Ginsburg, and Stephen Breyer.
Justices Antonin Scalia, Clarence Thomas, and Samuel Alito dissented, saying the court lacked jurisdiction to take up the case. In a second dissent on the merits, Justice Thomas said the court owed the president "a heavy measure of deference."
"The court's evident belief that it is qualified to pass on the military necessity of the commander in chief's decision to employ a particular form of force against our enemies is so antithetical to our constitutional structure that it simply cannot got unanswered," Thomas writes.
Chief Justice John Roberts did not participate in the case because he was part of a three-judge federal appeals court panel that ruled on the same case in the Bush administration's favor last July.
On Thursday, the high court overturned that earlier ruling.
The decision comes in the case of Salim Ahmed Hamdan of Yemen, who is alleged to have worked as a driver and bodyguard for Osama bin Laden. Mr. Hamdan is one of 10 detainees at Guantánamo facing war crimes trials before a military commission.
Defense officials say 65 more detainees are under consideration for commission trials.
Overall, there are some 450 detainees at the controversial detention facility. US allies in Europe and the UN's Committee Against Torture have urged the US to close the detention camp. Critics say harsh treatment of detainees at the camp has tarnished America's image as a champion of international human rights.