In reaching a plea deal to end the prosecution of Omar Khadr, a former child soldier held at the Guantánamo Bay, Cuba, detention center, the Obama administration achieved its political goal of avoiding having this disturbing case be the first to go to trial under its revamped military commissions. But this is not a legal victory anyone can feel proud about.

Mr. Khadr, a 24-year-old Canadian, was captured in Afghanistan when he was 15. He was thrown into armed conflict by his Al Qaeda-linked father, who was killed by Pakistani forces in 2003. As part of the plea deal, Mr. Khadr admitted that he threw a grenade that killed an American soldier during a 2002 firefight and that he planted roadside bombs. In exchange, his sentence was capped at eight years. After a year, he will be allowed to transfer to Canada to serve the remainder of his term.

It is hard to know what to make of Mr. Khadr’s admission of guilt. It may be truthful or driven by a fear that going to trial would mean a life sentence.

That concern became more acute following an appalling pretrial ruling by the military judge. He refused to exclude from evidence incriminating statements obtained under coercive and abusive circumstances by Mr. Khadr’s interrogators  including someone who implicitly threatened the frightened and severely wounded youngster with gang rape and was later convicted of detainee abuse in another case.