US technology companies speak out against NSA collection of their users' data. (Reuters)

A US judge has ruled that the National Security Agency's mass phone surveillance program is unconstitutional describing the practice as "almost Orwallian" and  that James Madison, father of the US constitution, would be "aghast" to learn about the violation on freedom.

The judge, Richard J Leon of Federal District Court for the District of Columbia, said that NSA's collection of "metadata" including telephone numbers and times and date of calls was "indiscriminate" and an "arbitrary invasion" into privacy. He ordered the government to stop collecting data, in favour of the two plaintiffs in the case and to destroy any remnants of the records.  

"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 for purposes of querying and analyzing it without prior judicial approval," Judge Leon said in a 68-page ruling. "Surely, such a program infringes on 'that degree of privacy' that the founders enshrined in the Fourth Amendment." The Fourth Amendment prohibits unreasonable searches and seizures of private properties.

NSA's surveillance program and collection of "metadata" was exposed by ex-NSA contractor Edward Snowden who welcomed Monday's court ruling that declared the practice as a likely violation of the US constitution. Snowden is currently in asylum in Russia. 

"I acted on my belief that the NSA's mass surveillance programs would not withstand a constitutional challenge, and that the American public deserved a chance to see these issues determined by open courts," The New York Times has quoted Snowden as saying. Snowden issued the statement though journalist Glenn Greenwald of The Guardian who had close ties with the whistle-blower.

"Today, a secret program authorized by a secret court was, when exposed to the light of day, found to violate Americans' rights. It is the first of many," he added.

'Surveillance Doesn't Stop Terrorism'

Judge Leon in his ruling also expressed his doubts on the rationale behind US government's justification for mass surveillance, which it termed as indispensable to prevent terrorist attacks. "The government does not cite a single case in which analysis of the NSA's bulk metadata collection actually stopped an imminent terrorist attack," Leon said.

"Given the limited record before me at this point in the litigation - most notably, the utter lack of evidence that a terrorist attack has ever been prevented because searching the NSA database was faster than other investigative tactics - I have serious doubts about the efficacy of the metadata collection program as a means of conducting time-sensitive investigations in cases involving imminent threats of terrorism."

He granted a preliminary injunction sought by plaintiffs Larry Kayman and Charles Strange, indicating that their challenge was likely to be successful. The lawsuit was brought by conservative activist Larry Kayman, a user of a Verizon mobile telephone, who had challenged NSA's metadata collection on his own behalf and that of his client.

Verizon, one of the largest phone companies in the US, was reportedly ordered by NSA to disclose its metadata, including telephone numbers, calling card numbers and the serial phone numbers of millions of people.

This comes only hours after the White House earlier on Monday rejected the suggestion that Snowden would be granted amnesty if he stopped leaking more documents. The possibility of Snowden getting amnesty was suggested on Sunday by Richard ledgett, head of the NSA's task force investigating the damage from Snowden's leaks.

"There's been no change in our position," White House spokesman Jay Carney told reporters.

"He faces felony charges here, he ought to be returned to the United States, again, where he will face full due process and protection under our system of justice, that we hope he will avail himself of."