A federal judge ripped into U.S. prosecutors’ treatment of a former spy agency official accused of leaking classified material, calling delays in the now-closed case “unconscionable” and comparing it to British tyranny in the colonial era.

In 2007, FBI agents raided the house of Thomas Drake, then an official at the National Security Agency, but it took another two and a half years for officials to indict him, Judge Richard D. Bennett said at a sentencing hearing earlier this month in U.S. District Court in Baltimore, according to a transcript obtained by Secrecy News blog.

Thomas Drake, a former NSA official (Jacquelyn Martin/Associated Press)

Drake was given a mild penalty for exceeding authorized use of a computer: a year’s probation and 240 hours of community service. All 10 felony counts were dropped.

“That’s four years of hell that a citizen goes through,” Bennett said, according to the transcript. “It was not proper. It doesn’t pass the smell test.”

He went on: “I don’t think that deterrence should include an American citizen waiting two and a half years after their home is searched to find out if they’re going to be indicted or not. I find that unconscionable. Unconscionable. It is at the very root of what this country was founded on- against general warrants of the British.”

The prosecutor, William M. Welch III, who also headed the marred prosecution of former U.S. Sen. Ted Stevens (R-Alaska) on corruption charges, had asked that Drake be fined $50,000 to serve as a deterrent and to “send a message” to other government employees who might contemplate leaking material to reporters.

Welch also complained that Drake had received a $10,000 prize for whistleblowing, a reference to the Ridenhour Prize given to Drake in April.

“At a minimum, the fine ought to be $10,000, but I would urge the court to impose the $50,000,” Welch said.

But Bennett balked.

“There has been financial devastation wrought upon this defendant that far exceeds any fine that can be imposed by me. And I’m not going to add to that in any way,” said Bennett, who was nominated to the federal bench by then President George W. Bush in 2003.

In contrast with his tough words for Welch, Bennett singled out for praise Drake’s public defenders, James Wyda and Deborah L. Boardman, calling their work on behalf of Drake “at the highest level of professionalism.”

He said the matter was now closed and turned to Drake: “I wish you the best of luck in the rest of your life.”

In related news, Drake’s defense team on Friday filed a motion to remove restrictions on one of the documents that Drake was accused of unlawfully retaining so that they can challenge its classification. The team plans to call as an expert witness the former head of the organization that oversees the government’s entire classification system, J. William Leonard, former director of the Information Security Oversight Office.

The document — a memo from the NSA director praising work on a program to analyze and track electronic data — was classified by NSA. But in July 2010, three months after Drake was indicted, the government declassified it. Still, the document formed the basis for one of the felony counts against Drake.

Though the case is now closed, the defense wants to press the classification issue, hoping it will lead to the correction of an error in the classification system. Secrecy News’ Steve Aftergood said he hopes the action might catalyze a broader discussion about classification policy at the NSA and in government.

An earlier version of this story incorrectly said that Drake’s sentence of probation and community service was imposed for mishandling classified information.