A federal appeals court in New York has ruled that the bulk collection of Americans' phone records by the government exceeds what Congress has allowed.
The 2nd U.S. Circuit Court of Appeals in Manhattan issued its decision Thursday.
In it, a three-judge panel said the case brought by the American Civil Liberties Union illustrated the complexity of balancing privacy interests with the nation's security.
"The text of (Section 215) cannot bear the weight the government asks us to assign to it, and ... does not authorize the telephone metadata program," the court wrote, according to the Wall Street Journal.
It did not weigh in on whether the program infringes on Americans' privacy rights, because the judges found the government's expansive data collection was simply not authorized by the law.
A lower court judge had thrown out the case. The appeals court said the lower court had erred in ruling that the phone records collection program was legal.
However, the 2nd Circuit declined to block the program, saying it is now up to Congress to decide whether and under what conditions it should continue.
It said a debate in Congress could profoundly alter the legal landscape.
Secret NSA documents were leaked to journalists in 2013 by contractor Edward Snowden, revealing that the agency was collecting phone records and digital communications of millions of citizens not suspected of crimes and prompting congressional reform.
The Associated Press contributed to this report.