A U.S. District Court on Wednesday dismissed lawsuits against telecommunications companies in a warrantless wiretap case, ruling that former President George W. Bush's administration had properly requested the cases closed for national security reasons.

Companies including AT&T Inc and Verizon Communications Inc faced dozens of suits accusing them of improper participation in a warrantless wiretap program launched by Bush after the September 11 attacks.

In 2008, the Democratic-led Congress retroactively shielded phone companies from such suits, on the basis that immunity was needed to win future wiretap cooperation.

Some Democrats and civil liberties advocates countered that companies should be held accountable for participating in a program critics say was illegal.

Northern California U.S. District Judge Vaughn Walker dismissed the suits against the communications companies, in the consolidated case, called In Re: National Security Agency Telecommunications Records Litigation.

He ruled that former U.S. Attorney General Michael Mukasey had certified properly that the cases fell under the immunity standards of the Foreign Intelligence Surveillance Act Amendments Act of 2008.

The act allows the attorney general, for instance, to effect dismissal by certifying to the court that a case involved an anti-terrorist measure authorized by the U.S. president between September 11, 2001 and January 17, 2007.

The Electronic Frontier Foundation and the American Civil Liberties Union, which are coordinating the cases, said they would appeal, arguing the amended act was unconstitutional. The EFF in a separate case is suing the government, alleging the surveillance was illegal.

The Department of Justice, AT&T and Verizon were not immediately available for comment.

(Reporting by Peter Henderson; Editing by Peter Cooney)