A former CIA officer has been convicted of leaking classified details of a U.S. operation to thwart Iran's nuclear ambitions to a New York Times reporter.

Jeffrey Sterling, 47, from O'Fallon, Missouri, was found guilty of all nine counts he faced in federal court in Virginia on Monday.

The decision came just hours after the jury, which had been deliberating for three days, told the judge they could not reach a unanimous verdict - but the judge urged them to keep talking.

Throughout the two-week trial they had been trying to determine who had told journalist James Risen about the secret mission, which he wrote about in his 2006 book State of War.

Who was his source? New York Times reporter James Risen, pictured, wrote about a secret operation in 2006, and on Monday, former CIA officer Jeffrey Sterling was found guilty of leaking the information to him

Former Secretary of State Condoleezza Rice had testified the mission was one of the government's most closely held secrets and one of its best chances to thwart Iran's nuclear-weapons ambitions.

Prosecutors had fought to force Risen to divulge his sources for years, but they decided not to call him to testify once it became clear he would not reveal his sources even if jailed for contempt of court.

Prosecutors acknowledged a lack of direct evidence against Sterling but said the circumstantial evidence against him was overwhelming. They claim he divulged the secrets because he was bitter about his treatment at the agency.

But defense lawyers argued that the evidence showed that Capitol Hill staffers who had been briefed on the classified operation were more likely the source of the leak.

Shock: Former Secretary of State Condoleezza Rice, pictured last year, testified the mission was one of the government's most closely held secrets and one of its best chances to thwart Iran's nuclear-weapons

The plan involved using a CIA asset nicknamed Merlin, who had been a Russian nuclear engineer, to foist deliberately flawed nuclear-weapons blueprints on the Iranians, hoping they would spend years trying to develop parts that had no hope of ever working.

Questions: Sterling described the mission as hopelessly botched in his 2006 book, pictured

In State of War, Sterling described the mission as hopelessly botched, and possibly backfiring by giving the Iranians blueprints that could be useful to them if they sorted out the good information from the errors.

In his closing arguments, prosecutor Eric Olshan said the chapter of Risen's book seemed to be clearly written from Sterling's perspective as Merlin's case handler and cast him in a flattering light.

The book describes the handler's misgivings about the operation while others at the CIA push the plan through despite its risks.

Furthermore, Sterling, who was fired from the CIA in 2002, believed he had been mistreated and was angry that the agency refused to settle his racial discrimination complaint, Olshan said.

Risen had written about that complaint, and he was known to have a relationship with Sterling. The two exchanged dozens of phone calls and emails, Olshan said.

But defense lawyers said the government had no evidence that Risen and Sterling talked about anything classified in those phone calls and emails.

The government failed to obtain Risen's records to see who else he may have contacted.

Defense attorney Barry Pollack said Risen first got wind of the operation in early 2003, within weeks of Sterling reporting his misgivings to staffers at a Senate intelligence committee - a channel that Sterling was legally allowed to pursue.

Pollack said it makes more sense that a Hill staffer leaked to Risen.