In a legal setback for the National Security Agency, a federal district judge in Washington, D.C. has ruled that the collection of bulk telephone records is basically a warrantless search, and that the controversial U.S. intelligence program runs afoul of the Fourth Amendment's ban on unreasonable searches.

In a 68 page ruling which represented the first legal examination outside of a special intelligence court on the work of the NSA, the judge quoted past rulings on government searches in saying that "warrantless searches are per se unreasonable under the Fourth Amendment."

Judge Leon criticized the feds for relying on a 34 year old Supreme Court precedent to allow for the collection of bulk phone records, writing that "the almost-Orwellian technology that enables the Government to store and analyze the phone metadata of every telephone user in the United States is unlike anything that could have been conceived in 1979."

That 1979 ruling, Smith v. Maryland, held that it was not a true "search" for the government to get basic data about telephone calls - the so-called "pen register."

But the judge said the ability of the government to analyze the information with data mining programs makes it a much different situation.

"I believe that bulk telephony metadata collection and analysis almost certainly does violate a reasonable expectation of privacy," the judge wrote.

The phone record collection program became public earlier this year with the leaks of Edward Snowden, who left the U.S. to avoid arrest and is now in Russia.

In Congress, Democrats hailed the ruling.

"Americans deserve an open and transparent debate about the constitutionality, efficacy, and appropriateness of the government’s dragnet collection programs," said Sen. Patrick Leahy (D-VT), the Chairman of the Senate Judiciary Committee.

"When exposed to the sunlight of Constitutional scrutiny, this massive secret surveillance program could not stand," said Sen. Richard Blumenthal (D-CT).

While other challenges are also in the legal pipeline, the judge gave the feds six months to make their appeal - which may accelerate the consideration of this case and any appeals.

It is not out of line to assume that at some point in the next 12-24 months, that this matter could make its way to the U.S. Supreme Court.

The court ruling could certainly come up at the White House on Tuesday, as President Obama will meet with executives from leading hi-tech companies; a White House official said in addition to talking about healthcare.gov and the Obama health law, it was expected that the tech executives would address "unauthorized intelligence disclosures."

Top executives of Apple, Twitter, Etsy, Netflix, Dropbox, Yahoo, Zynga, Comcast, LinkedIn, Facebook, Google, Microsoft and AT & T will be on hand for that meeting.