Mark Boal has settled a lawsuit against the U.S. government after the screenwriter sued the government following its threat in July to subpoena him to turn over unaired, taped interviews with accused Army deserter Bowe Bergdahl.

“I’m happy that the Army ultimately agreed to uphold the traditions of a free civilian press,” Boal said in a release that announced the deal, which allows Boal to protect all confidential material from the federal government. The settlement also calls for the government to drop the subpoena.

Boal sued the U.S. government earlier this year in response to its subpoena threat, arguing that his taped, confidential interviews with Bergdahl were protected under the First Amendment.

The “Zero Dark Thirty” scripter was planning to team with frequent collaborator Kathryn Bigelow to make a movie about Bergdahl, a U.S. Army sergeant. The tapes were also the basis of Sarah Koenig’s “Serial” podcast, on which Boal served as a producer.

Boal named President Barack Obama, Secretary of Defense Ashton B. Carter, Secretary of the Army Eric Fanning, Army court-martial convening authority General Robert Abrams, and U.S. Army Prosecutor Major Justin Oshana as defendants in his suit.

Boal had more than 25 hours of taped interviews with Bergdahl, who spent five years as a prisoner of war of the Taliban until his release in May of 2014.

“This is a terrific resolution,” said his attorney, Jean-Paul Jassy. “The Army originally demanded 25 hours of Mark Boal’s unedited interviews with Bergdahl that included confidential discussions and all sorts of personal material that wasn’t ever meant to be public. Mark Boal faced down the demand. He is a First Amendment hero.”