By Paul Reynolds
World Affairs correspondent, BBC News website
The US Supreme Court's decision to strike down the military tribunals at Guantanamo Bay perhaps heralds the beginning of what will be a long-drawn out endgame for the camp.
Many Guantanamo detainees have been held for years
Ironically, the ruling might make this endgame even longer, because the likely outcome is that the Bush administration will have to get an agreement with Congress on how to try those suspects who would otherwise have faced the tribunals - or "commissions" as they are called.
It may be that a new form of commission will be set up, one that more closely complies with the rules of the US military justice code.
This is the route advocated by Justice Stevens, who wrote the majority opinion. The rules as currently drawn up, he declared, were "illegal".
By that he meant that the safeguards available in the military code for a court martial were superior to those available under a commission. And he slapped down the executive's right to make such rules by itself.
But getting congressional agreement will take time.
In the meantime, the tribunal planned for Osama Bin Laden's former driver Salim Ahmed Hamdan, who brought this case, is no more. Nine other prisoners are also off the immediate hook.
These prisoners include one who is well known internationally, the Australian David Hicks, but also defendants from Yemen, Saudi Arabia, Algeria, Sudan, Ethiopia and Afghanistan.
So what will the US government do with the prisoners?
White House Spokesman Tony Snow said after the ruling that about 100 of the 450 detainees are listed to be returned to their own countries. But there is a problem there.
Some of them are enemies of their own governments - those from Saudi Arabia and Afghanistan for example. They cannot just be sent back to an unknown fate.
The 10 slated for trial under the commissions were due to be followed by about 60 others. All that is now up in the air.
As for the rest, no decisions had been taken. Some might be deemed too dangerous to be freed.
But if the US courts intervene again, some might have to be freed.
It is possible that prisoners will now try to enforce the right they were given by the Supreme Court in 2004, that they could argue a habeas corpus case in front of a federal court within the United States.
Under this rule, someone holding a prisoner has to justify that detention in front of a court. How effective that might be remains to be seen.
Defence lawyers are jubilant though. "The twin pillars of the administration's position have been knocked down," said Eric Freedman of the Hofstra Law School in New York.
Professor Freedman, a consultant to Mr Hamdan's defence team, told the BBC news website: "The first pillar was the government could hold people without any hearing. The 2004 Supreme Court ruling struck that down. The second was the military commissions were the way forward. Now that has gone, too."
President Bush is left with difficult decisions. He has already signalled that he wants to close the camp, thereby setting an agenda for a discussion about the means to do this, but has not said how or when it can be achieved.
He has also said, and repeated after the Supreme Court ruling, that he would not "jeopardise the safety of Americans" by simply opening its doors.
But with the long arm of the courts reaching out further and further into what was supposed to be an isolated enclave protected from US and international law, his options are narrowing.
Checks and balances
There are other aspects of the judgment that are also important.
Along the way, the court ruled that the Geneva Conventions did apply to Guantanamo. It stated that the commission as proposed "lacked the power to proceed" because it violated the conventions.
It also stated that Article 3 of the Geneva Conventions (it is common to all of them) should apply to Guantanamo. This holds that anyone detained should be treated properly.
Historically, the judgment will also be seen as a major decision in the ever-delicate balancing of power between the three branches of the US system - the executive, the legislature and the judiciary.
A key part of this judgment was articulated by Justice Stevens who declared: "The military commission at issue is not expressly authorised by any congressional act."
So in this instance the judiciary intervened to rein in the executive and handed power back to the legislature.
This decision will echo down the years.