Two days after Congress let the phone-records collection and several other anti-terror programs expire, the Senate's 67-32 vote sent the legislation to President Barack Obama, who signed it Tuesday night.
"This legislation will strengthen civil liberty safeguards and provide greater public confidence in these programs," Obama said in a statement. Officials said it could take at least several days to restart the collection.
The legislation will revive most of the programs the Senate had allowed to lapse in a dizzying collision of presidential politics and national security policy. But the authorization will undergo major changes, the legacy of agency contractor Edward Snowden's explosive revelations two years ago about domestic spying by the government.