New York State Supreme Court Justice Charles D. Wood in Westchester County made the ruling on Thursday, releasing it on Friday. Wood, who was elected to his position, ordered The New York Times to not publish any more of the confidential documents between Project Veritas and its attorney, while also requiring the publication to destroy digital copies and turn over any physical copies to the conservative group.

Free speech advocates and the prominent New York newspaper decried the ruling, with the publication vowing to appeal.

“This ruling should raise alarms not just for advocates of press freedoms but for anyone concerned about the dangers of government overreach into what the public can and cannot know,” The New York Times publisher A.G. Sulzberger said in a statement emailed to Newsweek.

“In defiance of law settled in the Pentagon Papers case, this judge has barred The Times from publishing information about a prominent and influential organization that was obtained legally in the ordinary course of reporting,” Sulzberger added.

“In addition to imposing this unconstitutional prior restraint, the judge has gone even further and ordered that we return this material, a ruling with no apparent precedent and one that could present obvious risks to exposing sources should it be allowed to stand. We are appealing immediately,” he said.

Project Veritas sued the newspaper for defamation last year after it published an article describing the conservative group’s work as “deceptive.” The conservative organization says it is a watchdog organization.

The group’s lawyer, Elizabeth Locke, praised the ruling on Friday. Locke said the decision by the judge affirmed “the sanctity of the attorney-client relationship,” according to the Associated Press.

“The New York Times has long forgotten the meaning of the journalism it claims to espouse, and has instead become a vehicle for the prosecution of a partisan political agenda,” she said. “Today’s ruling affirms that the New York Times’ behavior was irregular and outside the boundaries of law.”

Wood first extended a ban on The New York Times publishing memos between Project Veritas and its attorney in November. The newspaper and others quickly argued that the ruling violated the First Amendment.

Bruce Brown, executive director of the Reporters Committee for Freedom of the Press, called the November decision “deeply troubling.” He suggested it was “among the most grievous threats to the First Amendment.”

According to Reuters, The New York Times had not faced any prior restraint since its legal battle with the administration of former President Richard Nixon in the early 1970s. Nixon’s administration had attempted to block the newspaper from publishing the Pentagon Papers, which outlined the U.S. military’s actions and involvement in the Vietnam War. The government’s efforts to block their publication were ultimately unsuccessful.

The editorial board of the newspaper published a Christmas Eve opinion article slamming the decision by Wood. It pointed to the legal battle between The New York Times and the Nixon administration as the precedent that the newspaper argues should have been followed in this case.

“Half a century ago, the Supreme Court settled the matter of when a court can stop a newspaper from publishing. In 1971, the Nixon administration attempted to block The Times and The Washington Post from publishing classified Defense Department documents detailing the history of the Vietnam War — the so-called Pentagon Papers. Faced with an asserted threat to the nation’s security, the Supreme Court sided with the newspapers. ‘Without an informed and free press, there cannot be an enlightened people,’ Justice Potter Stewart wrote in a concurring opinion,” the editorial board wrote.