In a surprise deal with prosecutors yesterday, convicted spy Brian P. Regan accepted a sentence of life in prison for trying to sell secrets to Iraqi dictator Saddam Hussein in exchange for an agreement not to prosecute his wife, who authorities say may have obstructed justice to help her husband.

Regan, a former Air Force intelligence analyst, was convicted last month of trying to sell classified documents to Iraq and China and of breaking the law against gathering national defense information. He was acquitted on a fourth charge of trying to spy for Libya.

Prosecutors, arguing that Regan had done major damage to national security, tried to make him the first espionage defendant executed in the United States in a half-century. But the 12-member jury determined that Regan was ineligible for the death penalty.

Law enforcement sources said Regan's wife, Anette, is suspected of trying to help him devise a cover story to explain his espionage and might have been charged with obstruction of justice. There is no evidence that she aided the spying, sources said.

"He tried to enlist her services to help him, to help his case," one source said. According to sources and court documents, Regan tried to contact his wife after his arrest, in violation of court-ordered measures mandating that such contact be monitored by the FBI.

Anette Regan did not return phone calls, and defense lawyers declined to comment. But Brian Regan, wearing a green prison jumpsuit and speaking in a hushed, quavering voice, told the court yesterday that he accepted the life sentence, with no chance of parole, "to protect my wife and children from any more pain and suffering."

"If it wasn't that they were going to prosecute my wife, but they are," he said. After apologizing for his actions, Regan added that he felt the sentence was excessive. "I'm going to serve more time than any other spy ever," he said. "I never attempted to harm the United States."

But U.S. District Judge Gerald Bruce Lee said he felt the sentence was justified and that Regan's spying was "a disgrace to the uniform of the men and women in the armed forces."

Paul J. McNulty, the U.S. attorney in Alexandria, added that Regan's spying constituted "an egregious breach of national trust."

Regan had been scheduled for sentencing May 9. He could have received up to life in prison, but the life sentence was not mandatory.

Last month, the impending U.S. war against Iraq formed part of the backdrop for the two-week trial in federal court in Alexandria. Government witnesses told jurors that the information Regan was carrying when he was arrested, including the encrypted coordinates for an Iraqi surface-to-air missile site, could have helped Iraq better hide its missile systems and more easily shoot down U.S. planes. But defense witnesses said the information would have no value to Baghdad.

The sentencing agreement -- which also included a provision that Regan's wife will get a portion of his military pension worth less than $10,000 a year -- was the latest twist in a case that has been unusual from the start. Regan, 40, a father of four from Bowie who worked at the National Reconnaissance Office in Chantilly, was arrested in August 2001 at Dulles International Airport as he boarded a plane to Switzerland. In his pockets were the encrypted coordinates of missile sites in both Iraq and China.

Espionage cases rarely go to trial, in part because the government often seeks to strike a plea deal to obtain more information about the damage done and to guard against the release of sensitive data.

The government's decision to seek the death penalty for Regan, opposed even by some government officials, made the case an example of Attorney General John D. Ashcroft's efforts to push prosecutors nationwide to seek death for various crimes. Defense attorneys argued that far more renowned spies, such as the FBI's Robert P. Hanssen and the CIA's Harold J. Nicholson, did not face execution.

"I'm going to serve more time than any other spy ever," Brian P. Regan said.Brian P. Regan, convicted last month of spying for Iraq and China, was scheduled to be sentenced in May.