Privacy advocates suffered a stinging defeat by a federal appeals court which ruled in favor of the FBI’s nondisclosure surveillance requests enforced on social media and tech companies.

A three-judge panel of the Ninth US Circuit Court of Appeals in San Francisco reached a unanimous decision and ruled against privacy advocates while agreeing with a lower court ruling that the FBI, using gag orders, may issue secret national security letters requesting customer data.

Credo Mobile, a phone network operator, and CloudFare, a content distributor, had sued for the right to notify their customers of five national security letters (NSL’s) sent between 2011 and 2013.

Read more

The ruling stated that this does not violate free speech protections in the First Amendment of the Constitution.

The NSL’s act as subpoenas and, in this case, were for the purpose of obtaining customer data. A gag order is usually imposed as well, which facilitates a search without a warrant, all while the customer is unaware that the service provider is legally silenced. Tens of thousands of NSL’s are sent out annually and some of the gag orders do not expire, according to Reuters.

Judge Sandra Ikuta stated that the gag orders are of compelling US government interest, allow for appropriate judicial review and are sufficiently narrow. She said when changes to the law were authorized by Congress in 2015, more oversight was allotted to the issue of NSL’s, according to court documents.

There were no plans to appeal to the US Supreme Court as yet, said Andrew Crocker, an attorney for the Electronic Frontier Foundation who represented the companies in this case, Reuters reported.

Many civil and privacy rights organizations have joined with tech companies to challenge the policy.

In a separate case that is closed to the public, Facebook is disputing a ruling from the Washington DC Court of Appeals which prohibits the company from informing users when law enforcement is requesting information on them, particularly of a user’s political affiliation and their online commentary.

READ MORE: Microsoft bombarded with record number of US foreign intelligence requests in 2016

Even though the case is shrouded in secrecy, the timing of it, coupled with the references in public court documents, shows the inquiries may be related to people who looked to disrupt the inauguration of President Donald Trump. More than 200 people were charged with rioting, during the swearing in ceremony.

The social media giant says the gag order violates the First Amendment protections of the user as well as the company. The FBI search warrant seeks “all contents of communications, identifying information and other records” the Washington Post reported.

A decision by a DC court earlier this year opened the door for Facebook to team up with similar companies to strengthen their case.

A DC superior court judge in April denied a request by Facebook to abolish the gag order and told the tech firm to hand over the information the government was seeking.

Facebook appealed the decision and the court allowed them to share some details related to the case for legal reasons and to gain support from other companies. Many other companies have since signed on to back Facebook in the legal battle, according to the Washington Post.

Facebook has reported that in the last six months of 2016, there were almost 41,000 requests by the government for information. The company said they provided some of the data in question for 83 percent of the cases, the Post reported.