On Dec. 31, 2005, the C.I.A.’s acting general counsel, John A. Rizzo, received an urgent phone call from the White House about a chapter in James Risen’s coming book, “State of War,” detailing a botched C.I.A. operation in Iran.

The administration wanted Mr. Rizzo to contact Sumner Redstone — the chairman of Viacom, owner of the book’s publisher, Simon & Schuster — and ask him to keep the book off the market.

Mr. Rizzo never made the call. It was too late. Copies of “State of War” had already reached bookstores.

The Bush administration soon identified the man it believed was responsible for leaking the information in the book, and in 2008 it subpoenaed Mr. Risen, a reporter for The New York Times, to identify his source.

After more than six years of legal wrangling, the case — the most serious confrontation between the government and the press in recent history — will reach a head in the coming weeks. Mr. Risen has steadfastly refused to testify. But he is now out of challenges. Early this month, the Supreme Court declined to review his case, a decision that allows prosecutors to compel his testimony. If Mr. Risen resists, he could go to prison.

Though the court’s decision looked like a major victory for the government, it has forced the Obama administration to confront a hard choice. Should it demand Mr. Risen’s testimony and be responsible for a reporter’s being sent to jail? Or reverse course and stand down, losing credibility with an intelligence community that has pushed for the aggressive prosecution of leaks?

The dilemma comes at a critical moment for an administration that has struggled to find a balance between aggressively enforcing laws against leaking and demonstrating concern for civil liberties and government transparency. Whatever the Justice Department chooses to do will send a powerful message about how far it is willing to go to protect classified information in the digital age. And journalists and press freedom activists are watching closely for the precedent the decision will most likely set.

“If the government proceeds and pursues the subpoena, especially if Mr. Risen goes to jail or is fined at some intolerable level, it will deal a withering blow to reporting that runs against the government’s wishes,” said Steven Aftergood, who studies government secrecy for the nonprofit Federation of American Scientists.

Arguments over the First Amendment can be esoteric, but the specter of a reporter’s going to jail adds an element of personal consequence and real-world drama to the debate. The last reporter to be sent to prison for refusing to disclose a source was Judith Miller in 2005; then a reporter for The Times, Ms. Miller served 85 days in jail for initially refusing to testify in a case involving the disclosure of a covert C.I.A. operative.

Several weeks ago, Attorney General Eric H. Holder Jr. hinted that prosecutors might not seek to imprison Mr. Risen if he defies his subpoena, though Mr. Holder’s statement was by no means definitive. “As long as I’m attorney general, no reporter who is doing his job is going to go to jail,” he said in a meeting with a group of journalists.

On the advice of his lawyer, Mr. Risen, 59, declined to comment for this article. But during a speech in February in Boston, he said he had two choices: “Give up everything I believe in — or go to jail.”

Mr. Risen’s legal travails have played out against the backdrop of WikiLeaks and Edward J. Snowden, intensifying the debate over the disclosure of national security secrets. Defenders of press freedom argue that unsanctioned leaks help hold administrations accountable for their actions, and that reporters depend on confidential sources to get important information to the public. Critics of these leaks say they are not only illegal but also can jeopardize the government’s ability to keep the public safe.

President Obama has found himself at the center of this debate. After he entered office celebrating whistle-blowing as an act of “courage and patriotism,” his administration has prosecuted eight government employees for leaking classified information — more than all previous administrations combined.

During the course of leak investigations, the government has largely avoided courtroom showdowns with reporters. But two cases that surfaced last year prompted outrage among journalists. In one, the Justice Department obtained Associated Press phone records; in the other, an F.B.I. agent labeled a Fox News reporter, James Rosen, a criminal co-conspirator in a search warrant for his email.

In response to the uproar, the administration has revised Justice Department regulations to offer reporters more protection from government investigators.

David Pozen, an associate law professor at Columbia University who studies leaks, said the government’s next move in Mr. Risen’s case could signal a tipping point in how it pursues these prosecutions. “If they let Risen go,” Mr. Pozen said, “it would suggest that however else they try to bring these criminal-leak cases going forward, journalists will largely be shielded.”

The failed C.I.A. action at the heart of Mr. Risen’s reporting was intended to sabotage Iran’s nuclear weapons program. Intelligence officials assigned a former Russian scientist who had defected to the United States to deliver a set of faulty blueprints for a nuclear device to an Iranian scientist. But the Russian scientist became nervous and informed the Iranians that the plans were flawed.

