Representatives voted 293 to 121 to ban the NSA from performing warrantless searches of data collected under foreign surveillance program.

The US House of Representative on Thursday night endorsed a move to ban a major provision of the National Security Agency.

Representatives voted 293 to 121 to ban the NSA from performing warrantless searches of data collected under foreign surveillance program, The Guardian reported.

The so-called “backdoor search” provision was revealed in August by former NSA contractor Edward Snowden.

The House’s move came as an amendment added by Zoe Lofgren, Democrat of California, and Thomas Massie, Republican of Kentucky, to the annual defense appropriations bill, considered a must-pass piece of legislation to fund the US military.

Representatives also banned the NSA’s ability to secretly insert backdoor access to user data through hardware or communications services.

Democrats Ron Wyden and Mark Udall are seeking to reinstate the ban in the Senate version currently under judiciary committee consideration, the report said.

NSA officials it was critical for them to search for Americans’ data through its massive collections of email, phone, text and other communications content to discover “terrorists.”

Civil libertarians argue that the NSA spying efforts to gather data on Americans were illegal.

“The mere fact that the government’s ‘targets’ are foreigners outside the United States cannot render constitutional a program that is designed to allow the government to mine millions of Americans’ international communications for foreign intelligence information,” ACLU deputy legal director Jameel Jaffer told the Privacy and Civil Liberties Oversight Board in March.

That board is preparing to issue a report into the government’s backdoor searches on July 2.

A survey earlier in the month showed that most Americans believe Snowden did the right thing in exposing the spy agency’s espionage programs to the world.

Nearly a year after Snowden first leaked classified documents on the NSA’s spying activities, 55 percent of the respondents in the survey, conducted by research firm YouGov, said he was right to expose PRISM, an NSA surveillance program for tracking the use of US-based Internet servers by all people around the world.

Snowden’s revelations have helped start an international debate on the NSA’s spying and surveillance programs.