The Senate has approved the USA Freedom Act, which will alter the way U.S. agencies conduct surveillance and gather data. A final vote on the bill came late Tuesday afternoon, after amendments to the bill failed.

Update at 9:30 p.m. ET: Obama's Signature

Following an expedited enrollment process, President Obama signed the bill into law late Tuesday.

"Enactment of this legislation will strengthen civil liberty safeguards and provide greater public confidence in these programs," Obama said in a statement after the vote. "I am gratified that Congress has finally moved forward with this sensible reform legislation."

Update at 4:30 p.m. ET: The Bill Has Passed

In the final tally of the vote, 67 senators were in favor of the measure and 32 against. The legislation needed a simple majority to pass.

Last November, the Freedom Act failed in the Senate after not receiving enough support to avoid a filibuster. Its critics say the act doesn't go far enough to curtail surveillance programs that can access huge databases of information about Americans.

Sen. Rand Paul, R-Ky., voted against the measure today, as he did last fall. Also voting against the bill Tuesday was independent Sen. Bernie Sanders, who is seeking the Democratic presidential nomination.

The lead sponsor of the bill in the House, Rep. Jim Sensenbrenner, R-Wis., promises it will "rein in the dragnet collection of data" by the NSA and others, and "increase transparency of the Foreign Intelligence Surveillance Court."

Calling today's passage "a milestone," ACLU Deputy Legal Director Jameel Jaffer says, "This is the most important surveillance reform bill since 1978, and its passage is an indication that Americans are no longer willing to give the intelligence agencies a blank check."

Our original post continues:

The vote comes two days after controversial provisions of the Patriot Act expired because the Senate was unable to "overcome parliamentary maneuvers by Sen. Rand Paul," as Eyder reported Sunday night, "and let three controversial provisions of the Patriot Act expire at midnight."

The House of Representatives approved the Freedom Act on May 13. The legislation would remain in effect until Dec. 15, 2019.

"We worked for two years across the aisle and across the Capitol," said Sen. Patrick Leahy, a champion of the bill. He said it would bring much-needed reform to America's intelligence-gathering.

Leahy and his chief ally on the bill, Sen. Mike Lee, R-Utah, spent their Tuesday in the Senate fighting against amendments to the USA Freedom Act that were put forth — and defeated.

Tuesday's vote on the Freedom Act comes less than a month after a federal appeals court ruled that the National Security Agency's practice of collecting bulk data about Americans' phone calls violates the Constitution.

Before the vote, a displeased Majority Leader Sen. Mitch McConnell criticized the policies of President Obama and said that the Freedom Act weakens America's ability to protect itself. He also cited an AP article that called the turn of events in the surveillance and spying field as "a victory for Edward Snowden," the former NSA contractor who released secret information about U.S. spying in June of 2013 (Snowden discussed the Patriot Act Tuesday).

After McConnell spoke, Minority Leader Sen. Harry Reid responded by saying that if McConnell is worried about making America look weaker, "he should look in the mirror."

Reid accused the majority leader of trying to deploy distractions from the real issues and said that McConnell had also implicitly criticized the House of Representatives.

Copyright 2016 NPR. To see more, visit