In a landslide move today, the House voted to pass the USA Freedom Act, which would effectively shut down portions of the NSA's controversial domestic spying program in their current form.

The bill, passed overwhelmingly by a vote of 338 to 88, would put an end to the government’s bulk collection of phone records from U.S. telecoms—a program first uncovered by USA Today in 2006 and re-exposed in 2013 by NSA whistleblower Edward Snowden.

The bill instead calls for records to be retained by telecoms and forces the NSA to obtain court orders from the Foreign Intelligence Surveillance Court to gain access to them. It also requires the agency to use specific search terms to narrow its access to only relevant records.

The bill, however, isn't in the clear just yet. It now goes to the Senate for a vote.

Civil liberties groups like the Electronic Frontier Foundation and others are divided in their support of the bill. Many say it's better than nothing, but hope that the Senate will add wording to strengthen protections before passage.

EFF had supported the legislation until last week when a federal appeals court ruled that the bulk collection of phone data is illegal. In that decision, the Second Circuit Court of Appeals found that the collection of Americans’ phone metadata was never authorized by Section 215 of the Patriot Act, as the intelligence community had insisted. EFF has now said that the ruling should embolden the Senate to roll back the bill to a previous 2013 version that provides stronger reforms.

Most importantly, EFF says lawmakers need to include language that provides a strict interpretation of key terms in the statute such as “relevant” and “investigation,” to prevent the NSA from using loose interpretations to keep collecting massive amounts of data. "This easy task will make sure that the law is not read as rejecting the Second Circuit’s reading and will help ensure that the USA Freedom Act actually accomplishes its goal of ending bulk collection," EFF wrote in the post last week.

Julian Sanchez, senior fellow at the Cato Institute, praised passage of the USA Freedom Act today but also said it doesn't go far enough.

"While the reforms embedded in the USA Freedom Act by no means address the full range of surveillance excesses Americans have learned about over the past two years, they represent a significant step in the right direction—and, at long last, an end to the continuous, reflexive augmentation of government powers to intrude into the private lives of citizens," he wrote in a statement. "It’s unfortunate, however, that this iteration of the bill dropped the critical 'superminimization' procedures that were present in the previous Senate version of the statute, and the law would be greatly improved by their restoration."

Supporters of the USA Freedom Act in the Senate are now under pressure to pass it by May 22, when Section 215 of the Patriot Act expires.

The bill has the support of the White House, which has said it balances the need for surveillance with the preservation of constitutional protections for Americans. Attorney General Eric Holder and even the Director of National Intelligence James Clapper have both expressed support for it.

Lawmakers who oppose it, however, say it will handicap the NSA and allow terrorist groups to prosper. In a Wall Street journal op-ed, former NSA and CIA Director Gen. Michael Hayden and former U.S. Attorney General Michael Mukasey called it the kind of “NSA Reform That Only ISIS Could Love,” referring to the militant group known as the Islamic State of Iraq and Syria that has terrorized parts of the Middle East.