The legislation, which quickly passed the House of Representatives last week, is expected to be signed into law by President Donald Trump today.
Thursday’s 65-34 passage in the Senate was mainly a foregone conclusion after senators earlier this week cleared a 60-vote procedural hurdle, which split party lines and came within one vote of failing.
Passage of the legislation marked a disappointing end to a year long effort by a coalition of liberal Democrats and libertarian-leaning Republicans to redefine the scope of US intelligence collection following the 2013 disclosures of classified surveillance secrets by former NSA contractor Edward Snowden.
The bill authorises what is known as Section 702 of the Foreign Intelligence Surveillance Act, which gathers information from foreigners overseas but incidentally collects an unknown amount of communications belonging to Americans.
This allows the NSA is empowered to eavesdrop on vast amounts of digital communications via American companies like Facebook, Verizon Communications, and Google.
But the programme also incidentally scoops up Americans’ communications, including when they communicate with a foreign target living overseas. Intelligence analysts can then search those messages without a warrant.
The White House, US intelligence agencies and congressional Republican leaders said the programme is indispensable to national security.
Opponents of the programme said it allows the NSA and other intelligence agencies to grab data belonging to Americans in a way that represents an affront to the US Constitution.
The bill passed by Congress does add a warrant requirement for cases where the Federal Bureau of Investigation seeks emails related to an existing criminal investigation that has no relevance to national security. Privacy advocates said that essentially gave more protection to criminal suspects than ordinary Americans caught up in the programme’s surveillance.