The Senate this afternoon approved a bill called the USA Freedom Act that will reform the government surveillance authorizations in the Patriot Act.

The Patriot Act expired at midnight on June 1 after the Senate could not come to an agreement on a replacement bill.

Senators passed the Freedom Act today by a vote of 67-32. The bill passed in the House by a wide margin on May 13.

Senate majority leader Mitch McConnell, who had favored reauthorizing all the surveillance powers in the Patriot Act, raised three amendments to the Freedom Act before the vote on the bill, but all three were voted down.

The USA Freedom Act removes the content in the Patriot Act’s Section 215, which the National Security Agency has used as legal authorization to collect large amounts of phone records data.

But the Freedom Act also replaces several other key sections of the Patriot Act.

The vote is a big victory for privacy advocates in the Senate, and a clear loss for McConnell and other Senate hawks.

“The USA Freedom Act will enact the most significant reforms to government surveillance powers since the USA Patriot Act,” the bill’s sponsor, Sen. Patrick Leahy (D-Vermont) said.

The bill now goes to the president who has already promised to sign it.

Privacy groups have mixed feelings about the USA Freedom Act.

“[The bill’s] passage is an indication that Americans are no longer willing to give the intelligence agencies a blank check,” says ACLU legal director Jameel Jaffer a statement. “It’s a testament to the significance of the [Edward] Snowden disclosures and also to the hard work of many principled legislators on both sides of the aisle.”

“Still, no one should mistake this bill for comprehensive reform,” Jaffer said. “The bill leaves many of the government’s most intrusive and overbroad surveillance powers untouched, and it makes only very modest adjustments to disclosure and transparency requirements.”

AI. Messaging. Bots. Arm yourself for the next paradigm shift at MobileBeat 2016. July 12-13 at The Village in San Francisco. Reserve your place here.