In a stunning decision, a DC-based federal judge has ruled that the National Security Agency spying revealed this summer violates the constitution.

The opinion (PDF) published today by US District Judge Richard Leon is in response to a lawsuit filed by Larry Klayman, a longtime conservative activist. Klayman was fast on the draw, filing his lawsuit on June 6, one day after widespread NSA surveillance was revealed in June.

Leon's order grants an injunction that will shut down the NSA's Bulk Telephony Metadata Program, and it requires the government to destroy the metadata collected on the plaintiffs' accounts. The shutdown will only happen if an appeals court agrees with Leon, who has stayed the injunction pending appeal, "in light of the significant national security issues at stake in this case and the novelty of the constitutional issues."

A problematic precedent

Today's 71-page order works around a problematic precedent for privacy reformers, Smith v. Maryland. That's the 1979 Supreme Court decision that found there's "no reasonable expectation of privacy" in the actual phone numbers dialed from a telephone, because they are "business records." That's what allows "pen registers" to be installed by police without judicial review, since it's not a "search" in the eyes of courts.

"The question before me is not the same question that the Supreme Court confronted in Smith," wrote Leon. Using a pen register "is a far cry from the issue in this case." We've reached a turning point in the history of technology, in Leon's reading. The government's decades-old reasoning can't hold up in the present day. He writes:

Indeed, the question in this case can more properly be styled as follows: when do present-day circumstances—the evolutions in the Government's surveillance capabilities, citizens' phone habits, and the relationship between the NSA and telecom companies—become so thoroughly unlike those considered by the Supreme Court 34 years ago that a precedent like Smith simply does not apply? The answer, unfortunately for the government, is now.

The court of 1979 could not "have ever imagined how the citizens of 2013 would interact with their phones," writes Leon, leaving the Smith precedent with little value. The pen register the court considered was operational for less than two weeks, in March 1976, and there was "no indication from the Court's opinion that it expected the Government to retain those limited phone records once the case was over." The "almost-Orwellian technology" used by the government to capture phone data "is unlike anything that could have been conceived in 1979."

The NSA is using two weeks of data collected from a single phone to justify "the creation and maintenance of a historical database containing five years' worth of data," writes Leon. "And I might add, there is the very real prospect that the program will go on for as long as America is combatting terrorism, which realistically could be forever!"

Fundamentally, Leon is making the case that the law must be reconsidered in the age of the smartphone. He cites data from CTIA counting more than 326 million mobile subscribers in 2012, including 22 million computers, tablets, and modems. "Count the phones at the bus stop, in a restaurant, or around the table at a work meeting or any given occasion," writes Leon. "Thirty-four years ago, none of those phones would have been there. Thirty-four years ago, city streets were lined with pay phones. Thirty-four years ago, when people wanted to send 'text messages,' they wrote letters and attached postage stamps."

A new North Star

The Smith case and NSA surveillance are wildly different, so a different analysis must take place. "I cannot possibly navigate these uncharted Fourth Amendment waters using as my North Star a case that predates the rise of cell phones," writes Leon.

No judge outside the secret Foreign Surveillance Intelligence Court has "has ever recognized a special need sufficient to justify continuous, daily searches of virtually every American citizen without any particularized suspicion," writes Leon. "In effect, the Government urges me to be the first non-FISC judge to sanction such a dragnet."

And Leon won't do it. The Verizon subscribers who filed the suit do have an expectation of privacy, and the government has intruded on it, he concludes.

In Leon's reading of the record, the government isn't merely trying to investigate possible terrorists. It's trying to do so as fast as it possibly can. "The affidavits in support of the Government's brief repeatedly emphasize this interest in speed," he notes. But the Government can't cite a single instance where the bulk metadata program "actually stopped an imminent attack."

He notes that the government could have shown more evidence to the judge privately, in chambers, but didn't. "Although the Government has publicly asserted that the NSA's surveillance programs have prevented 54 terrorist attacks, no proof of that has ever been put before me," Leon writes.

That leads him to have "serious doubts about the efficacy of the metadata collection program." While there's a "limited record" at this point in the litigation, the plaintiffs have a "substantial likelihood" of showing their privacy interests outweigh the government's interest in collecting the bulk data.

They are likely to show the bulk data program is an unreasonable search, and violates the Fourth Amendment, Leon finds. The public interest "weighs heavily in favor of granting an injunction" that will bar the government from collecting any metadata in association with their personal Verizon accounts.

Government lawyers also said that removing just the plaintiffs, two Verizon subscribers, from its database will be burdensome. That's not a "burden" Leon takes seriously. "Of course, the public has no interest in saving the government from the burdens of complying with the Constitution!"

A controversial plaintiff

In the coming months, Leon's opinion will be considered by the US Court of Appeals for the DC Circuit. That court considers an array of federal agency issues, and until recently it had leaned strongly Republican as the Senate held up confirmation of the candidates put forth by the Obama Administration. However, the opposition to judicial nominees has eased somewhat following Obama's re-election, and three of the four vacancies have been filled in 2013.

The case against the NSA is not Klayman's first controversial lawsuit. Many of his cases have not ended well. Klayman has been rebuked and sanctioned by several judges, and he has been barred from some courtrooms.

In 2012, Klayman filed a lawsuit in Florida to kick President Barack Obama off the primary ballot in that state, based on the discredited theory that he was not born in the United States. In 2011, he sued Facebook for "negligence" because it didn't remove an anti-Israel page quickly enough. Neither suit was successful.

The Klayman suit is not the only challenge to NSA telephone-data program. The more widely known case is the one filed in July by the Electronic Frontier Foundation and American Civil Liberties Union. That case, filed on behalf of First Unitarian Church of Los Angeles, was consolidated with a pre-Snowden anti-NSA lawsuit called Jewel v. NSA. The government has filed a motion to dismiss, and the case awaits a judge's decision. A DC-based privacy group, EPIC, tried to take the issue straight to the Supreme Court, but that failed.

Dissatisfaction with NSA surveillance has hit Congress, as well. The USA Freedom Act, which would end NSA's collection of bulk phone data, has 130 co-sponsors.

NSA leaker Edward Snowden released a statement on today's decision, which was published in The New York Times. Snowden said: