A New York Times reporter whose book is at the center of a criminal leak case against a former CIA officer accused of being one of his sources cannot invoke a reporter’s privilege and refuse to testify at the officer’s trial, a federal appeals court ruled Friday.

In a divided decision that will probably rile journalists across the country, a three-judge panel of the U.S. Court of Appeals for the 4th Circuit ruled that reporter James Risen can be forced to testify at the trial of former CIA officer Jeffrey Sterling, who is charged with 10 felony counts in a federal leak case. The majority of judges ruled, effectively, that neither the First Amendment nor common law offers protection to journalists who promise anonymity to their sources from having to testify about them in criminal proceedings.

“There is no First Amendment testimonial privilege, absolute or qualified, that protects a reporter from being compelled to testify by the prosecution or the defense in criminal proceedings about criminal conduct that the reporter personally witnessed or participated in, absent a showing of bad faith,” Chief Judge William B. Traxler wrote.

The decision was not unanimous. Judge Roger L. Gregory wrote in a dissent that “freedom of the press is one of our Constitution’s most important and salutary contributions to human history.” He argued that case law had created a sort-of “reporter’s privilege” not to reveal sources in certain instances, taking into consideration “the harm caused by the public dissemination of the information” and the “newsworthiness of the information conveyed.”

“Even in ordinary daily reporting, confidential sources are critical,” Gregory wrote.

Some experts said the ruling essentially affirms the status quo, while news media advocates said it might have a chilling effect on the willingness of people to leak information in a climate where leakers already are vigorously pursued.

“It won’t encourage people to come forward, but the chill was already on,” said Gregg Leslie, legal defense director for the Reporters Committee for Freedom of the Press.

The ruling overturns, in part, an earlier decision by a U.S. District Court judge who quashed a subpoena compelling Risen to testify. Joel Kurtzberg, Risen’s attorney, said in a statement that Risen is evaluating his next steps.

“We are disappointed by and disagree with the Court’s decision,” he said.

Sterling, a former CIA agent who was assigned to a classified program meant to impede Iran’s efforts to acquire nuclear weapons, was indicted in 2010 for unauthorized retention and communication of national defense information, obstruction of justice and other counts. He is accused of being a source for Risen’s book, “State of War.”

The case has stalled as Risen has fought prosecutors’ attempts to compel his testimony. That testimony is crucial to the case of the prosecutors, as Risen was the “only eyewitness to the crime,” Traxler wrote.

“He is inextricably involved in it,” Traxler wrote. “Without him, the alleged crime would not have occurred, since he was the recipient of illegally-disclosed, classified information.”

Neither Sterling nor Risen have confirmed publicly that Sterling was a source for the book. Because Risen has been granted immunity for his testimony, he cannot invoke the Fifth Amendment to decline to testify, Traxler wrote.

Peter Carr, a Justice Department spokesman, said in a statement: “We agree with the decision. We are examining the next steps in the prosecution of this case.”

Attorneys for Sterling said the subpoena of Risen was not a dispute they had taken a position on, though one of the attorneys, Edward MacMahon, called the ruling “ironic” in light of President Obama’s endorsement of a federal shield law.

Traxler sent the case back to U.S. District Court in Alexandria for further proceedings, though that does not guarantee it will now proceed. Barry J. Pollack, another of Sterling's attorneys, said his client, who lives in the St. Louis area, is “probably going to remain in limbo even longer as the fight between the Department of Justice and Mr. Risen continues.” He said Risen could appeal the ruling to the full appeals court or to the Supreme Court.

Traxler’s decision seemed to leave that door open.

“If Risen is to be protected from being compelled to testify and give what evidence of crime he possesses, in contravention of every citizen’s duty to do so, we believe that decision should rest with the Supreme Court . . . or with Congress,” he wrote.