(Reuters) - A U.S. appeals panel on Thursday upheld the constitutionality of a federal law that grants immunity to telecommunications companies that assist the U.S. government in conducting surveillance of American citizens.

However, the 9th U.S. Circuit Court of Appeals also revived a separate lawsuit against the government over its surveillance activities.

Several lawsuits filed in the wake of revelations about warrantless wiretapping alleged that telecom companies provided authorities with direct access to nearly all communications passing through their domestic facilities.

Besides the government itself, defendants included AT&T, Sprint Nextel and Verizon Communications Inc.

In 2008, Congress granted telecoms immunity for cooperating with the government's intelligence-gathering activities. A district judge in San Francisco upheld the law as constitutional, and dismissed the claims against the companies.

In a ruling on Thursday, a unanimous three-judge panel of the 9th Circuit agreed. The appeals court covers nine Western U.S. states.

Cindy Cohn, legal director for the Electronic Frontier Foundation, a leading plaintiff in both cases, said they had not yet decided whether to appeal the telecom ruling.

It's not the case that only one person should protect your privacy, both the government and the provider owe you a duty to protect your privacy, Cohn said.

A spokesman for the U.S. Department of Justice, which defended the immunity provision, declined to comment, as did a Verizon spokesman. Representatives from AT&T and Sprint did not respond to a request for comment.

Judge Margaret McKeown of the 9th Circuit rejected the argument that immunity closes the courts to the plaintiffs. Only the telecommunications companies are covered, she wrote, not the government.

The federal courts remain a forum to consider the constitutionality of the wiretapping scheme and other claims, she wrote.

In a separate ruling, the 9th Circuit on Thursday allowed a separate case against the government to proceed, in which plaintiffs allege a communications dragnet of ordinary citizens.

That lawsuit claims the National Security Agency diverted Internet traffic into secure rooms in AT&T facilities across the country. The proposed class action alleges an unprecedented suspicionless general search throughout the communications network.

The 9th Circuit reversed a lower court and ruled that the plaintiffs have legal standing to pursue the case. If the government does not appeal, then the litigation would return to a California federal court, where the Justice Department could argue that the case should be dismissed on state secrets grounds.

Cohn said it has been nearly six years since warrantless wiretapping was revealed. I think the American people deserve a little faster justice than that, she said.

The telecom immunity case in the 9th Circuit is In re: National Security Agency Telecommunications Records Litigation, 09-16676.

The dragnet case in the 9th Circuit is Carolyn Jewel, Tash Hepting, Gregory Hicks, Erik Knutzen and Joice Walton on behalf of themselves and all others similarly situated v. National Security Agency et al., 10-15616.