Washington (CNN) -- A federal court ruled on Friday that New York Times reporter and author James Risen will have to testify in the trial of a former CIA officer charged with leaking him classified information.
A divided three-judge panel of the United States Court of Appeals Fourth Circuit handed down the ruling that Risen will have to testify in the case of Jeffrey Alexander Sterling, who allegedly gave Risen classified information about efforts to stop Iran from developing nuclear weapons.
The ruling reversed the decision by the trial judge in Sterling's case and is sure to add to the debate about press freedoms and the Obama administration's prosecution of leak cases.
The Justice Department said it agreed with the decision.
"We are examining the next steps in the prosecution of this case," spokesman Peter Carr said.
The appeals court panel ruled that the First Amendment does not provide a shield from testimony about leaks of classified information.
Chief Judge William Traxler Jr. said in the opinion only Risen could provide key proof in the case.
"Indeed, he can provide the only first-hand account of the commission of a most serious crime indicted by the grand jury -- the illegal disclosure of classified, national security information by one who was entrusted by our government to protect national security, but who is charged with having endangered it instead," Traxler wrote. "The subpoena for Risen's testimony was not issued in bad faith or for the purposes of harassment."
Judge Roger Gregory was in the minority and said Risen should be protected from testifying.
"The majority exalts the interests of the government while unduly trampling those of the press, and in doing so, severely impinges on the press and the free flow of information in our society," wrote Gregory.
The indictment against Sterling was unsealed in January 2011. It included Espionage Act charges that he revealed national defense information.
His case has not gone to trial and has been delayed while both sides waited for the appeals court to rule. The three-judge panel heard arguments in Richmond in May 2012.
Taxler wrote that in November 1998, the CIA assigned Sterling to a highly classified program intended to impede Iran's efforts to acquire or develop nuclear weapons. He was reassigned in 2000 and told he had not met performance targets.
Sterling, who is African-American, resigned from the CIA in January 2002 and filed a suit against the agency, alleging racial discrimination. He had previously filed an administrative complaint that the CIA had not given him certain assignments due to his race.
The complaint and the suit were both dismissed.
Prosecutors allege that Sterling leaked information to a reporter because he was unhappy about his treatment at the CIA.
Risen allegedly used information leaked to him by Alexander about Iran in a 2006 book the reporter wrote, "State of War."