- Program allows NSA to eavesdrop on communications of foreign nationals through US companies.
- Attempts to pass privacy-protecting amendments have failed.
- Trump had previously alleged that the same program was used against his Presidential campaign.
The legislation, which passed 256-164 and split party lines, is the culmination of a years-long debate in Congress on the proper scope of U.S. intelligence collection - one fueled by the 2013 disclosures of classified surveillance secrets by former NSA contractor Edward Snowden.
Senior Democrats in the U.S. House of Representatives had urged cancellation of the vote after Trump appeared to cast doubt on the merits of the program, but Republicans forged ahead.
Trump initially said on Twitter that the surveillance program, first created in secret after the Sept. 11, 2001, attacks and later legally authorized by Section 702 of the Foreign Intelligence Surveillance Act, had been used against him but later said it was needed.
Some conservative, libertarian-leaning Republicans and liberal Democrats attempted to persuade colleagues to include more privacy protections. They failed on Thursday to pass an amendment to include a warrant requirement before the NSA or other intelligence agencies could scrutinize communications belonging to Americans whose data is incidentally collected.
Thursday's vote was a major blow to privacy and civil liberties advocates, who just two years ago celebrated passage of a law effectively ending the NSA's bulk collection of U.S. call records, another top-secret program exposed by Snowden.
The bill as passed by the House would extend the NSA's spying program for six years with minimal changes. Some privacy groups said it would actually expand the NSA's surveillance powers.
Most lawmakers expect it to become law, although it still would require Senate approval and Trump's signature. Republican Senator Rand Paul and Democratic Senator Ron Wyden immediately vowed to filibuster the measure but it was unclear whether they could convince enough colleagues to force changes.
The White House, U.S. intelligence agencies and Republican leaders in Congress have said they consider the surveillance program indispensable and in need of little or no revision.
Before the vote a tweet from Trump had contradicted the official White House position and renewed unsubstantiated allegations that the previous administration of Barack Obama improperly surveiled his campaign during the 2016 election.
"This is the act that may have been used, with the help of the discredited and phony Dossier, to so badly surveil and abuse the Trump Campaign by the previous administration and others?" the president said in a tweet.
"WE NEED IT!"
The White House did not immediately respond to a request to clarify Trump’s tweet but he posted a follow-up less than two hours later, after speaking on the phone with House Republican leader Paul Ryan.
"With that being said, I have personally directed the fix to the unmasking process since taking office and today’s vote is about foreign surveillance of foreign bad guys on foreign land. We need it! Get smart!" Trump tweeted.
Unmasking refers to the largely separate issue of how Americans' names kept secret in intelligence reports can be revealed.
After the vote Thursday, Ryan, asked about his conversation with the president, said Trump's concerns regarded other parts of the law.
"It's well known that he has concerns about the domestic FISA law. That's not what we're doing today. Today was 702, which is a different part of that law ... He knows that and he, I think, put out something that clarifies that," Ryan told reporters.
Asked by Reuters at a conference in New York about Trump's tweets, Rob Joyce, the top White House cyber official, said there was no confusion within Oval Office about the value of the surveillance program and that there have been no cases of it being used improperly for political purposes.
Without congressional action, legal support for Section 702 will expire next week, although intelligence officials say it could continue through April.
Section 702 allows the NSA to eavesdrop on vast amounts of digital communications from foreigners living outside the United States through U.S. companies such as Facebook Inc, Verizon Communications Inc and Alphabet Inc's Google.
The spying program also incidentally scoops up communications of Americans if they communicate with a foreign target living overseas, and can search those messages without a warrant.