The Senate has passed the USA Freedom Act, which would resurrect a more restrained version of government surveillance powers. The USA Freedom Act was created to rein in Section 215 of the Patriot Act, which had allowed the government to (among other things) collect huge swathes of phone records from companies like Verizon. A version of the USA Freedom Act was passed by the House of Representatives in May, but the Senate has been unable to pass it until now, one day after Section 215 expired. This time, the bill passed with a vote of 67 for to 32 against.

The USA Freedom Act, proposed after Edward Snowden revealed the phone records program in a series of leaked documents, has had a difficult time making it through Congress. An earlier version passed the House, but not the Senate, and the latest iteration faced stiff opposition as Section 215's expiration approached. In fact, the Senate voted it down again last week. It was brought back after a simple extension of the Patriot Act provisions, proposed by Senate Majority Leader Mitch McConnell (R-KY), failed.

Glad the Senate finally passed the USA Freedom Act. It protects civil liberties and our national security. I'll sign it as soon as I get it. — President Obama (@POTUS) June 2, 2015

Today, McConnell introduced a series of amendments that would have loosened portions of the USA Freedom Act and delayed its implementation from six to 12 months, but all four were voted down before passage. He opposed the bill overall, claiming that the end of Section 215 in its current form was "a resounding victory for those currently plotting attacks against the homeland." However, others saw the USA Freedom Act as the only workable compromise. Senator Dianne Feinstein (D-CA), an outspoken proponent of NSA surveillance powers, said it was "the best opportunity to quickly get these programs back up and running."

The USA FREEDOM Act just passed Congress—the most powerful surveillance reform bill to become law in decades. @OTI statement coming shortly. — Kevin Bankston (@KevinBankston) June 2, 2015

On the other side of the aisle, reform advocate Ron Wyden (D-OR) called the USA Freedom Act's passage "the most significant victory for Americans’ privacy rights in more than a decade." Patrick Leahy (D-VT), a co-author of the bill, said that it was "an accomplishment made possible by meaningful congressional oversight. It is about living up to our responsibility to ensure the privacy rights of all Americans."

It's not all positive, though. The ACLU notes that the USA Freedom Act's scope has been limited since the original bill was introduced. "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," said deputy legal director Jameel Jaffer. "The passage of this bill is an indication that comprehensive reform is possible, but it is not comprehensive reform in itself." The Electronic Frontier Foundation had also been critical of the bill, but issued a celebratory message after the bill passed. "This bill marks a day that some said could never happen — a day when the NSA saw its surveillance power reduced by Congress," the EFF wrote in a response to the Senate vote. "And we’re hoping that this could be a turning point in the fight to rein in the NSA."

Now that the bill is through Congress, it's all but certain that the USA Freedom Act will become law. The White House has expressed its support for the bill, which it called a "reasonable compromise balancing security and privacy" in a statement earlier this week. In a tweet, President Barack Obama said that he would sign the bill "as soon as I get it."