Updated

A former senior official with the National Security Agency reached a plea agreement Thursday with the Justice Department, bringing a quick end to a case that pitted the government's need to keep secrets against the public's right to know.

Thomas Drake will plead guilty to exceeding authorized use of a computer, a misdemeanor, and the government will drop 10 felony counts that could have sent him to prison for the rest of his life, according to court documents. In return, prosecutors say they won't oppose a sentence that spares the 54-year-old Maryland man a prison term.

Drake was scheduled to appear in federal court in Baltimore on Friday morning, with formal sentencing likely to follow at a later date. The deal was struck after nearly a week of negotiations between prosecutors and Drake's defense attorneys, and averted what was expected to be a three-week trial.

The prosecution's case appeared to unravel after it announced in court files Sunday that it planned to withdraw some evidence rather than risk exposing an unidentified telecommunications technology targeted by the NSA's vast electronic spying network.

Had Drake been convicted in 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. Under the deal, Drake faces no more than one year in prison and supporters expect him to be sentenced only to supervised probation.

Those supporters say that if prosecutors had pursued the case, it would have discouraged government officials from reporting waste and abuse, especially in the U.S. intelligence community.

"The case clearly collapsed," said Jessalyn Radack of the Government Accountability Project, a whistle-blower advocacy group. "It was a case built on sand, and when the government was put to the test, I think it shows that whistle-blowers are not spies and that the Espionage Act is a particularly heinous tool that should never be used to cover up government wrongdoing and punish whistle-blowers who oppose it."

Justice Department spokeswoman Laura Sweeney declined to discuss the case.

In earlier court documents, William M. Welch II, the senior prosecutor, had warned that U.S. "national security would crumble if every individual could anoint himself a whistle-blower ... and immunize themselves from prosecution for the most damaging of classified information disclosures."

Under the agreement, the government and Drake agreed that if the case had gone to trial, prosecutors would have proved that from February 2006 through about March 2007, Drake intentionally logged into a system called NSANet, obtained official NSA information and provided it orally and in writing to another person who was not permitted or authorized to receive it.

Drake "knew that NSA restricted the use of and access to its computers and NSANet to official use only" when he accessed them, the plea documents said.

Court papers did not name the unauthorized person who received the information. But the indictment said Drake leaked to a newspaper reporter, identified in other court documents as Siobhan Gorman, who wrote an award-winning series of articles on the NSA for the Baltimore Sun. Spokeswoman Renee Mutchnik said late Thursday the paper had no comment.

Gorman, who now works at The Wall Street Journal, did not respond to a request for comment.

The NSA is one of the government's largest spy agencies, employing an army of linguists, cryptologists and computer experts to snoop on electronic communications across the globe from its headquarters at Fort Meade, Md., south of Baltimore. The need for secrecy is drilled into NSA employees, who sometimes joke the initials stand for "Never Say Anything," and "No Such Agency."

But from the start, the government appeared to struggle to craft a case that avoided the use of at least some of NSA's cherished secrets.

The last straw may have been U.S. District Judge Richard Bennett's recent decision, detailed in a June 5 letter from prosectuors, rejecting efforts to mask references to "NSA's targeting of a specific telecommunications technology" in six documents entered into evidence.

As a result, the prosecution said, it was withdrawing four of the documents and would eliminate any reference to the technology in two others.

The government never publicly described the classified documents it says it found in Drake's Maryland home, beyond their titles and the fact they were secret.

But the documents are thought to relate to the NSA's internal debate over TrailBlazer, an ill-fated project launched in 2002 to use contractors to overhaul the agency's vast computer systems to capture and screen information flooding into the agency's computers from the Internet and cell phones.

The project eventually cost $1.2 billion, but never worked as intended. It was ended in 2006.

Drake supported an in-house system that was much cheaper and which he said could have gathered critical information about al-Qaida before the Sept. 11, 2001, terrorist attacks. He was also critical of the NSA's domestic spying after 9/11.

On learning of the plea agreement, Steven Aftergood, head of the Federation of American Scientists' Project on Government Secrecy, said the government had overreached.

"The whole experience has been shattering," Aftergood said. "But I think the primary message is to the government that not every security infraction is or ought to be a federal case. You can break the rules without committing a felony. And the government should not overreact to every little deviation from the rules."

The government's decision to prosecute Drake in the first place surprised some supporters of President Barack Obama.

As a candidate, Obama called for a more open government and lauded federal workers who report wrongdoing. But his administration has aggressively tried to plug national security leaks, pursuing cases against five government leakers under espionage statutes, more than any of his recent predecessors.

___

Yost reported from Washington.