A U.S. appeals panel on Thursday upheld immunity for telecom companies that assist the U.S. government in conducting surveillance of American citizens.

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.

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.

In a ruling on Thursday, a three-judge panel of the 9th U.S. Circuit Court of Appeals agreed.

Given the circumstances dictated by national security concerns, the statute provides sufficient notice of a range of grounds for immunity, the court wrote.

(Reporting by Dan Levine; editing by Mark Porter)