Jeffrey Sterling, a former CIA officer, was indicted today for leaking classified information to New York Times reporter James Risen. The indictment shows that the federal government had access to their e-mail and phone contacts going back several years.

Sterling served on the Iran desk of the CIA in the 1990s, and oversaw a classified program aimed at sabotaging the development of its nuclear programming. He left the CIA in 2000 and sued for racial discrimination (he is African American) in a case that went all the way to the Supreme Court, which dismissed the suit on the grounds that litigating it could reveal state secrets. Sterling later battled the CIA over a memoir he hoped to write after the agency heavily redacted his proposed drafts.

The indictment accuses Sterling of leaking information and documents about a highly classified program to "Author A," who is almost certainly New York Times reporter James Risen, over the course of three years from 2001 to 2004. The program involved someone described as "Human Asset No. 1," a CIA operative managed by Sterling during his time at the agency, and the indictment says Sterling's disclosures to Risen about the program jeopardized the asset's cover.

The indictment shows, chillingly, that the federal government had been monitoring Risen and Sterlings' communications going back years. (Either that, or the feds recently grabbed copies of archived e-mails from Risen or Sterling's computer.) It quotes extensively from their e-mails to one another—including one in which Risen sent Sterling a copy of the proposal for his 2006 book State of War: The Secret History of the CIA and the Bush Administration—and notes the time and date of dozens of phone calls back and forth. According to the indictment, in 2003, Risen was preparing a story for the Times on the program Sterling had run, going so far as to speak repeatedly with the CIA's public affairs office. CIA officials met with Risen and "representatives of [his] employer" in April 2003, the indictment says, and urged them not to run the story, saying the human asset could be endangered. One month later, the Times notified the CIA that it had spiked the story.

But that didn't keep Risen from publishing it. One of the revelations in State of War involved something called Project Merlin, in which a Russian scientist was employed by the CIA to deliver inaccurate nuclear plans to the Iranians in the hopes of frustrating their efforts. But according to Risen, the operation was flawed because the designs actually included a lot of useful accurate information as well, and if the Iranians ever caught on they'd still be able to keep the good information after throwing out the bad. His description of Merlin tracks closely with the program described in the indictment.

Risen was subpoenaed by U.S. prosecutors in April for information about his sources for State of War. He resisted the request, but it's clear that the investigation was targeting Sterling.

The CIA fought Sterling's civil suit for years, successfully arguing that allowing it to go forward would risk disclosure of classified information. It evidently didn't object to a criminal prosecution that presumably carries the identical risk.

Risen did not immediately respond to an e-mail, and a Times spokeswoman declined to comment. Risen's attorney told Politico that he successfully fought the subpoenas, which were quashed by a federal judge in November, and that Risen didn't offer any information about his sources to investigators.

Read the whole indictment here.