The Sept. 11, 2001, terrorist attacks left the World Trade Center in ruins, thousands dead and a stunned nation fearful of what might come next.

In a series of secret actions, the administration of George W. Bush charted a new course to try to prevent more attacks. Dozens of suspected terrorists were spirited off to secret sites for years. Many were tortured by C.I.A. interrogators. No lawyers. No right to remain silent. No Geneva Conventions.

Khalid Shaikh Mohammed, who would later be accused of devising the plot, was stripped naked, rectally abused and waterboarded 183 times. A psychologist threatened to kill his son if more children died in attacks by Al Qaeda.

The agency kept its captives in solitary confinement as it questioned them hundreds of times, effectively training them to believe that if they did not talk, they would be tortured more.

Now, 25 years later, the costs and trade-offs made then are still reverberating in the agonizing wait for a trial in a faraway military court where the legacy of torture hangs over the Sept. 11 case.

Military judges have now thrown out all of the key confessions in the death penalty cases at Guantánamo Bay because the defendants were tortured by the C.I.A.