US District Court Judge Richard Leon in DC said the NSA’s huge data dragnet, which was first revealed by leaker Edward Snowden, appeared to violate the Fourth Amendment safeguard against unreasonable searches and seizures.

The first-of-its-kind ruling came in a lawsuit brought by conservative activist Larry Klayman and others, indicating Klayman would likely prevail in his challenge of the NSA program that gathers and stores so-called metadata on most US phone calls.

“I have little doubt that the author of our Constitution, James Madison, who cautioned us to beware ‘the abridgment of freedom of the people by gradual and silent encroachments by those in power,’ would be aghast,” Leon declared.

Leon said the government failed to demonstrate that the massive surveillance program had stopped terrorist attacks and issued a preliminary injunction prohibiting the NSA from collecting metadata from the Verizon accounts of Klayman and the other plaintiffs.

But Leon stayed the order to allow for the all-but-certain appeal by the Obama administration, which could take the case all the way to the Supreme Court.

The ruling bolstered both liberal and conservative privacy-rights activists, who have lined up more lawsuits to challenge NSA snooping.

Snowden, who is wanted on US espionage charges in and lives in asylum in Russia, said the ruling vindicated his actions.

“I acted on my belief that the NSA’s mass-surveillance programs would not withstand a constitutional challenge and that the American public deserved a chance to see these issues determined by open courts,” he said in a statement provided to the Associated Press. “Today, a secret program authorized by a secret court was, when exposed to the light of day, found to violate Americans’ rights. It is the first of many.,” he said.

Meanwhile, the White House shot down talk about granting Snowden immunity from prosecution if he gives back the secrets he swiped from the government.

“Our position has not changed on that matter at all,” said White House spokesman Jay Carney. “Mr. Snowden has been accused of leaking classified information and he faces felony charges here in the United States.”