WASHINGTON (AP) — A senior administration official says some of the surveillance documents released by U.S. intelligence officials Wednesday were made public in response to a lawsuit.

The official says other documents were released voluntarily. The National Security Agency declassified three secret court opinions showing how it collected as many as 56,000 emails and other communications by Americans not connected to terrorism annually over three years. The court ordered the NSA to find ways to limit what it collects and how long it keeps it.

Intelligence officials told reporters the director of national intelligence, James Clapper, determined the documents should be released to shed light on the NSA's surveillance programs.

The suit was filed by the privacy group Electronic Frontier Foundation. Clapper's office had no immediate comment on the EFF court case.

The official was not authorized to discuss the release with a reporter by name, and spoke on condition of anonymity.