Army Sgt. Bowe Bergdahl arrives for a pretrial hearing in his court martial at Fort Bragg, N.C., in January. (Ted Richardson/Associated Press)

When Mark Boal spent 25 hours interviewing accused U.S. Army deserter Bowe Bergdahl, he didn’t plan on those hours of recorded interviews becoming part of a hugely popular podcast. He was just reporting, as he had many times before — whether for his magazine articles or his filmmaking.

But in collaboration with the producers of “Serial,” he and journalist Sarah Koenig teamed up. As a result, the story of the Army sergeant, who left his Afghanistan base in 2009 and was held captive by the Taliban for five years, became the basis of Season 2 of the spinoff of public radio’s “This American Life.”

Nor did Boal plan on his interviews becoming part of the prosecution’s case in Bergdahl’s court-martial at Fort Bragg in North Carolina next February.

That’s what a military prosecutor has in mind, according to court papers. The former soldier faces life in prison if he is found guilty of the charges of desertion and misbehavior before the enemy. Bergdahl was freed in 2014 in exchange for five Taliban fighters being held at Guantanamo Bay.

Boal is trying to prevent the subpoena by asking a civilian federal court in Los Angeles to intervene on First Amendment grounds. After all, unaired recordings are not unlike a reporter’s notes, which news organizations have long objected to being used in court. The prosecutor, Army Maj. Justin Oshana, in a court filing, called Boal’s interviews “relevant and necessary” to the case; he said he shared a draft subpoena with Boal’s attorney. (The Justice Department, which is objecting to Boal’s request and backing the military prosecutor, would not comment for this column.)

The good news for journalists and citizens is that Boal has his own army behind him: a long list of news organizations, including National Public Radio, the Associated Press, The Washington Post, Fox and the other major network news companies.

“This is a dream team of media — from across the political spectrum,” Boal said when the friend-of-the-court brief was filed late last month. Boal’s films include “The Hurt Locker” (for which he won the screenwriting Oscar) and “Zero Dark Thirty” (which he also wrote).

It wasn’t hard to find supporters, according to Katie Townsend, the litigation director for the Reporters Committee for Freedom of the Press, who wrote the brief.

“People were eager to jump to Boal’s aid,” Townsend told me. The reason is clear: News organizations don’t want their newsgathering efforts to be drawn into legal battles. And in a new era, in which a podcast can be every bit as much of a news outlet as a TV broadcast, it’s important to make sure that the newer breed of journalists gets the same protection as more traditional media.

The news organizations fear the effect on other journalists if Boal’s material is successfully brought into the case.

This should all sound familiar for those aware of New York Times reporter James Risen’s fight against testifying in a government leak prosecution in the past few years. For a time, it looked as though Risen’s fierce resistance to giving up his confidential source would land him in jail.

After many years of Risen’s battling the Justice Department, then-Attorney General Eric H. Holder Jr. said clearly that newsgathering needs to be protected and that no journalist should face jail for doing his or her job. President Obama has echoed that, as has Attorney General Loretta E. Lynch.

If courts — military or civilian — are able to subpoena reporters’ testimony and materials, and use them to prosecute crimes, interview subjects (also known as sources) will be much less likely to agree to speak.

“Journalists conducting newsgathering need protection from being dragged into prosecutions,” said Michael Oreskes, the news chief at NPR. The real protection isn’t for journalists themselves, he said, but for the public and its right to know what journalists turn up.

After all, according to Boal’s lawyer, Jean-Paul Jassy, the prosecution already has more than 300 pages of sworn testimony from Bergdahl himself and 1.5 million pages of material from 28 different agencies.

Oreskes termed the military prosecutor’s plans “just a fishing expedition.” And it would be a harmful one.

After his “dream team” of supporters came together last month, Boal asked a rhetorical question: “When was the last time Fox and NPR agreed on an issue?” That they have done so is a clear signal that the stakes are high, not only for journalists but also for those they are intended to represent: U.S. citizens.

Whatever happens to Bergdahl at Fort Bragg, the recorded interviews shouldn’t be part of the equation. The incremental value they might add to the prosecution’s case wouldn’t come close to being worth the eventual cost to newsgathering and to the public’s right to know.

For more by Margaret Sullivan visit wapo.st/sullivan