The Foreign Intelligence Surveillance Act is a roughly 40-year-old federal law limiting how USA spy agencies can monitor Americans' communications, first passed in the wake of 1970s Congressional investigations into privacy violations by the three-letter spy agencies.
The debate centers on Section 702 of the Foreign Intelligence Surveillance Act, which allows for collection of foreign intelligence data, and that privacy advocates say invasively scoops up Americans' communications.
Congress did, in 2015, vote to end and replace a programme that Snowden exposed under which the NSA, under Section 215 of the Patriot Act, had been secretly collecting logs of Americans' domestic phone calls in bulk.
Before the vote, a tweet from Trump had contradicted the official White House position and renewed unsubstantiated allegations that the previous Democratic administration of Barack Obama improperly surveilled the Republican's 2016 presidential campaign.
President Donald Trump prompted confusion before the vote with a tweet claiming the programme had been used to "abuse" his campaign. "We need it! Get smart!" he followed up. Speaker of the House Paul Ryan (R-WI) argued that the amendment would lead to the country "flying blind" in its search for terrorism suspects.
Section 702, which allows the intelligence community to monitor foreign communications, is set to expire January 19.
"House votes on controversial FISA ACT today", Trump tweeted.
Almost two hours after his first tweet, Trump backtracked.
Top intelligence bosses scrambled to the White House on Thursday morning after President Trump complained on Twitter about a controversial spy bill they then urged him to support.
Just after FISA was voted to be reauthorized and sent to the upper chamber, Senator Rand Paul (R-KY), known for his staunch libertarian stances on surveillance issues, threatened to filibuster the bill. We all understand that he's declined over the past couple of years, and America's well-being depends on Fox & Friends switching to a simpler format and being more careful to explain to Trump what he does and doesn't support.
The night before the House vote, White House press secretary Sarah Huckabee Sanders issued a statement strongly opposing an amendment that would require the Federal Bureau of Investigation to get a court order before searching for and reading Americans' emails and messages swept up in surveillance of foreigners' communications.
Section 702 allows the NSA to eavesdrop on vast amounts of digital communications from foreigners living outside the United States through US companies such as Facebook Inc, Verizon Communications Inc and Alphabet Inc's Google.
Now the reauthorization goes to the Senate, where Sens.
Wyden opposes the legislation because he believes that it offers too few protections for Americans' privacy rights.