The US Court of Appeals for the District of Columbia Circuit said there were not sufficient grounds for the preliminary injunction imposed by the lower court.
The ruling was a setback for privacy advocates but did not reach the bigger question of whether the NSA's actions were lawful. It means the massive programme to collect and store phone records, disclosed in 2013 by former NSA contractor Edward Snowden, can continue unaffected until it expires at the end of November.
Under the USA Freedom Act, which Congress passed in June, the programme was allowed to continue for 180 days until new provisions aimed at addressing the privacy issues go into effect.
White House spokesperson Josh Earnest said the ruling was "consistent with what this administration has said for some time, which is that we did believe that these capabilities were constitutional."
Larry Klayman, the conservative lawyer who challenged the programme, said he would appeal to the Supreme Court. "We are confident of prevailing," he added.
But the three-judge panel concluded that the case was not moot despite the change in the law and sent the case back to US District Court Judge Richard Leon for further proceedings.
"Although one could reasonably infer from the evidence presented the government collected plaintiffs' own metadata, one could also conclude the opposite," wrote Judge Janice Rogers Brown. As such, the plaintiffs "fall short of meeting the higher burden of proof required for a preliminary injunction," she added.
Spokespeople for both NSA and the Office of Director of National Intelligence declined to comment on the ruling.
Under new provisions that begin in November, the programme requires companies such as Verizon Communications Inc and AT&T Inc, to collect telephone records the same way that they do now for billing purposes.
But instead of routinely feeding US intelligence agencies such data in bulk, the companies would be required to turn it over only in response to a government request approved by the secretive Foreign Intelligence Surveillance Court.
Documents provided by Snowden in 2013 showed the surveillance court secretly approved the collection of millions of raw daily phone records in America.
The programme was challenged by Klayman and Charles Strange, the father of a US cryptologist technician killed in Afghanistan in 2011. They won the case in US District Court in Washington in December 2013.
The government said in court papers that the programme was authorized under Section 215 of the Patriot Act, which addresses the FBI's ability to gather business records.
The only other appeals court to rule on the issue is the 2nd US Court of Appeals in New York, which held in May that the programme was unlawful.
The court is due to hear new arguments next week over whether an injunction should be imposed.
The case is NSA vs Klayman, US Court of Appeals for the District of Columbia Circuit, No. 14-5004.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