Though U.S. government officials have repeatedly assured the public that their massive spying programs are legal, in 2011 the secret court, which has jurisdiction over all federal secret intelligence community operations, found that the government was engaging in unconstitutional surveillance by collecting thousands of Americans' emails and other electronic communications.

On Oct. 3, 2011, the Foreign Intelligence Surveillance Court (FISC) handed down a secret 86-page opinion ordering the government to either halt the illegal activity or implement procedures to protect Americans' privacy. On Wednesday, the U.S. Justice Department released a version of that opinion, minus information deemed too sensitive by officials to make public.

The unconstitutional data collection conducted by the National Security Agency, which the court described as “deficient on constitutional and statutory grounds,” involved the collection of electronic communications under section 702 of the 2008 FISA Amendments Act and involved what is called “upstream” or “passive” collection under that provision. In contrast to collecting communications, such as emails, once they have reached either end of the service provider, this type of collection involves diverting communications as they cross fiber-optic cables in the United States to pass through an NSA data repository. Under 702, the government can use upstream collection to target certain selector, or criteria, such as an email address known to be connected to a foreign terrorist, and then collect emails to and from that address, or which mention that address.

From 2008 until 2011, when the problem was discovered, a hitch in the National Security Agency’s upstream collection had caused it to accidentally scoop up Americans’ communications along with those that were being targeted. However, Section 702 only allows for the collection of foreign communications and communications that are one-end foreign and one-end domestic. On a conference call with reporters Wednesday, an intelligence official described the problem as similar to grabbing a snapshot of someone’s inbox rather than the actual email containing the selector.

Officials stressed that the court did not find fault with this collection in itself because, for technical reasons, the NSA is incapable of only collecting the communications containing the selectors. Instead, the court found that the so-called “minimization procedures” -- the methods by which officials segregate and protect Americans’ emails captured incidentally -- needed to be strengthened to prevent this kind of data collection. The NSA estimates that it could have been collecting as many as 56,000 wholly domestic communications each year, according to the Washington Post.

The Justice Department fought to keep the decision secret in federal court when details of the NSA’s activities were leaked by former NSA contractor Edward Snowden. This month, the DOJ decided to release the opinion rather than continue its court battle with the Electronic Frontier Foundation, a digital rights group that was suing for the opinion's release.

In addition to the October 2011 opinion, the director of national intelligence on Wednesday also released a subsequent November 2011 opinion on the minimization procedures following the first opinion, as well as a 2012 opinion relating to the incident. The DNI also released the 2011 minimization procedures for section 702, the latest NSA compliance assessment, portions of a white paper on section 702 and statements from government officials referring to this incident.

FISA court opinion with exemptions by The Washington Post