For several years, the National Security Agency unlawfully gathered tens of thousands of emails and other electronic communications between Americans as part of a now-revised collection method, according to a 2011 secret court opinion.

The redacted 85-page opinion, which was declassified by U.S. intelligence officials on Wednesday, states that, based on NSA estimates, the spy agency may have been collecting as many as 56,000 "wholly domestic" communications each year.

In a strongly worded opinion, the chief judge of the Foreign Intelligence Surveillance Court expressed consternation at what he saw as a pattern of misleading statements by the government and hinted that the NSA possibly violated a criminal law against spying on Americans.