The Senate voted Thursday 65-34 to pass the Foreign Intelligence Surveillance Act (FISA) Amendments Reauthorization Act of 2017, which will allow security agencies warrantless electronic surveillance of United States citizens for the next six years.

The amendment allows intelligence agencies like the NSA and the FBI to tap into data from companies like AT&T and Google without a warrant.

The bill, which had 43 Republicans and 21 democrats voting in its favor, is likely to be signed into law by President Donald Trump by the end of this week.

The amendment deals with the reauthorization of Section 702 of the FISA, which was enacted in 2008 and allows intelligence agencies to spy on foreigners without a warrant, Fortune reported.

Though present from during former President George Bush’s time, the program came under scrutiny after the dramatic 2013 leaks by former NSA contractor Edward Snowden.

Snowden tweeted about the development:

Though the targets under Section 702 are foreigners, it is easy for the security agencies to tap into the contents of communications by U.S. citizens.

According to a report in Motherboard, Americans have been spied upon by using two loopholes in the section known as “backdoor search” and “about collection.”

While backdoor search allows intelligence agencies to monitor the communications of U.S. citizens who have been in touch with any foreigner deemed a target, about collection allows them to monitor the electronic communications of any citizen who mentions information, such as a phone number or email address, about a foreign target, even if they have never communicated with that foreigner.

Though NSA voluntarily abandoned about collection in 2017 after glares from Foreign Intelligence Surveillance Court, the recent development will reverse the decision and codify those practices into law. 

The surveillance court, which acts as a check on the NSA and FBI, periodically approves rules about how the agencies collect Section 702 intelligence. Through "minimization” procedures the court ensures Americans do not become the target of unconstitutional surveillance; the court also mandates intelligence agencies destroy data after a period of time.

Despite the legal oversight, critics of the law said it was not enough and criticized the passing of the bill.

"We're disappointed with the passage of the FISA Amendments Reauthorization Act and the misleading statements supporters of the bill made about the collection of communications, the process by which these records are obtained by the FBI, and the alternatives offered by privacy-minded members of the House and Senate like Justin Amash, Mike Lee, Rand Paul, and others,” the vice president of legislative affairs of activist group FreedomWorks, Jason Pye, said in a statement.

Some lawmakers and civic rights activists had proposed a series of amendments that would have required a warrant whenever a Section 702 investigation affected an American.

Sen. Rand Paul (R-Ky) and Sen. Ron Wyden (D-Oregon) co-sponsored an alternative FISA reauthorization bill called the USA Rights Act, which would have officially made about collection illegal, require a warrant for backdoor searches, and require strict oversight of intelligence agencies by an independent agency. Though many civil rights group supported it, it was never debated on the Senate floor.