By Lawrence Hurley

WASHINGTON (Reuters) - A U.S. appeals court on Friday threw out a judge's ruling that would have blocked the National Security Agency from collecting phone metadata under a controversial program that has raised privacy concerns.

The U.S. 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 program 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 program was allowed to continue for 180 days until new provisions aimed at addressing the privacy issues go into effect.

White House spokesman 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 program, said he would appeal to the Supreme Court.

"We are confident of prevailing," he added.

The three-judge panel concluded that the case was not moot despite the change in the law and sent the case back to U.S. 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 program 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.

Story continues

But instead of routinely feeding U.S. 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 program was challenged by Klayman and Charles Strange, the father of a U.S. cryptologist technician killed in Afghanistan in 2011. They won the case in U.S. District Court in Washington in December 2013.

The government said in court papers that the program 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 U.S. Court of Appeals in New York, which held in May that the program was unlawful. The court is due to hear new arguments next week over whether an injunction should be imposed.

The case is NSA v. Klayman, U.S. Court of Appeals for the District of Columbia Circuit, No. 14-5004

(Reporting by Lawrence Hurley. Additional reporting by Ayesha Rascoe, Nate Raymond and Mark Hosenball; Editing by Susan Heavey, Mohammad Zargham and Andrew Hay)