Last week, ex-CIA operative Douglas Fred Groat faced trial for espionage and possible execution. Today he is looking at five years in a medium-security prison and a full CIA pension.

The decision by federal prosecutors to accept Groat's plea to a lesser charge Monday reflects the difficult choice they faced as they prepared for trial. They might have won a full conviction but at the cost of making public some of the same secrets they were accusing Groat of stealing.In the end, protecting national security trumped punishing alleged transgressors. Federal prosecutors dropped the four counts of espionage against Groat - including charges that he told two foreign governments that the CIA had cracked their coded communications - and accepted a guilty plea to the charge of extortion.

Groat, who worked for the CIA from 1980 to 1996, admitted to trying to pry $1 million from the agency in exchange for his silence about government eavesdropping operations. Groat agreed to help the government sort out the damage to national security he may have done. And he agreed to submit any books, articles or interviews to federal officials for security review.

U.S. Attorney Wilma Lewis, in a statement following the hearing, said the plea agreement "gives law enforcement the ability to assess the extent of the defendant's activity in a quick and effective manner while protecting the national security of the United States by limiting public disclosure of highly classified information that would be required in a trial."

CIA Director George Tenet called the plea agreement a "successful conclusion" to a case whose implications to U.S. spy operations are still being assessed.

"Mr. Groat's arrest and his subsequent plea demonstrate that the U.S. government will take action against those individuals who would violate the nation's trust by attempting to blackmail the government by threatening to disclose secrets," Tenet said.

Also working in Groat's favor was the government's difficulty in sorting out just what secrets he may have given away, said a U.S. government official, who spoke on condition of anonymity.

"The key was to get his cooperation and to help us resolve outstanding questions about what he did, who he told what to," the official said.