ALEXANDRIA, Va. — After losing a seven-year legal battle, James Risen, a reporter for The New York Times, reluctantly took the witness stand in federal court here on Monday, but refused to answer any questions that could help the Justice Department identify his confidential sources.
Mr. Risen said he would not say anything to help prosecutors bolster their case against Jeffrey A. Sterling, a former C.I.A.officer who is set to go on trial soon on charges of providing classified information to Mr. Risen for his 2006 book, “State of War.”
The Justice Department first subpoenaed Mr. Risen to testify in the case against Mr. Sterling in 2008, and Attorney General Eric H. Holder Jr. authorized the subpoena again in 2011. The attempt to force Mr. Risen to disclose his sources has come to symbolize the Obama administration’s crackdown on government officials who talk to reporters about national security matters.
The hearing in Federal District Court was intended to preview what Mr. Risen would say if prosecutors ordered him to testify. Mr. Risen, who in a speech last fall called Mr. Holder “the nation’s chief censorship officer,” struggled at times to hide his disdain for the prosecutors asking him questions.
“I am not going to provide the government with information that they seem to want to use to create a mosaic to prove or disprove certain facts,” he said.
In his book, Mr. Risen describes a botched C.I.A. operation in which the agency provided flawed schematics to Iran in hopes of delaying its nuclear program. The book suggests that the Iranians spotted the design flaw and could have easily worked around it.
Prosecutors believe that Mr. Sterling revealed the operation to Mr. Risen. But while they have phone records and emails between the two men, the case is largely circumstantial, and prosecutors say they need Mr. Risen’s cooperation to win it. Because of this, Mr. Holder authorized prosecutors to renew previous efforts to subpoena Mr. Risen and demand his testimony.
Mr. Risen fought the subpoena to the Supreme Court and lost, but said he would still not reveal his sources. And as the case has gone on, the Obama administration’s leak crackdown provoked a backlash among journalism groups and civil rights advocates. They criticized the Justice Department for its treatment of Mr. Risen as well as for subpoenaing phone records from The Associated Press, labeling one Fox News reporter a criminal co-conspirator and seeking grand jury testimony from another.
Mr. Risen, in the speech last fall at Colby College, noted that many of the most controversial aspects of the government’s response to the Sept. 11 terrorist attacks — drones, waterboarding, secret prisons, prison abuses in Iraq and more — took place in secret.
“If you took away all the things that the press revealed to begin with in the war on terror, you would know virtually nothing about the history of the last 13 years,” he said. He said that the government was less likely to prosecute leaks of classified information that made the government look good, such as the successful mission to kill Osama bin Laden.
“Stay on the Interstate highway of conventional wisdom with your journalism, and you will have no problems,” he said. “Try to get off and challenge basic assumptions, and you will face punishment.”
Mr. Holder, meanwhile, began second-guessing the Justice Department’s tactics. He rewrote the guidelines under which reporters could be subpoenaed. He said the crackdown had, at times, gone too far. And he said he regretted approving documents that labeled a reporter a criminal co-conspirator.
“When you realize your legacy is the guy who tried to put people in jail for holding the government accountable, you can see why you might want to backpedal,” said Gregg Leslie, the legal defense director for the Reporters Committee for Freedom of the Press, which has opposed Mr. Risen’s subpoena.
Mr. Holder pledged not to send reporters to jail, which would normally be the consequence of refusing to testify in a case like Mr. Sterling’s. Then, he indicated that he would not force Mr. Risen to reveal his sources, but would instead force Mr. Risen only to reveal limited information that he had already acknowledged.
More recently, the Justice Department withdrew, at least temporarily, the threat of a subpoena to force Richard Bonin, a CBS News producer, to testify at a terrorism trial in New York. Preet Bharara, the United States attorney in Manhattan, had recommended the subpoena but recently withdrew it, according to lawyers and others involved in the case.
Mr. Holder’s edict in the Sterling case was followed in Monday’s hearing. Prosecutors did not ask Mr. Risen for the information they had sought for years: the identity of his sources, where he met them and what information they provided.
“It is your position that, regardless of any threat of sanctions, you would not testify as to the identity of the source or sources who provided information for Chapter 9?” asked James Trump, a prosecutor.
“Yes,” Mr. Risen said.
Mr. Trump did not press the issue. Instead, he focused on basic information that Mr. Risen had already revealed publicly, such as the fact that he relied on confidential sources for his book and that he separately interviewed Mr. Sterling for an unrelated 2002 article in The Times.
Though Mr. Risen acknowledged those facts in court documents years ago, prosecutors want him to repeat them on the witness stand. Mr. Risen complied, but not without a fight, sending a clear signal that if forced to take the stand at trial, he would not be a friendly witness.
In one exchange, Mr. Trump tried to get Mr. Risen to acknowledge that he had promised confidentiality to a source.
“In my stories or my book, where I say I had unidentified sources, I had unidentified sources,” Mr. Risen said repeatedly. “Where I say I had identified sources, I had identified sources.”
Edward B. MacMahon, a lawyer for Mr. Sterling, said during the hearing that without more information from Mr. Risen, the government had no case. He said prosecutors could not even prove that the leak had occurred in Virginia, a first step to bringing charges here. Mr. MacMahon also said that he would ask Judge Leonie M. Brinkema to dismiss all charges.
Judge Brinkema did not indicate how she would respond to such a request, and she said little during Mr. Risen’s testimony. She stepped in, however, when Mr. Risen posed questions of Mr. MacMahon and later Mr. Trump.
“It doesn’t work that way,” Judge Brinkema said. “You can’t ask him questions. That’s the reporter in you.”
Mr. Sterling’s trial is scheduled to begin next Monday. Prosecutors gave no indication in court whether, in light of Mr. Risen’s testimony Monday, they planned to call him as a witness.