The House passed legislation Thursday that would prevent the NSA from spying on American citizens whose data was incidentally collected during foreign dragnets, marking the second year in a row that the lower chamber has put the kibosh on backdoor domestic spying.

Sponsored by Reps. Thomas Massie, R-Ky., and Zoe Lofgren, D-Calif., the amendment to the Department of Defense spending bill was approved in a 255-174 vote across party lines.

The bipartisan duo succeeded in passing a similar anti-surveillance amendment during last year’s appropriations process, only to watch as leadership stripped it out while crafting a final omnibus spending bill last December.

Massie said he hopes the restrictive language will have a better chance of surviving this time around.

“If the surveillance-related legislation in the House and the Senate over the last two weeks is any indication, there’s still an appetite in Congress to reform the NSA,” he told The Intercept.

The measure defunds the spy agency’s warrantless searches of American’s communications that had been collected under Section 702 of the Foreign Intelligence Surveillance Act (FISA).

“We know that mass surveillance of Americans, as reported in the news, has taken place under the FISA Section 702 authority,” Lofgren said following the vote. She added that Thursday’s actions show that the House is “committed to upholding the Constitution and protecting Americans from warrantless invasions of their privacy.”

Although the FISA provisions prohibit the spy agency from directly targeting Americans with collection tools, a directive at the agency revealed by whistleblower Edward Snowden allowed analysts to query foreign intelligence databases for already-collected data belonging to domestic persons.

“Backdoor surveillance authorized under Section 702 of the FISA Amendments Act is arguably worse than the bulk collection of records illegally collected under Section 215 of the Patriot Act,” Massie said in a statement, referring to the NSA’s phone records collection program.

Last week, President Obama signed the USA Freedom Act into law, which reformed the phone dragnet and extended NSA bulk collection authorities under the Patriot Act through 2019.

Massie said that the law, which didn’t address spying under Section 702 of FISA, would not be the high-water mark for reformers.

“The USA Freedom Act is only the tip of the iceberg. Much more remains to be done to bring government back into its constitutional bounds,” he said, echoing a promise made by other lawmakers jockeying to rein in the spy agency.

The Lofgren-Massie measure also prohibits the NSA from forcing companies and individuals to insert weaknesses into their security technology — similar to a separate pro-encryption provision that Massie affixed to a Justice Department spending bill considered by the House last week.