A US appeals court on Friday overturned a ruling that the National Security Agency's bulk collection of phone records was illegal, after saying that the plaintiffs failed to show they were victims.
A lower court, in a preliminary 2013 ruling, said the NSA program was probably unconstitutional and "almost Orwellian."
But the appellate panel said the case should not proceed because the plaintiffs -- activist Larry Klayman and the parents of an NSA employee killed in Afghanistan -- failed to show they had been targeted for surveillance as part of the program.
"In order to establish his standing to sue, a plaintiff must show he has suffered a 'concrete and particularized' injury," the Washington appeals panel said.
It added that the plaintiffs "fail to offer any evidence that their communications have been monitored."
The impact of the decision was not immediately clear.
In a separate case filed by the American Civil Liberties Union, a different appeals court in New York ruled in May that the NSA program was illegal because it exceeded the scope of what Congress had authorized.
Since that decision, Congress has passed a law aimed at scaling back the NSA program and ending most bulk collection of Americans' records.
The new law shifts responsibility for storing the data to telephone companies, allowing authorities to access the information only with a warrant from a secret counterterror court that identifies a specific person or group of people suspected of terror ties.
The NSA's powers have come under scrutiny since documents leaked by former contractor Edward Snowden in 2013 showed wide-ranging programs that scoop up data from phone companies and online.
Friday's ruling sends the case back to US District Judge Richard Leon, who had issued an injunction -- pending the appeal -- to halt the data collection.
"I cannot imagine a more indiscriminate and arbitrary invasion than this systematic and high-tech collection and retention of personal data on virtually every single citizen," Leon said in his original decision.
Leon argued that American founding father James Madison, one of the authors of the US Constitution, would be "aghast" at the government's "almost Orwellian" breach of citizens' rights to privacy.