A federal magistrate judge in Manhattan has rejected a bid by Barnes & Noble's former CEO to gain access to documents prepared by the company's lawyers amid a sexual harassment investigation that led to his ouster.

U.S. Magistrate Judge Gabriel W. Gorenstein on Friday said that the documents, prepared by Barnes & Noble's general counsel and outside attorneys, were meant to provide legal advice to the company and were thus protected by the attorney-client privilege.

The U.S. magistrate judge did, however, order the bookstore chain to turn over a trove of other documents that he said were unrelated to potential litigation.

The ruling came in Demos Parneros' breach-of-contract and defamation lawsuit in the Southern District of New York that seeks compensation for his firing last year. Specifically, Parneros had sought documents from Barnes & Noble general counsel Bradley Feuer's investigation into claims levied by an executive assistant, as well as a report by Paul, Weiss, Rifkind, Wharton & Garrison, which was presented to the Barnes & Noble board ahead of a June 27 vote to terminate his employment.

Parneros argued in a motion to compel that, because the materials were prepared for business purposes, no privilege attached. But Gorenstein rejected that premise, saying it was clear from the record that Feuer was immediately concerned that the Parneros' accuser could possibly bring claims against the company and quickly engaged the help of outside counsel from Paul Weiss.

"The mere fact that there was a business benefit obtained from conducting the investigation does not detract from the circumstances here indicating that the predominant purpose of the investigation was to gather facts for the general counsel so he could give legal advice to the corporation," Gorenstein wrote in a 37-page opinion.

Other documents, however, lacked similar protections. Gorenstein, who is overseeing privilege-related discovery issues, ordered Barnes & Noble to produce a series of email communications between nonattorney executives, as the company drafted a press release announcing Parneros' firing. According to court filings, Parneros viewed those materials as important to his defamation claim, which alleged that the release had falsely implied that he had engaged in "serious sexual misconduct."

The company, meanwhile, had argued that the documents were protected under the work-product doctrine, which shields from discovery documents prepared "in anticipation of litigation."

"While work product protection is available for non-attorneys even when they act without the direction of an attorney to prepare materials in anticipation of litigation … there is no evidence in the record that any of the individuals who were circulating press releases did so because they anticipated litigation," Gorenstein said. "Accordingly, Barnes & Noble is ordered to produce these documents."

An attorney for Barnes & Noble was not immediately available on Friday to comment, and Parneros' counsel declined to comment on the ruling.

Barnes & Noble has asserted counterclaims against Parneros for breaching his fiduciary duties of loyalty and good faith and for damages for acting as a faithless servant to the company. Discovery is expected to wrap in the case by Oct. 18, and the sides are currently eyeing a potential bench trial in March.

The case, captioned Parneros v. Barnes & Noble, is assigned to U.S. District Judge John G. Koeltl.

Parneros is represented by Debra L. Raskin and Anne L. Clark of Vladeck, Raskin & Clark in New York.

Barnes & Noble is represented by Jay Cohen, Maria Keane, Arianna Markel and Liza May Velazquez of Paul Weiss.

Read More: