Jeffrey Sterling, the former CIA agent convicted under the Espionage Act for talking to a New York Times reporter, has been released from prison after serving more than two years of his 42-month sentence, and is now in a halfway house.

Sterling’s case drew nationwide attention because the Obama-era Department of Justice unsuccessfully tried to force the reporter, James Risen, to divulge the identity of his sources for “State of War,” a book in which he revealed the CIA had botched a covert operation against Iran’s nuclear program. Risen reported that instead of undermining the Iranians, the CIA had provided them with useful information on how to build a nuclear bomb. (Risen is now The Intercept’s senior national security correspondent and directs First Look Media’s Press Freedom Defense Fund.)

The case had a racial dimension, too. Sterling, who had joined the agency in 1993, was one of the few black undercover operatives at the CIA. After several years of what he believed was discriminatory treatment, he filed a complaint against the agency, and then a lawsuit. The CIA fired Sterling in 2002, and his lawsuit was blocked by the courts after the government argued successfully that proceeding with the suit would expose state secrets.

Sterling subsequently met with Senate investigators as a whistleblower about the mismanagement of a classified program he worked on at the agency, the same Iranian program that Risen wrote about in his book. Risen had interviewed Sterling in 2002 for an article about his discrimination lawsuit — but Sterling has denied talking to Risen about the Iranian program. In 2011, when Sterling was arrested, the government’s indictment accused him of leaking about Iran out of “anger and resentment.”

The key evidence that persuaded a jury to convict Sterling on nine felony counts consisted of phone records and emails that showed Sterling and Risen had communicated with each other. However, those records did not disclose anything about the content of their conversations. All the government knew, and all the jury knew, is that they had communicated. At Sterling’s sentencing in 2015, Judge Leonie Brinkema acknowledged that “in a perfect world, you’d only have direct evidence, but many times that’s not the case in a criminal case.” She described the phone and email records as “very powerful circumstantial evidence.”

After the guilty verdict, Sterling requested that he serve his sentence at a prison near St. Louis, where he lived with his wife. The government sent him to a prison in Colorado. Earlier this week, he was released from that prison and has been assigned to a halfway house in St. Louis.

Top photo: Former CIA officer Jeffrey Sterling arrives at the U.S. District Court in Alexandria, Va., Monday, May 11, 2015.