A federal court judge has ruled that National Security Letters (NSLs) – the controversial, ultra-clandestine surveillance tools used by the FBI to gather information on individuals – are unconstitutional and must be halted.

In a ruling issued on Thursday, Judge Susan Illston of the US District Court in San Francisco found that the "gag order" provision of the NSL law violates the First Amendment protections on freedom of speech.

Under the law, recipients of NSLs are forbidden from disclosing the contents of the letters to anyone. Even discussing the mere fact that the letters exist is verboten.

Furthermore, Judge Illston said, the clauses in the law that limit court oversight of NSLs violate the principle of separation of powers, which holds that each branch of the US government is granted specific powers designed to act as checks against the powers of the other branches.

Having determined that there was no way to rewrite either of these sections of the law to bring them in line with legal principles, the judge declared the entire law unconstitutional and ordered the government to cease issuing NSLs.

The ruling was immediately hailed as a victory by the Electronic Frontier Foundation (EFF), which has been battling the NSL law on behalf of an unnamed California phone company since March 2011.

"We are very pleased that the court recognized the fatal constitutional shortcomings of the NSL statute," said EFF attorney Matt Zimmerman said in a statement. "The government's gags have truncated the public debate on these controversial surveillance tools. Our client looks forward to the day when it can publicly discuss its experience."

The fact that the EFF's client has not been named serves to demonstrate the secrecy surrounding NSLs. Because of the gag orders, it has been hard to learn much of anything about the letters, including how they are used and how often.

We know that Google gets them, for example. But when Google started including information about NSLs in its Transparency Report earlier this month, all it could say was that it received somewhere between zero and 999 letters last year – and that was only after getting special permission from the FBI.

With the NSL law struck down, however, the full picture of how the FBI has wielded its unprecedented surveillance power in recent years may soon be revealed – provided, that is, if Judge Illston's ruling is upheld.

That's still a big "if". Citing "significant constitutional and national security issues," the judge has stayed her own ruling for 90 days or until the government appeals, whichever comes sooner. ®