The House on Thursday held an historic vote to end the National Security Agency’s bulk collection of phone data on millions of Americans, an activity that came to light only after it was leaked by former NSA contractor Edward Snowden.

That leak sparked a sharp debate over whether Snowden was a traitor or a heroic whistleblower, one that does not appear to be decided since his flight to Russia.

NSA bulk surveillance Edward Snowden Bob Goodlatte John Conyers Jim Sensenbrenner

The House voted Thursday to rein in the NSA’s bulk collection of phone data on Americans. (AP Photo/Patrick Semansky, File)

But on Thursday, the House used its new knowledge of the program to severely curtail it, in a bill that large majorities of both parties supported. The USA FREEDOM Act was passed in a 303-121 vote. Among the “no” votes were 51 Republicans and 70 Democrats, many of whom wanted the bill to further restrict the NSA.

“[F]or 225 years, we have refused to accept the idea that in order to have national security, we must sacrifice our personal freedoms,” said Rep. Bob Goodlatte (R-Va.), the chair of the House Judiciary Committee.

“Some, however, think these goals are in conflict with one another following last year’s unauthorized disclosure of the National Security Agency’s data collection programs operated under the Foreign Intelligence Surveillance Act, or FISA,” he added. “Today, the House will consider legislation that once again proves that American liberty and security are not mutually exclusive.”

Goodlatte explained that the bill would immediately prevent the NSA from sweeping up all Americans’ phone records as part of its effort to collect information about possible terrorist threats. It would also ban other bulk collection activities, like those done pursuant to National Security Letters issued by the FBI.

Instead, the bill would require the government to get a court’s permission to access data. It would also require the government to use specific terms, like a person’s name, address, or account number, which he said would limit the data available to the government.

Rep. Jim Sensenbrenner (R-Wis.), who sponsored the bill, said these changes would correct the government’s attempt to abuse data collection authority that was first provided in the PATRIOT Act in 2001, which passed soon after the 9/11 attacks.

“We’re here today because the government misapplied the law, and upset the balance between privacy and security that we had fought to preserve 13 years ago,” Sensenbrenner said. “In a feat of legal gymnastics, the administration convinced the FISA court that because some records in the universe of every phone call Americans make might be relevant to counter terrorism, the entire universe of calls must be relevant.”

Despite broad support for the bill, some argued that last minute changes could still allow the NSA to collect data on Americans without any cause. The original bill said the government must request information on a unique person, entity or account when seeking phone data.

But the final bill passed on Thursday broadens that somewhat by saying the government must choose terms “such as” names, entities or accounts, and adds specific addresses or devices as other possible search terms. Some said use of the words “such as” could give courts wiggle room to approve other specific requests from the government for information, and said they worry this could let the NSA run wild again.

“Regrettably, we have learned that if we leave any ambiguity in the law, the intellgence agencies will run a truck right through that ambiguity,” said Rep. Zoe Lofgren (D-Calif.).

This change prompted some groups that supported the original bill to withdraw that support. The Electronic Frontier Foundation, for example, agreed with Lofgren that the broader search criteria opens the door to being abused by the NSA.

“Congress has been clear that it wishes to end bulk collection, but given the government’s history of twisted legal interpretations, this language can’t be relied on to protect our freedoms,” the group said.

But supporters dismissed those fears, and said courts will still have to approve search terms and that Congress will quickly become aware if this new language is abused. Rep. John Conyers (D-Mich.), the top Democrat on the Judiciary Committee, said he doubts the government would request data on all phone records from a zip code, or from the entire eastern seaboard.

Others said the change is the sort of compromise needed to end bulk collection, but also maintain the government’s tools to ensure it can monitor terrorist communications.

Several members agreed that more could be done to rein in the NSA, but said the bill passed Thursday is a good first step. Sensenbrenner said he too was disappointed in some of the compromises that were made, and said groups that withdrew their support have a reason to be skeptical of the government.

“I don’t blame people for losing trust in their government, because the government has violated their trust,” he said.

“But this bill still does deserve support,” he added. “Today’s vote is a first step, and not a final step, in our efforts to reform surveillance.”

House passage sends the bill to the Senate, which could consider it soon given that the White House supports the measure. On Wednesday, the White House issued a statement of support that said it strikes the right compromise.

“The bill ensures our intelligence and law enforcement professionals have the authorities they need to protect the nation, while further ensuring that individuals’ privacy is appropriately protected when those authorities are employed,” it said.