The Times considered publishing an article about the operation in 2003, when Mr. Risen first learned about it, but President George W. Bush’s national security adviser, Condoleezza Rice, prevailed upon the newspaper to withhold publication for the sake of national security.

“We weighed the government’s concerns and the usual editorial considerations and decided not to run the story at that time,” said a spokeswoman for The Times, Danielle Rhoades Ha.

Mr. Risen broke the story a few years later in his book. In the intervening period, it had come to light that the administration had built its case for going to war in Iraq on the basis of faulty intelligence about the country’s nuclear weapons program. There was also growing speculation that the United States might be planning for a possible conflict in Iran.

As Mr. Risen wrote in one legal filing, “The competence of intelligence operations concerning Iran’s nuclear capabilities was something that the public needed to examine.”

The C.I.A. refers possible leak cases to the Justice Department on an almost weekly basis. A vast majority are never investigated. According to Mr. Rizzo, though, relatively few people possessed Mr. Risen’s detailed knowledge of the Iran operation.

The government quickly zeroed in on a disgruntled former C.I.A. agent, Jeffrey Sterling. In 2010, federal prosecutors charged Mr. Sterling with disclosing classified information to a reporter. His trial was scheduled to begin in 2011 in Federal District Court in Alexandria, Va., but the fight over Mr. Risen’s testimony has delayed the proceedings.

When the Bush administration first subpoenaed Mr. Risen in early 2008, he was already well known inside the White House. He was one of two reporters for The Times who in 2005 broke the news that Mr. Bush’s government had conducted warrantless wiretapping of American citizens. Mr. Bush described the reporting on the wiretapping program as “shameful.” Nevertheless, the revelations led to greater judicial oversight of electronic eavesdropping.

The Obama administration has also tried to force Mr. Risen to disclose how he learned the information in his book. Mr. Risen has received two additional subpoenas, one to testify before a grand jury, the other to testify at Mr. Sterling’s trial.

After a trial court judge largely quashed his third subpoena in late 2010, the Justice Department successfully challenged the ruling in a federal appeals court, arguing that the First Amendment does not afford any special protections to journalists. The administration then urged the Supreme Court not to review Mr. Risen’s case.

“I was surprised that the Obama administration continued to pursue the notion of Risen testifying,” said Mr. Rizzo, who recently published a memoir about his years in the C.I.A. in which he devoted several pages to the controversy surrounding Mr. Risen’s book. “They were declassifying torture memos. There was going to be transparency. It was a new leaf they were going to turn over.”

Defenders of the government’s war on leaks argue that advances in technology and the expansion of the intelligence bureaucracy since the Sept. 11 terrorist attacks have made heightened vigilance necessary. Daniel Ellsberg had to photocopy the Pentagon Papers one page at a time; Mr. Snowden was able to access hundreds of thousands of highly classified documents on the National Security Agency’s computer networks. As of 2011, more than 4.2 million people both inside and outside the government held security clearances.

“It’s kind of a small response to a giant problem,” Jack Goldsmith, a Harvard law professor who was a senior Justice Department official in the Bush administration, said of the Obama administration’s leak cases. “These prosecutions are the responses of a bureaucracy that’s at its wits’ end at how to deal with all of these leaks.”

Activists for freedom of the press have been encouraged by some of the White House’s recent actions and talk. In May last year, Mr. Obama described leaks as dangerous but said he was “troubled by the possibility that leak investigations may chill the investigative journalism that holds government accountable.”

The president has also expressed support for legislation — a so-called shield law — that guarantees certain protections for journalists, but would contain exceptions related to national security.

For now, the administration faces a more pressing issue: What to do about Mr. Risen?

The government is expected to resume its case soon against Mr. Sterling. If Mr. Risen refuses to testify, the Justice Department has options beyond seeking a prison sentence. It could ask the judge to fine Mr. Risen. Or it could agree to narrow the scope of questioning so that he would not be asked to identify his source.

Government lawyers could also try to avoid the issue altogether by pursuing a plea agreement with Mr. Sterling.

“The prosecutors who have invested so much in this probably want to charge ahead,” said Mr. Aftergood of the Federation of American Scientists. “It’s just a question of whether politics will put some brakes on them.”

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Reporter’s Case Poses Dilemma for Justice Dept.. Order Reprints | Today’s Paper | Subscribe