A former government space scientist pleaded guilty Wednesday to one count of attempted espionage for trying to sell classified information to an undercover FBI agent posing as an Israeli spy.

Stewart David Nozette entered the plea in federal court, where both the Justice Department and Nozette's lawyers agreed to a sentence of 13 years in prison, with credit for two years he has already spent behind bars. U.S. District Judge Paul Friedman said he was prepared to accept the deal, pending Nozette's cooperation with prosecutors, a procedure expected to last into November.

Nozette has been in jail since he was arrested nearly two years ago after an undercover sting operation. He was accused of seeking millions to sell secrets to an FBI agent posing as an Israeli intelligence officer.

Appearing in court in a prison jumpsuit, Nozette said he understood the charge to which he was pleading. He could have been sentenced to death had he been convicted of all four counts of attempted espionage that he faced.

Just before his arrest, Nozette told an undercover FBI agent in the sting operation that the secrets he was passing to Israel had cost the U.S. government anywhere from $200 million to almost a billion dollars to develop.

"So I tell ya ... theoretically I should charge you certainly, you know, at most" 1 percent, court papers in the case quoted Nozette as telling the agent.

Nozette had high-level security clearances during decades of government work on science and space projects at NASA, the Energy Department and the National Space Council in President George H.W. Bush's White House. He has a doctorate in planetary sciences from the Massachusetts Institute of Technology and was known primarily as a defense technologist who had worked on the Reagan-era missile defense shield effort formally called the Strategic Defense Initiative. He also helped discover evidence of water on the moon.

Because Nozette knows so many secrets, including about the nation's nuclear missile program, Attorney General Eric Holder ordered special communications restrictions placed on him in jail.

During a hearing after his arrest, the prosecutor played video from the September 2009 sting in which Nozette lounged on a hotel room couch, eating and laughing with the undercover agent. He discussed the possibility of having to flee the country if he came under scrutiny.

Prosecutors say Nozette agreed to provide regular information to the Israeli intelligence agency, Mossad, through a post office box in exchange for money. They accuse him of asking for an Israeli passport and payments in cash under $10,000 each to avoid reporting it. Authorities said he took two payments -- one for $2,000 and another for $9,000 -- from the post office box to answer questions about U.S. satellites, including early warning systems, means of defense or retaliation against large-scale attack, communications intelligence information and major elements of defense strategy.

Nozette also ran a nonprofit corporation out of his Chevy Chase, Md., home called the Alliance for Competitive Technology that had several agreements to develop advanced technology for the U.S. government.

In January 2009, he pleaded guilty to two counts of tax evasion and admitted overstating his costs for reimbursement and failing to report the income on his tax returns. His sentencing in that case has been held while the espionage charges have been pending.