Judge says national security letters – which allow government to obtain data without citizens' consent – breach first amendment

The FBI has suffered a dramatic setback in its use of hyper-secret gagging orders in the name of national security to obtain the private data of US citizens, after a federal court struck down the practice.

A judge in a California US district court ordered the US government to stop issuing what are called "national security letters". Susan Illston said the letters, which have mushroomed since 9/11 under the Patriot Act, were unconstitutional as they breached the first amendment rights of the parties being served the orders.

NSLs have been an increasingly important part of the US government's approach to counter-terrorism, though their growing use has been matched by mounting unease on the party of civil libertarians. Last year the FBI sent out more than 16,000 of the letters relating to the private data – mainly financial, internet or phone records – of more than 7,000 Americans.

Previous court action has led to the FBI being accused of abusing its powers under the NSL statute by issuing the letters far more extensively than in the limited counter-terrorism situations for which they were devised.

The letters are among the most secretive tools of any deployed by the US state. The demand for data comes with a gagging order attached – meaning that the recipient of the NSL is not allowed even to discuss the letter in public.

As an additional affront, civil liberties groups say, the FBI is allowed to issue the letters without approval from a judge. Only the green light of a local FBI chief is required.

The judge's order will not go into immediate effect as she built in a 90-day delay to allow the government to appeal. It was made in response to a highly unusual court case in which one of the recipients of an NSL – an unnamed telecoms company – sued the FBI for breach of its rights in May 2011.

The FBI shot back by counter-suing the company.

The telecoms company was represented in the case by the Electronics Frontier Foundation, a non-profit group that advocates for public rights in the digital world. In a statement, the EFF's senior staff attorney Matt Zimmerman said the court order had exposed the constitutional shortcomings of the NSLs.

"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 foundation's legal director Cindy Cohn added that the judge had also highlighted the First Amendment as a protection for the public against executive surveillance power. "The NSL statute has long been a concern of many Americans, and this small step should help restore balance between liberty and security."