A federal appeals court ruled Thursday that the indiscriminate collection of phone data, conducted quietly by the National Security Agency before it was exposed by NSA whistleblower Edward Snowden, is illegal.

A three-judge panel from the 2nd Circuit U.S. Court of Appeals ruled that the NSA’s program broadly collecting phone records of Americans “exceeds the scope of what Congress has authorized.”

The ruling, written by Circuit Judge Gerard Lynch, states that the text of Section 215 of the Patriot Act, which the government claimed authorizes bulk metadata collection, “cannot bear the weight the government asks us to assign to it, and that it does not authorize the telephone metadata program.”

- Newsletter -

The text of the entire ruling is available here.

The ruling was written following an appeal from the plaintiffs, including the ACLU, who had filed a lawsuit challenging the constitutionality of the collection and claimed violation of privacy. The appeal followed a dismissal by U.S. District Judge William Pauley in December 2013.

The court’s decision avoided the issue regarding the program’s constitutionality.

Section 215 of the Patriot Act is set to expire on June 1st; The House Judiciary Committee approved the USA Freedom Act on April 30th, which claims to end bulk data collection. Senate Majority Leader Mitch McConnell introduced a bill earlier in April that would extend Section 215 for five more years.