A federal judge on Wednesday threw out 46 civil lawsuits filed against telecommunications companies for allowing the National Security Agency to probe their networks for terrorist communications without approval from a court.

Companies such as AT&T were granted immunity under the Foreign Intelligence Surveillance Act Amendments Act (FISAAA), signed into law in July 2008, ruled U.S. District Court Chief Judge Vaughn R. Walker in a 46-page opinion.

The law gave companies immunity from lawsuits if the U.S. government provided proof to a court that the surveillance was authorized by the president, was legal or did not occur. It applied to surveillance that happened between Sept. 11, 2001, and Jan. 17, 2007.

However, Walker wrote that plaintiffs can amend their complaints within 30 days to address what they believe are wrongful actions on the part of the companies outside of the timespan covered by FISAAA.

The ruling is a blow to organizations such as the Electronic Frontier Foundation (EFF) and the ACLU (American Civil Liberties Union's), which argue that FISAAA is unconstitutional and that the companies flouted the law and violated people's privacy rights.

The EFF and the ACLU's affiliates in California and Illinois plan to appeal the ruling in the 9th U.S. Circuit Court of Appeals, according to a statement on the EFF's Web site.

One of the EFF's chief contentions is that by passing FISAAA, Congress wrongly wrestled power from the judicial branch, violating a principle that Congress should not be able to dictate to the judiciary outcomes for specific cases, according to the ruling.

The surveillance program, authorized by former President George W. Bush, operated in secret for about four years before it became known through the media in December 2005. Under the Terrorist Surveillance Program, the NSA could listen in on phone calls and intercept e-mail of U.S. citizens without a court-issued warrant.

In the wake of those reports, starting in January 2006 dozens of lawsuits were filed against telecommunication operators, alleging their cooperation with U.S. intelligence agencies was illegal. Those suits contended the companies breached federal and state laws concerning privacy, and their actions constituted breach of contract and unfair business practices.

The suits collectively sought hundreds of billions of dollars in damages from the telecommunication operators, which pushed hard for protection.