BALTIMORE – The Justice Department on Thursday reached a plea agreement in a leak case against a former National Security Agency official who allegedly passed classified documents to a reporter.

In court papers, the government said Thomas Drake will plead guilty to exceeding authorized use of a computer, a misdemeanor.

The government’s case had been significantly weakened by its decision in recent days to withdraw some evidence rather than risk exposing secret details of an NSA operation.

Drake’s lawyers claim he is a beleaguered whistleblower who leaked unclassified information in an effort to expose waste and abuse at the NSA.

Had Drake been convicted at a trial, he could have faced up to 35 years in prison on charges of obstruction of justice, lying to the FBI and illegal possession of classified NSA documents under the seldom-used Espionage Act of 1917, even though he was not charged with spying.

The court documents in the plea deal say the government will not oppose a sentence that calls for no jail time.

In late 2005, Drake contacted Siobhan Gorman, then a Baltimore Sun reporter, who wrote an award-winning series on the NSA and Trailblazer, an ill-fated project launched in 2002 to overhaul the agency’s vast computer systems to capture and screen information flooding in from the Internet and cell phones.

The $1.2 billion Trailblazer program eventually failed, and the NSA abandoned it in 2006.

Drake supported an in-house system that was much cheaper and he said could have gathered critical information before the Sept. 11, 2001, terrorism attacks.