Could the U.S. Justice Department prosecute reporters for publishing stories based on classified material? That once-tangential question briefly took center stage during Monday's House Intelligence Committee hearing.

As several Republican lawmakers stressed the possible criminality of leaking to the press about the activities of President Trump's advisers and associates, South Carolina GOP Rep. Trey Gowdy went a step further, asking, "Is there an exception in the law for reporters who want to break a story?"

FBI Director James Comey demurred.

"That's a harder question, as to whether a reporter incurs criminal liability by publishing classified information," Comey said, calling the matter "probably beyond my ken."

Gowdy was clearly trying to deflect attention from the investigation into the Trump campaign and Russia. But the issue he raised is central to the practice of journalism.

Legal protections far from clear

Inside most American newsrooms, the matter might seem closed. There is a pervasive belief that reporters do not break the law when they break news, even if the scoop involves national security.

Ample legal precedent suggests a protection for journalists as long as they do not themselves break the law or encourage or direct others to do so.

Perhaps as a result, journalists have not been prosecuted for reporting on such sensitive matters.

And yet, freedom of the press is not absolute, even in the U.S. According to a recent paper from the Congressional Research Service, the question is far from settled as a matter of federal law, as is the closely related concern of how well they can protect their confidential sources.

University of Kansas media law professor Jonathan Peters wrote in the Harvard Law and Policy Review that any prosecution would have to be narrowly tailored to serve a compelling state interest. Or, he wrote, the publication would have to result in "direct, immediate and irreparable damage" to the nation or its people.

But President Trump's sustained rhetorical attacks on the media give legal experts pause.

"We're in a new age right now, so all bets are off," said University of North Carolina law professor Mary-Rose Papandrea, who has written extensively on the legal status of journalists. "It's more of a historical fact that the government has not prosecuted a journalist" than any guarantee under the law, she said.

Papandrea, a former board member of the Massachusetts chapter of the American Civil Liberties Union, says she does not retain 100 percent confidence the courts would give freedom of the press greater status than national security.

Two Supreme Court precedents

Take two key U.S. Supreme Court cases, decided 30 years apart, that are often cited by advocates for press freedom. In 1971, the Supreme Court ruled that the Nixon administration could not prevent The New York Times and The Washington Post from publishing a classified history of the Vietnam War which came to be known as the Pentagon Papers.

In that case Daniel Ellsberg, a former military analyst who helped develop the history, leaked it to reporters for the newspapers — that is, secret papers were stolen from the government to be made public.

The court found that the news media should not be prevented from publishing the stolen Vietnam history despite protests from government lawyers it could cause the nation great harm.

As Justice Hugo Black wrote in one of several concurring opinions: "The word 'security' is a broad, vague generality whose contours should not be invoked to abrogate the fundamental law embodied in the First Amendment. The guarding of military and diplomatic secrets at the expense of informed representative government provides no real security for our Republic."

In 2001, the Supreme Court ruled in a civil case called Bartnicki v. Vopper, involving an intercepted cell phone conversation about union negotiations. A local radio host who later obtained a recording of the conversation played it on the air as part of the coverage of public debate over the controversial labor deal that was struck.

The justices held that the recording of the phone call probably broke the law. But the court dismissed the civil claim against the radio host, as he had not commissioned or known of the recording in advance. The ruling cited the "national commitment to the principle that debate on public issues should be uninhibited, robust and wide open."

Justice John Paul Stevens wrote in the majority opinion: "Privacy of communication is an important interest. However, in this suit, privacy concerns give way when balanced against the interest in publishing matters of public importance."

A limited precedent

And yet those same cases do not offer total protection for reporters. The University of Chicago legal scholar Geoffrey Stone, in testifying before the Senate Judiciary Committee in favor of greater legal protection for reporters and their sources, once called the privilege journalists have an intermediate one, far from absolute:

"Reporters have no legal or moral right to promise confidentiality beyond what is recognized in the law. Such promises should always be interpreted as 'subject to the rule of law.' "

In the Pentagon Papers cases, the Supreme Court justices ruled 6-3 for the journalists, but for differing reasons. It was indeed a great victory for the press and was hailed by advocates of freedom of speech.

The justices didn't block the government from exercising what's called "prior restraint" — that is, preventing a news organization from publishing or broadcasting news. What precise bar prosecutors would need to clear to justify prior restraint has not been defined in the modern era.

Similarly, in the civil case involving the Pennsylvania labor negotiations, the decision articulated principles giving freedom of the press greater stature than privacy concerns. Such claims are invoked in defending journalists' decision to publish sensitive information — and to withhold the identity of confidential sources, as the latter is often required to achieve the former.

But that wasn't a criminal case. And it did not involve national security. So Bartnicki does not settle Gowdy's question either. Though all almost all states have some protections against reporters having to divulge the identity of their sources, the federal government relies on policies that discourage rather than prevent the compulsion of such disclosures.

When presidents go after reporters

During the George W. Bush and Obama administrations, reporters often came under pressure from prosecutors to reveal sources.

Judith Miller, then a reporter for The New York Times, spent 85 days in prison after refusing to disclose who had told her the identity of an undercover CIA agent.

New York Times reporter James Risen was ordered to testify in a case involving a CIA source, which was initiated under the Bush administration and prosecuted in the Obama years.

Fox News reporter James Rosen was declared an unindicted co-conspirator under the Espionage Act during an investigation of a State Department adviser who leaked classified information involving North Korea. The official went to prison.

And yet even at their most aggressive moments, those administrations did not take steps to prosecute reporters for relying on leaks of classified information.

Papandrea, the UNC law professor, says she was heartened by the Bush administration's decision not to prosecute reporters at The New York Times for disclosing its warrantless wiretapping program at the National Security Agency.

The free press/national security toggle

As the White House switches between the parties, Republican and Democratic attorneys general often toggle back and forth between a stated emphasis on national security and transparency.

Former Obama administration Attorney General Eric Holder later said he regretted designating Fox's Rosen as a co-conspirator to a crime and announced he would not, as he put it, seek to send reporters to jail for doing their job.

Though the Justice Department succeeded in getting a subpoena for the testimony of the Times's Risen in that leak trial, in the end Holder did not force him to testify.

Early this year, Attorney General Jeff Sessions would not directly answer when asked at his confirmation hearing whether he would subpoena or prosecute reporters. The Reporters Committee for Freedom of the Press noted that he has opposed legal protections for reporters who refuse to disclose the identity of their sources in court.

Copyright 2017 NPR. To see more, visit http://www.npr.org/.