WASHINGTON (Associated Press) — After its midnight deadline, the Senate voted early Saturday to reauthorize a key U.S. surveillance law after divisions over whether the FBI should be restricted from using the program to search for Americans’ data nearly forced the statute to lapse.

The legislation approved 60-34 with bipartisan support would extend for two years the program known as Section 702 of the Foreign Intelligence Surveillance Act. It now goes to President Joe Biden’s desk to become law. White House national security adviser Jake Sullivan said Biden “will swiftly sign the bill.”

U.S. officials have said the surveillance tool, first authorized in 2008 and renewed several times since then, is crucial in disrupting terror attacks, cyber intrusions, and foreign espionage and has also produced intelligence that the U.S. has relied on for specific operations, such as the 2022 killing of al-Qaida leader Ayman al-Zawahri.

The reauthorization faced a long and bumpy road to final passage Friday after months of clashes between privacy advocates and national security hawks pushed consideration of the legislation to the brink of expiration.