By Bob Egelko, The San Francisco Chronicle 
The nation's telecommunications companies can't be sued for cooperating with the Bush administration's secret surveillance program, but their customers can sue the government for allegedly intercepting their phone calls and e-mails without a warrant, a federal appeals court ruled Thursday.
In a pair of decisions, the Ninth U.S. Circuit Court of Appeals in San Francisco upheld a 2008 law immunizing AT&T and other companies for their roles in wiretapping calls to alleged foreign terrorists, but revived a suit that accused the government of illegally intercepting millions of messages from U.S. residents.
That lawsuit was partly based on testimony in 2003 by former AT&T technician Mark Klein about equipment in the company's office on Folsom Street in San Francisco that allowed Internet traffic to be routed to the government.
The Electronic Frontier Foundation, a privacy-rights organization representing AT&T customers, claimed the company had similar installations in other cities and used them for "dragnet" surveillance of everyday e-mails and phone calls, which the National Security Agency purportedly screened electronically for connections to terrorism.
"We look forward to proving the program is an unconstitutional and illegal violation of the rights of millions of ordinary Americans," said Cindy Cohn, the foundation's legal director.
Justice Department spokesman Dean Boyd declined comment.
President George W. Bush acknowledged in 2005 that his administration had eavesdropped on calls to suspected foreign terrorists without the warrants required by federal law, but his Justice Department denied the existence of a dragnet surveillance program.
Dozens of suits challenging the surveillance were transferred to San Francisco. In one case, then-Chief U.S. District Judge Vaughn Walker ruled in March 2010 that federal agents had illegally wiretapped an Islamic organization, which was accidentally sent a copy of the surveillance documents. The Obama  administration, which inherited the case, is appealing the ruling.
Obama backed law
Walker also allowed suits against telecommunications companies that allegedly took part in illegal surveillance, but Bush then signed a law, supported by then-Sen. Barack Obama, that immunized companies cooperating in presidentially approved antiterrorism intelligence-gathering.
The appeals court upheld that law in a 3-0 ruling, rejecting arguments that Congress had interfered improperly in ongoing lawsuits and had delegated excessive power to Bush's attorney general, who certified the companies' eligibility for immunity in a confidential filing.
The Obama administration defended the law and also sought to dismiss the customers' suit against the government, arguing that it was based on speculation about wiretapping and involved political and national-security issues that were exempt from judicial review. The appeals court disagreed.
"Although the claims arise from political conduct and in a context that has been highly politicized, they present straightforward claims of statutory and constitutional rights" of customers who allege their messages were intercepted, said Judge Margaret McKeown in the 3-0 ruling.