Judge Richard Leon declared that the case brought by two plaintiffs against the NSA six months ago was likely to be successful.
The plaintiffs are Larry Klayman, a conservative lawyer, and Charles Strange, whose son died in Afghanistan in 2011 in what he calls "suspicious circumstances".
Leon said NSA's gathering collection of data probably violates the fourth amendment, which prohibits unreasonable searches and seizures.
“Plaintiffs have a substantial likelihood of showing that their privacy interests outweigh the government’s interest in collecting and analyzing bulk telephony metadata and therefore the NSA’s bulk collection program is indeed an unreasonable search under the fourth amendment,” he said.
The judge put his ruling on hold to allow the government to appeal.
The NSA's spying came into light when 30 year old former NSA contractor Edward Snowden leaked secret US internet and phone surveillance programs who later fled to Hong Kong and then to Russia in June where he was granted asylum.