In another low moment for American justice, a federal appeals court ruled on Tuesday that detainees held at the prison camp at Guantánamo Bay, Cuba, do not have the right to be heard in court. The ruling relied on a shameful law that President Bush stampeded through Congress last fall that gives dangerously short shrift to the Constitution.

The right of prisoners to challenge their confinement  habeas corpus  is enshrined in the Constitution and is central to American liberty. Congress and the Supreme Court should act quickly and forcefully to undo the grievous damage that last fall’s law  and this week’s ruling  have done to this basic freedom.

The Supreme Court ruled last year on the jerry-built system of military tribunals that the Bush administration established to try the Guantánamo detainees, finding it illegal. Mr. Bush responded by driving through Congress the Military Commissions Act, which presumed to deny the right of habeas corpus to any noncitizen designated as an “enemy combatant.” This frightening law raises insurmountable obstacles for prisoners to challenge their detentions. And it gives the government the power to take away habeas rights from any noncitizen living in the United States who is unfortunate enough to be labeled an enemy combatant.

The United States Court of Appeals for the District of Columbia Circuit, which rejected the detainees’ claims by a vote of 2 to 1, should have permitted the detainees to be heard in court  and it should have ruled that the law is unconstitutional.