WASHINGTON (AFP) - The United States (US) government said on Friday it has lodged an appeal against a judge's ruling that the National Security Agency's (NSA) "almost Orwellian" bulk collection of telephone records is illegal.
Separately, spy chief James Clapper revealed that a secret court had renewed the NSA's authority to gather call "metadata", despite the controversy triggered when the program came to light.
Last year, leaked files from fugitive intelligence contractor Edward Snowden revealed that the NSA habitually scoops up data on the timing and destination of calls by millions of US phone users.
President Barack Obama's administration has defended the practice, arguing that it helps agents "join the dots" between terror suspects and their contacts.
But civil liberties groups claim the digital dragnet infringes citizens' right to privacy, and on Dec 16 US District Court Judge Richard Leon agreed in Washington, branding the practice unconstitutional.
Mr Leon's judgement was stayed pending appeal, however, and another federal judge ruled against a similar complaint in New York, so the government has found room to counterattack.
Director of National Intelligence Clapper said two district courts had ruled in the administration's favor, along with the secret Foreign Intelligence Surveillance Court, which renewed the NSA's authority.
"The Department of Justice has filed an appeal of the lone contrary decision issued by the United States District Court for the District of Columbia," his office said in a statement.
But he added that the administration was "open to modifications to this program that would provide additional privacy and civil liberty protections while still maintaining its operational benefits."
Mr Obama has ordered and received a review of the NSA's methods and is considering recommendations for reform, although he is not expected to end phone metadata collection.
Mr Leon's ruling last month was scathing.
"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," he said in his opinion.
But on Dec 27, federal Judge William Pauley in New York dismissed a petition from the American Civil Liberties Union (ACLU) and said the NSA needs to track phone data to prevent terror attacks.
The ACLU said it would appeal that decision.
The apparently contradictory rulings make it likely the US Supreme Court will decide on the constitutionality of the NSA programs.
Separately, a civil rights group asked the US Supreme Court to review a case challenging the authority of NSA surveillance.
The Center for Constitutional Rights (CCR) petitioned the Supreme Court, arguing that the Snowden revelations provide new information that should lead the justices to revisit the matter.
"We have always been confident that our communications - including privileged attorney-client phone calls - were being unlawfully monitored by the NSA, but Edward Snowden's revelations of a massive, indiscriminate NSA spying program changes the picture," said CCR attorney Shayana Kadidal.
"Federal courts have dismissed surveillance cases, including ours, based on criteria established before Snowden's documents proved that such concerns are obviously well-founded."
Meanwhile, more than 250 academics from around the world signed an online petition this week calling for an end to "blanket mass surveillance" by intelligence agencies.
On Thursday, a report suggested that the NSA is making strides toward building a "quantum computer" that could break nearly any kind of encryption.
The Washington Post said documents leaked by Snowden show the computer would allow the agency to break encryption used to protect banking, medical, business and government records worldwide.