The Senate has voted to reauthorize a controversial legal authority that enables vast government surveillance programs, including spying operations used by the NSA.

Passed 65 to 34

The bill was passed 65 to 34, and now moves to President Trump’s desk. He is expected to sign it into law. Earlier this week, a group of senators threatened to filibuster the bill, but lawmakers cleared a 60-vote hurdle earlier this week that allowed them to block the attempt.

The bill allows for continued spying operations under Section 702 of the Foreign Intelligence Surveillance Act. Critics charge that the bill, which renews 702 and powers National Security Agency spying, is nominally for foreign targets, but allows the government to sweep up American communications with few safeguards.

Apart from allowing the continuation of spying operations, critics have raised concerns that the bill also creates a path for the government to resume controversial “about” surveillance — a system for collecting data that mentions a surveillance target, even if it is not sent to or from a target.

Before the House vote, President Trump issued a tweet questioning, without evidence, whether the Trump campaign was surveilled through the program, even as the White House had publicly supported the bill. He soon sent another tweet walking back the first.

Last week, the House considered an amendment that would have added several privacy protections to the legislation, but the plan was voted down.