The House on Wednesday passed a bill aiming to the end the government’s bulk data collection and five-year retention of U.S. call records, voting 338 to 88 in favor of the measure. The legislation faces an uncertain future in the Senate, where a previous version of the proposal was voted down last year.

The White House threw its support behind the USA Freedom Act on Tuesday night, saying in a statement that the bill “strikes an appropriate balance between significant reform and preservation of important national security tools.”

The Freedom Act would reauthorize the Patriot Act while limiting not only the NSA’s ability to collect data using Section 215, but also using certain methods granted by the Foreign Intelligence Surveillance Act.

“The USA Freedom Act's significant reforms would provide the public greater trust and confidence in our national security programs and the checks and balances that form an integral part of their operation," the White House statement read.

It’s now up to the Senate to debate its version of the Freedom Act, which has been introduced by Sen. Patrick Leahy, D-Vt., and Sen. Mike Lee, R-Utah. Time is running out, however, as Congress must decide the future of government surveillance powers before some of those abilities expire on June 1 with the sunset of the Patriot Act, a law passed weeks after the 9/11 terror attacks in 2001. The National Security Agency has used Section 215 of the Patriot Act as justification for its broad collection of phone records, but it would lose those powers if Congress­ does not reauthorize them.

There are not enough votes in the House to reauthorize the Patriot Act without amendments limiting its authority, according to statements from House Judiciary Committee Chairman Bob Goodlatte, R-Va., and Rep. James Sensenbrenner, R-Wis., who is the Freedom Act’s co-author.

If amendments cannot be made to strengthen privacy rights in the Freedom Act, some members of Congress and advocacy groups argue that it would be preferable to allow the Section 215 surveillance powers ­to expire completely rather than pass the bill. A federal appeals court boosted opposition to the Patriot Act powers last week when judges ruled that the NSA’s data collection is illegal and that Section 215 does not protect justify the storage of Americans’ call records.

Debate on the bill takes place nearly two years after leaks from former NSA contractor Edward Snowden revealed the broad scope of the agency’s collection of phone and Internet records. Sesenbrenner, who also authored the Patriot Act, has said he did not intend the NSA to use that law’s spying powers so broadly, and opened debate of Freedom Act on Wednesday on the House Floor sharing his frustration with government surveillance.

“I don’t fault my colleagues who wish this bill went further to protect our civil liberties,” said Sensenbrenner. "For years the government has violated the privacy of innocent Americans, and I share your anger. But letting Section 215 and other surveillance authorities expire would not only threaten our national security, it would also mean less privacy protections."

Presidential candidate Sen. Rand Paul, R-Ky., has told U.S. News that he would oppose any bill that reauthorizes the Patriot Act. Paul was one of two lawmakers, along with Sen. Bill Nelson, D-Fla., who had initially supported the Freedom Act last year but prevented it from clearing the Senate. Rep. Justin Amash, R- M.I., another staunch advocate for surveillance reform, said in a statement Wednesday that he opposed the House bill because it “falls woefully short of reining in the mass collection of Americans’ data.”

Senate Majority Leader Mitch McConnell, R-Ky., on the other hand, is leading a charge to reauthorize the Patriot Act until 2020 without any amendments – including those proposed by the Freedom Act. McConnell’s office previously told U.S. News the Patriot Act’s spying powers are needed to counter the terrorist threat of the Islamic State group.

Privacy advocates are also divided about whether the Freedom Act goes far enough to curtail government surveillance. The Center for Democracy and Technology think tank supports the bill, arguing in a report that it balances privacy and security.

The American Civil Liberties Union neither supports nor opposes the Freedom Act. Versions of the Freedom Act in both houses of Congress are similar, so the Senate would need to add stronger provisions to the bill, including procedures to purge surveillance data that is not relevant to an investigation, says Neema Singh Guliani, legislative counsel with the American Civil Liberties Union.

“It would end some of the more egregious forms of data collection, like collecting entire ZIP codes, but it would still allow the government to collect vast amount of data on innocent people,” Guliani says.

If the Patriot Act were allowed to expire in June the government would still be able to invoke spying powers, but reauthorizing it through the Freedom Act would have a damaging effect of legitimizing the surveillance, she says.