Every day that young Genarlow Wilson remains in prison for consensual sexual activity is a further indictment against the prosecutors, lawmakers and judges of the Georgia legal system. Lawyers for Mr. Wilson have applied for a writ of habeas corpus to challenge his cruel and unusual 10-year sentence. The Superior Court should grant it.

When he was 17, Mr. Wilson received oral sex from a 15-year-old girl. For that, he has served over two years of a strict minimum decade-long prison term. He was convicted of aggravated child molestation, a charge intended for adult sexual predators. If Mr. Wilson had engaged in sexual intercourse with the same girl, it would have been a misdemeanor under an exemption for contact between minors. Oral sex was left out. Legislators have since corrected the unintended trap. If Mr. Wilson engaged in the same action today, it would be a misdemeanor.

The Board of Pardons and Paroles is legally prohibited from granting clemency for this offense. And the State Senate adjourned for the year without taking up a bill that would have allowed judges to review sentences in cases like Mr. Wilson’s.

The behavior of the district attorney, David McDade, requires particular scrutiny. He charged Mr. Wilson with raping a different girl at the same party, and a jury acquitted him in 2005. Mr. McDade has distributed a graphic videotape of the events in that case to legislators as part of a lobbying effort at the State Senate against Mr. Wilson’s release. And Mr. McDade went on television last month and said, referring to Mr. Wilson and others involved, “Six young men basically gang-raped a 17-year-old.”