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.