Cambridge, Mass.

THE Obama administration wants to show that federal courts can handle trials of Guantánamo Bay detainees, and had therefore placed high hopes in the prosecution of Ahmed Khalfan Ghailani, accused in the 1998 bombings of American embassies in East Africa. On Wednesday a federal judge, Lewis Kaplan of the United States District Court in Manhattan, made the government’s case much harder when he excluded the testimony of the government’s central witness because the government learned about the witness through interrogating Mr. Ghailani at a secret overseas prison run by the C.I.A.

Some, mostly liberals and civil libertarians, applauded the ruling, saying it showed that the rule of law is being restored. But many conservatives denounced it as proof that high-level terrorists cannot reliably be prosecuted in civilian courts and should instead be tried by military commissions.

The real lesson of the ruling, however, is that prosecution in either criminal court or a tribunal is the wrong approach. The administration should instead embrace what has been the main mechanism for terrorist incapacitation since 9/11: military detention without charge or trial.

Military detention was once legally controversial but now is not. District and appellate judges have repeatedly ruled  most recently on Thursday  that Congress, in its September 2001 authorization of force, empowered the president to detain members of Al Qaeda, the Taliban and associated forces until the end of the military conflict.