Most eyes this week were on the financial crisis and the presidential debate, but there was another big story out of the US on Tuesday: a federal judge in Washington ordered, for the first time, that a group of detainees from Guantanamo Bay should actually be freed from detention and produced before him in court.

It’s taken time, but judges have been gradually eating away at the set of legal fictions supporting the Guantanamo detention regime. Claims that the territory is not subject to US jurisdiction, that the Geneva Conventions do not apply to “enemy combatants”, that the executive has inherent powers to detain whomever it wants and that military commissions are not subject to judicial review, have all been rejected by the courts.

In the case of the present group of 17 detainees, the Bush administration has given up trying to show that they were “enemy combatants”; in fact they are Uighur refugees from Xinjiang, swept up in Afghanistan in 2002. An earlier hearing had found that accusations against them “were based on bare and unverifiable claims”.

Now equipped (since the supreme court decision in Boumediene v. Bush) with the power to hear habeas corpus petitions for detainees, Judge Ricardo Urbina ruled that “the moment has arrived for the court to shine the light of constitutionality on the reasons for detention”. “Habeas corpus” just means “that you have the body”: the purpose of the writ is for a prisoner to be brought to court so it can judge the legality of their detention.

Judge Urbina was doing his job.

The administration, of course, was not happy, and last night its lawyers secured a court order putting the decision on hold until they can prepare an appeal. Eventually this case, or others like it, will probably end up back in the Supreme Court.

Which provides a reminder of one of the most important issues at stake in next month’s election: judicial appointments, and the way the religious right in particular has made it its priority to stack the judiciary with its political partisans.

Although the courts have curbed some of the worst excesses of “war on terror”, it has not been without resistance: at each step the administration has been willing to argue for the most amazingly broad interpretations of executive power, and increasing numbers of its own appointees have been there to go along.

With four Supreme Court judges out of nine (Roberts, Scalia, Thomas and Alito) being pretty firmly in the Bush administration’s pocket, only one more vote is required to start a judicial revolution. If John McCain is making the next appointment, the court’s most fundamental decisions on civil liberties, from Boumediene v. Bush back to Roe v. Wade and even Brown v. Board of Education, could all be at risk.