The National Security Agency official, Thomas A. Drake, had faced a possible 35 years in prison if convicted on felony charges under the Espionage Act. Instead, he agreed to admit to a misdemeanor of misusing the agency?s computer system by providing ?official N.S.A. information? to an unauthorized person, a reporter for The Baltimore Sun. Prosecutors said in the written plea agreement that they would not oppose a sentence under which Mr. Drake would serve no time.

A formal plea hearing was set for Friday morning in Baltimore. The presiding judge, Richard D. Bennett of the district court, could impose a sentence of up to a year in prison. But legal experts said it would be highly unusual to impose a prison term when the Justice Department was not seeking incarceration.

The deal represented the almost complete collapse of the government?s effort to make an example of Mr. Drake, who was charged last year in a 10-count indictment that accused him of obstructing justice and lying to investigators. It is uncertain whether the outcome will influence the handling of three pending leak cases or others still under investigation.

The case against Mr. Drake is among five such prosecutions for disclosures to the news media brought since President Obama took office in 2009: one each against defendants from the National Security Agency, the C.I.A., the F.B.I., the military and the State Department. In the past, such prosecutions have been extremely rare ? three or four in history, depending on how they are counted, and never more than one under any other president.

Officials say they have been prompted by a bipartisan belief in Congress and in both the George W. Bush and Obama administrations that leaks were getting out of hand.

The flurry of criminal cases has led to both praise and criticism for Mr. Obama, who entered office promising unprecedented transparency but in less than three years in office has far outdone the security-minded Bush administration in pursuing leaks. Some political analysts say Mr. Obama?s liberal credentials may give him political cover for the crackdown.

The Drake case was seen as a test of the tougher line against unauthorized disclosures. But news media coverage of the charges against Mr. Drake, 54, an introspective computer specialist, has highlighted his motivation for sharing information about N.S.A. technology with a reporter for The Baltimore Sun in 2006 and 2007: the agency was rejecting a $3 million in-house program called ThinThread in favor of a $1-billion-plus contractor-run program called Trailblazer. His supporters have portrayed him as a diligent public servant who was trying to save taxpayers? money and strengthen national security, not damage it.

To make it easier to convict him, prosecutors shifted strategies last year and decided to charge him not with giving information to the Sun reporter, Siobhan Gorman, now at The Wall Street Journal, but with illegally holding classified documents at home.

But after Judge Bennett ruled last week that the government would have to show some of the allegedly classified material to the jury, prosecutors on Sunday withdrew four of the documents and redacted information from two others about ?N.S.A.?s targeting of a particular telecommunications technology.?

That undermined much of the case, leading prosecutors to make a series of last-minute plea offers. Friends said Mr. Drake resisted during long hours of negotiations because he did not want to admit to a crime, however minor, that he believed he had not committed.

Mr. Drake?s lawyers, James Wyda and Deborah Boardman of the federal public defender?s office, declined to comment. But Jesselyn A. Radack, a lawyer for the nonprofit Government Accountability Project who had rallied support for Mr. Drake, hailed the outcome.