The National Security Agency (NSA) Mass Surveillance Program suffered a tremendous setback when a US Appellate Court ruled against the measure and called it illegal.

The NSA drafted and put into action its mass surveillance program, which involved gathering communications data of US citizens without probable cause or warrant. The security agency conceived the measure in the wake of the Sept. 11, 2001, terrorist attacks and involved monitoring billions of phone calls made by millions of Americans over several years. Officially called the Terrorist Surveillance Program, the purpose of the NSA's mass surveillance program was to intercept communications deemed involved in terrorist discussion, planning, and activities.

NSA's mass surveillance program eventually included tracking not only phone calls, but also text messages, Internet activities, and other types of communications involving persons outside the US, even if the other end of the communication is within America. The NSA reportedly abandoned the program in 2018, but the Department of Justice continued to defend it in court with the argument that ruling against the program could expose state secrets.

In 2013, the public came to know about the surveillance and its methods when Edward Snowden, a contractor-turned-whistle-blower who worked on NSA's mass surveillance program, revealed what he knew. At the time, there were also allegations that tech giants like Google and Apple were cooperating with the NSA by giving them access to private user data. All of them denied the allegations, although some analysts found it suspicious that their denial statements contained specific and identical wordings. In the case of Google, its denial statement may have looked categorical but industry analysts say that it may have been an ingenious non-denial when reading between the lines.

A US federal appeals court ruled in 2015 that the NSA's mass surveillance program is illegal. According to the 2nd U.S. Circuit Court of Appeals in Manhattan, the Patriot Act does not authorize the NSA to collect in bulk the calling records of US citizens.

In the 2015 unanimous ruling penned by Judge Gerard E. Lynch, it held that Section 215 of the Patriot Act does not authorize the gathering of telephone metadata, which is the focal point of the NSA's mass surveillance program. Since that time, the government has been hoping for a reversal of the ruling in a separate case. However, this did not happen.

In December of 2019, a surveillance court against the NSA's mass surveillance program. The public came to know about the 83-page heavily redacted ruling only on Friday, Sept. 5, when a government website posted it after its declassification.

On Wednesday, Sept. 2, the U.S. Court of Appeals for the Ninth Circuit handed the security agency an adverse ruling and called the NSA's mass surveillance program Illegal. The court also hinted that the agency may have abused their power under the constitution, though it stopped short of saying exactly that.

The American Civil Liberties Union (ACLU), however, did not mince words in saying that the NSA's mass surveillance program is in violation of the constitution. "The ruling makes plain that the NSA's bulk collection of Americans' phone records violated the Constitution. The decision also recognizes that when the government seeks to prosecute a person, it must give notice of the secret surveillance it used to gather its evidence," said Patrick Toomey, an ACLU National Security Project senior staff attorney.