In a landmark ruling Thursday, a federal judge forcefully refused to dismiss a civil liberties group's lawsuit against AT&T for its alleged complicity in widespread warrantless government surveillance, despite the government's argument that the suit could reveal state secrets – a rarely used claim that nearly always terminates a lawsuit.

In a 72-page written ruling (.pdf), U.S. District Court Chief Judge Vaughn Walker rejected the government's argument that merely allowing the case to proceed would cause critical harm to U.S. national security.

The decision marks a significant victory for the Electronic Frontier Foundation, and puts a rare limitation on the reach of the president's "state secrets privilege" to sweep alleged illegal government activities under the cloak of national security.

Inside the Secret Room Courtroom Clash!

A federal judge refuses to give AT&T back its internal documents, but orders the EFF not to give them out.

Whistle-Blower's Precognition

Years before the NSA's warrantless surveillance program made national headlines, then-AT&T technician Mark Klein suspected his company was colluding with the government to spy on Americans.

Exhibit A?

Former AT&T technician Mark Klein offers a firsthand account of his alleged discovery of a secret room routing American internet traffic straight to the NSA – and provides documents he says prove his case.

The Ultimate Net Monitoring Tool

A little-known company called Narus makes the packet-inspection technology said to be the basis of the NSA's internet surveillance. Here's how it works.

Plus:

Daily updates from 27B Stroke 6, the Wired News security and privacy blog.

Walker found that the program was not a secret since "public disclosures by the government and AT&T indicate that AT&T is assisting the government to implement some kind of surveillance program."

"Dismissing this case at the outset would sacrifice liberty for no apparent enhancement of security," Walker wrote.

(Disclosure: Wired News has filed a motion to intervene in the case, asking the court to make public evidence, filed under seal, of AT&T's alleged wiretapping activities.)

The administration has publicly confirmed a December report in The New York Times that revealed the National Security Agency was wiretapping Americans' overseas phone calls to numbers or people the government suspected might be connected to terrorism, an effort the Bush administration later dubbed the "Terrorist Surveillance Program." The NSA is not seeking or obtaining court authorization for the wiretaps.

Under Thursday's ruling, the lawsuit will continue, allowing the San Francisco-based EFF to begin obtaining documents through discovery from AT&T.

In a legally unprecedented move, the judge also wants to appoint an outside expert with a high-level clearance who can review such evidence to evaluate whether its release would compromise national security.

Walker also denied AT&T's motions to dismiss the case on the grounds that the plaintiffs can't prove they were monitored by the program, and that the company can't be sued for helping the government in good faith.

EFF legal director Cindy Cohn applauded the judge's decision, which came as the Senate Judiciary Committee is preparing to consider a bill that would move all lawsuits over government spying to the secretive Foreign Intelligence Surveillance Court in Washington.

"We think this shows the regular court system can handle these cases, and that as an open and free society, our regular court system should handle these cases," Cohn said.

Recognizing that his ruling would be controversial, the judge is allowing both AT&T and the government to immediately appeal his ruling to the 9th U.S. Circuit Court of Appeals.

While both are widely expected to do so, neither announced such plans immediately.

In response to the ruling, AT&T released a statement, which read, in part, "We are reviewing Judge Walker's order and evaluating possible next steps. AT&T is fully committed to protecting our customers' privacy and we would not provide customer information to any government agency except as specifically authorized under the law."

Department of Justice spokesman Charles Miller said that the government "has made no determination as to what its next move is."

The EFF's suit relies heavily on evidence provided by former AT&T technician Mark Klein, who alleges he saw an NSA room in AT&T's San Francisco internet switching station. Klein provided documents that purportedly show how AT&T siphoned off traffic across its fiber-optic cables into that room.

In May, Wired News published portions of those documents, which it acquired from a source not involved in the litigation.

In addition to denying the government's motion to dismiss, Walker's decision also allows AT&T to reveal whether or not the U.S. attorney general provided the company with a letter directing it to cooperate in wiretapping its customers, which could provide the company with a defense against the EFF's lawsuit under federal wiretapping law.

"If the government's public disclosures have been truthful, revealing whether AT&T has received a certification to assist in monitoring communication content should not reveal any new information that would assist a terrorist and adversely affect national security," Walker wrote. "And if the government has not been truthful, the state secrets privilege should not serve as a shield for its false public statements."

The ruling was not a complete defeat for the Bush administration. Noting that the government hasn't confirmed stories in the Los Angeles Times and USA Today reporting that AT&T has allowed the NSA to troll through its trillion-record call detail database, the judge ruled that AT&T cannot confirm or deny that it received a letter directing such access, nor can the EFF ask for documents about that program.

Lawyers for each side have until July 31 to advise the judge on the appointment of an outside expert and to suggest candidates, while the next court hearing is scheduled for Aug. 8.

The case is Hepting v. AT&T Corp.