A federal judge today rejected the assertion from President Barack Obama's administration that the state secrets defense barred a lawsuit alleging the government is illegally siphoning Americans' communications to the National Security Agency.

U.S. District Judge Jeffrey White in San Francisco, however, did not give the Electronic Frontier Foundation the green light to sue the government in a long-running case that dates to 2008, with trips to the appellate courts in between.

The EFF's lawsuit accuses the federal government of working with the nation's largest telecommunication companies to illegally funnel Americans' electronic communications to the National Security Agency – a surveillance program the EFF said commenced under the President George W. Bush administration following 9/11. The allegations were based on a former AT&T technician's documents that outline a secret room in an AT&T San Francisco office that routes internet traffic to the NSA.

The decision (.pdf) comes a month after the Guardian leaked documents that seemingly support the EFF's allegations.

The state secrets doctrine was first recognized by the Supreme Court in the McCarthy era, and is asserted when the government claims litigation threatens national security and might expose state secrets. Judges routinely dismiss cases on that assertion alone.

Still, the judge also ruled that the a domestic surveillance law known as the Foreign Intelligence Surveillance Act, in many instances, did not allow the government to be sued for illegally spying in Americans. White said that the 9th U.S. Circuit Court of Appeals ruled last year that when Congress wrote the law regulating eavesdropping on Americans and spies, it never waived sovereign immunity in the section prohibiting targeting Americans unlawfully.

The appeals court also said the FISA law removed the government's ability to assert the state secrets defense.

"That is huge," Cindy Cohn, the EFF's legal director, said in a telephone interview. "That was the centerpiece of the government's defense."

While the judge dismissed a slew of counts challenging the spying, he declined to rule on the constitutional issues of whether the alleged spying breached the First Amendment and Fourth Amendment. He ordered further briefing on that issue, including whether FISA preempts the state secrets privilege on those claims, and whether the suit can continue "without resulting in impermissible damage to ongoing national security efforts."

White ruled that "the potential risk to national security may still be too great to pursue confirmation of the existence or facts relating to the scope of the alleged governmental program." Yet the judge also wanted briefing on how the Guardian's publication of snippets about the program affected national security.

A hearing has been set for August 23 in San Francisco.