WASHINGTON (CN) – A federal judge backed the government on its withholding of a 1984 memo that purportedly details the constitutionality of a National Security Agency surveillance program.

Pulitzer Prize-winning New York Times correspondent Charlie Savage brought the underlying complaint in Washington after filing a Freedom of Information Act request with the Office of Legal Counsel in October 2016.

The request, which the office did not answer within statutory deadlines, sought a memo by former Assistant Attorney General Theodore Olson on the constitutionality of conducting surveillance not mentioned in the Foreign Intelligence Surveillance Act.

Though the Office of Legal Counsel later admitted to having found two responsive documents, it told the court that a law akin to attorney-client privilege exempted them from production.

U.S. District Judge Christopher Cooper agreed with this justification on Friday, comparing Olson’s memo advising the attorney general to an attorney at a law firm lending help to a colleague.

“This is a quintessential example of the sort of document that falls within the attorney-client privilege: advice from an attorney (the head of OLC) to his client (the attorney general and, subsequently, the NSA) concerning the legal aspects of the client’s contemplated actions and based on confidential information from the client concerning those contemplated actions,” the 13-page opinion states (parentheses in original).

The Times argued the NSA was not Olson’s client, but rather a third party the attorney general represented. As a result, the paper argued the memo did not contain confidential information covered under the attorney-client privilege.

But Cooper said this reasoning would “undermine the purposes of the attorney-client privilege,” suggesting agencies would be less likely to seek legal advice knowing it might one day become public.

“Without a guarantee of confidentiality, executive branch agencies, like all legal clients, would hesitate to share private details about planned agency actions with the attorney general when seeking legal advice,” Cooper wrote. “And without such confidentiality, executive branch agencies might choose to forgo seeking legal advice altogether and thereby risk public disclosure of private, confidential details about their activities.”

Olson also brushed aside the Times’ argument that the attorney-client privilege no longer covers the memo because the memo has not been kept confidential, saying the paper provided no evidence supporting this claim.

The New York Times did not immediately respond to a request for comment on the ruling.

The Department of Justice also did not immediately return an email requesting comment on the decision.