The House on Thursday voted down an amendment that would have gutted a key counter-terrorism tool used by the nation's intelligence agencies, paving the way for likely House passage of a bill to keep that authority intact.

In a narrow 183-233 vote, lawmakers struck down an amendment by Rep. Justin Amash, R-Mich., to implement significant restrictions on Section 702 of the Foreign Intelligence Surveillance Act, which allows intelligence officials to spy on communications of non-citizens outside the United States.

The Amash provision would have bolstered requirements for the intelligence agencies to first obtain search warrants before viewing communications that might involve Americans and would have banned broader searches for terrorist threats that include scanning the contents of emails and not just the sender information.

Amash argued in favor of his amendment by saying the underlying bill "allows the government to collect an astounding amount of Americans' communications and it explicitly allows even more surveillance than the current law permits."

But a majority of House lawmakers struck down Amash's amendment after both Minority Leader Nancy Pelosi, D-Calif., a longtime member of the Intelligence Committee and Speaker Paul Ryan, R-Wis., both spoke out against it, arguing that it would undercut national security by preventing intelligence officials from learning about terrorism threats.

"If you pass the Amash amendment, you bring back to those days when we are flying blind from protecting our country from terrorism," Ryan said.

Most Democrats and a few dozen Republicans supported the amendment, however, and argued it would simply bolster privacy protections and would not hinder intelligence gathering.

"We must stand strong for individual liberty and privacy," Rep. Tom Garrett, R-Va. "That is who we are as a nation."