A federal appeals court ruling that the National Security Agency's collection of millions of Americans’ phone records is illegal could undercut more than just that program.

The 2nd Circuit Court of Appeals ruled Thursday that the phone records program violated the law used to authorize it, the USA Patriot Act. The program had been approved by the secretive Foreign Intelligence Surveillance Court and was first reported on by USA Today in 2006, but documents from former government contractor Edward Snowden revealed the program continued under President Obama.

The government argued that the huge volume of  phone records were relevant to counterterrorism investigations because searching through them later might help discern links to terrorism suspects. But the court didn't buy it, ruling that such an interpretation of "relevance" was "unprecedented and unwarranted." The government's argument, the judges said, boiled down to "the proposition that essentially all telephone records are relevant to essentially all international terrorism investigations.”

Knocking down that interpretation could have consequences that go beyond the program and even the part of the USA Patriot Act used to authorized it, Section 215.

First, it could mean a blow to other programs relying on the same part of the USA Patriot Act, experts said -- for example, a potentially ongoing program tracking international money transfers that includes millions of Americans' financial and personal data that was revealed by the Wall Street Journal last year.

And because many laws rely on very similar relevance language, the decision should bring new scrutiny to other programs, experts said. "As I understand it, this ruling should have implications for several surveillance statutes," said Harley Geiger, advocacy director and senior counsel at the Center for Democracy & Technology.

Why? Basically that's due to a bit of congressional laziness, said Jonathan Mayer, a lawyer and computer scientist affiliated with Stanford University's Center for Internet and Society. "Most surveillance statutes are copy and paste," he said. "There's certain relevance language that is replicated everywhere."

The court itself noted as much, citing the example of two bills that use the same language to compel the production of information relevant to authorized terrorism investigations -- one about telephone toll‐billing and another about educational records. (Those bills did not appear to be used for or intended to authorize bulk surveillance.)

But other programs that collected massive amounts of data on Americans relied on similar relevance language. A program that collected information about e-mails until 2011, for example, was set up under a set of legal authorities known as "pen register/trap and trace." And a Justice Department and Drug Enforcement Administration program that harvested records of international calls by Americans to as many as 116 countries for more than two decades since 1992 relied on an administrative subpoena power that required that the information gathered be "relevant or material" to an investigation, USA Today reported.

The court's rejection of the broad interpretation of relevance in this case could make it nearly impossible for the government to argue in favor of domestic bulk collection programs such as these without it being explicitly spelled out in the law, according to Mayer.

That could have significant weight in the legislative debate over the phone records program. Section 215 is set to expire on June 1, and Senate Majority Leader Mitch McConnell (R-Ky.) is pushing for a bill that would renew it. But for the phone program to continue after passage, the government would have to convince the Supreme Court to reverse the 2nd Circuit's decision.

And a bill to modify the law so that, supporters argue, the NSA can get access to records while still protecting Americans’ data -- called the USA Freedom Acct -- has split privacy advocates. One coalition of privacy advocates argues that the bill essentially legalizes mass surveillance and could "eviscerate numerous court challenges" -- presumably, challenges like the one just won in the 2nd Circuit.

But one of the key arguments from privacy advocates who support the bill is that it reins in bulk collection by the government, which may have continued under other authorities even if Section 215 is sunset. That argument may be less compelling to some now. "The 2nd Circuit just did a big piece of USA Freedom," Mayer said.

Some members of Congress are already citing the decision as a reason to reject the current version of the USA Freedom Act, including Rep. Justin Amash (R-Mich.), who led a campaign to defund the phone records program in 2013.

But supporters of the bill say that other aspects of the legislation, including transparency provisions, still make it worthwhile. "The problem is without the transparency requirements in USA Freedom, we won't know how the Foreign Intelligence Surveillance Court responds to the ruling," said Cato Institute senior fellow Julian Sanchez.

And USA Freedom would not undermine the relevance restrictions included in the 2nd Circuit decision, Geiger argues. Rather, he said, it would build on them by giving more specific parameters for what is relevant and "provide the certainty that both the intelligence community and the Americans concerned about civil liberties deserve."

The 2nd Circuit also declined to place a preliminary injunction on the case due to the current debate and could still be overturned, Sanchez said.

Correction: An earlier version of this story incorrectly said the NSA's phone record program was first revealed by Edward Snowden. In fact, it was first revealed by USA Today in 2006 and the Snowden documents showed the program continued under President Obama. We regret the error.