The Justice Department has agreed to turn over a legal opinion regarding government surveillance and census data after a years-long court fight with a privacy group.

The department on Thursday dropped its appeal of a federal judge's decision requiring it to provide the opinion from its Office of Legal Counsel to the Electronic Frontier Foundation.

That group in 2011 sued to obtain documents about government surveillance under the Patriot Act.

Among the records it sought was an opinion that analyzed law enforcement access to under a section of the Patriot Act that the National Security Agency relied on to collect bulk phone records.

A Justice Department spokeswoman said on Friday while the department disagreed with the court ruling, it would turn the document over to EFF.