The U.S. Senate rejected a contentious surveillance-reform bill just after midnight Saturday morning, all but guaranteeing that key provisions of the USA Patriot Act will expire.

The Senate failed to reach agreement on passage of the USA Freedom Act, a bill to reauthorize and reform Section 215 of the USA Patriot Act, which the government has used to conduct bulk surveillance of Americans’ phone records. The House of Representatives passed the bill last week by an overwhelming bipartisan majority, but Senate Democrats, who unified behind the bill, did not get enough Republican votes to assure passage.

A procedural step known as cloture, which requires 60 votes before the actual bill can be taken up for a vote, failed to reach that number, as many undecided Republicans joined the majority of their colleagues in voting no. The final vote was 57-42.

The White House had urged passage of the bill in the week leading up to the vote, saying that the expiring spy powers—Section 215 as well as the “roving wiretap” and “lone wolf” provisions—were critical to law enforcement and the intelligence community.

Immediately following the vote, Senate Majority Leader Mitch McConnell (R-Ky.) called for a vote on his own bill reauthorizing Section 215 without reforms. That, too, failed, on an even sharper 45-54 vote. Many Senate Republicans signed onto McConnell’s bill following a classified briefing with law enforcement officials; they called the USA Freedom Act a dangerous limitation of government spying powers. Leaders in the House said prior to adjourning Thursday that they would not accept a so-called “clean” reauthorization bill, and on Wednesday, Sen. Rand Paul (R-Ky.), along with nine other senators, conducted a 10-hour floor speech railing against the Patriot Act.

“This is only the beginning—the first step of many,” Paul said in a statement released shortly after the votes. “I will continue to do all I can until this illegal government spying program is put to an end, once and for all.”

Paul got the chance to show off doing just that when McConnell, seeing his two-month bill fail, tried to introduce a series of even shorter-term bills. He first asked for unanimous consent to introduce a bill extending the Patriot Act provisions until June 8, but Paul objected. He then tried for June 5, but Paul and Sen. Martin Heinrich (D-N.M.) objected again. Paul objected two more times as McConnell sought June 3 and June 2 extensions. The surreal spectacle on the Senate floor left McConnell visibly flustered.

Faced with no other alternatives that would preserve the spy powers, McConnell announced that the Senate would return from its break on Sunday, May 31, just a few hours before the midnight deadline. McConnell called it “one more opportunity to act responsibly.”

Sen. Patrick Leahy, the top Democrat on the Senate Judiciary Committee and a major supporter of the bill, said he was frustrated that the Republican leadership had lobbied senators to oppose the initial cloture vote.

“The majority of the Senate wants to pass it and send it to the President,” he said in a statement. “When the Senate returns next Sunday, I hope we will.”

The House committee leaders responsible for the USA Freedom Act expressed similar disappointment at the bill’s failure in the upper chamber.

“The Senate’s rejection of the USA Freedom Act, a bipartisan bill that overwhelmingly passed in the House of Representatives, misses an opportunity to protect our civil liberties while also maintaining our national security,” top members of the House Judiciary Committee said in a statement. “The Senate has failed to make the important reforms necessary, jeopardizing Americans’ civil liberties and our national security.”

Sen. Chuck Grassley (R-Iowa), the chairman of the Senate Judiciary Committee, left the door open to modifying the USA Freedom Act in a way that would require House reapproval.

“Our focus when we return,” he said in a statement, “must be to craft legislation that can clear both the House and the Senate that keeps the tools in place needed to protect the American people while also ensuring their civil liberties are intact.”

The USA Freedom Act has been the subject of intense scrutiny and debate among the civil-liberties groups pushing for surveillance reform in the wake of Edward Snowden‘s NSA leaks. The bill has divided privacy advocates, with some opposing passage on the grounds that it preserves too much spying and others supporting it as the best available option.

“Access is disappointed that Congress was unable to pass reform legislation,” said Amie Stepanovich, U.S. policy manager at Access, “but let’s be clear: this is a major victory for civil liberties.”

Other groups voiced more emphatic disappointment.

“It is a shocking insult to the democratic process, and to the American people who have been demanding reform for two years, that the Senate’s leaders have ignored the White House, federal judges, and an overwhelming majority of the House of Representatives by blocking the USA Freedom Act,” said Kevin Bankston, policy director at New America’s Open Technology Institute.

Bankston added, “If Senate Leader McConnell and others who killed this bill believe their own fear-mongering, then they have just left the American people vulnerable by pushing us to the brink of sunset.”

“We are incredibly disappointed in the Senate’s failure to pass the USA Freedom Act,” said Information Technology Industry Council President and CEO Dean Garfield. “This morning’s vote was a missed opportunity to bring certainty and clarity to our nation’s surveillance laws.”

“As the Senate plots a path forward on the issue, we urge it to consider that there remains bipartisan consensus…that it is time to address the practices and laws regulating government surveillance of individuals and access to their information,” said a statement from Reform Government Surveillance, a group that includes major tech companies like Apple, Facebook, Google, Microsoft, Twitter, and Yahoo. “It is essential that any proposals in this area be narrowly tailored, contain essential transparency requirements, and prohibit bulk collection of Internet metadata.”

“When the Senate returns, we urge a vote to finally pass the USA Freedom Act to end bulk collection,” said Nuala O’Connor, president and CEO of the Center for Democracy & Technology. “The Senate’s inaction on surveillance reform is inexcusable after two years of debate and bipartisan compromise.”

But even CDT Advocacy Director and Senior Counsel Harley Geiger said that “a sunset of Patriot Act authorities”—which would occur without passage of the USA Freedom Act—”would be a victory for Americans’ privacy.”

The Electronic Frontier Foundation, one of the nation’s largest privacy groups, originally supported the bill, but it pulled its support after a federal appeals court struck down the bulk phone-records program. The U.S. Court of Appeals for the Second Circuit found that the Patriot Act had not authorized the program, and the EFF used the opportunity to push for stronger reforms than those found in the USA Freedom Act.

“We commend every Senator who voted against reauthorizing the unconstitutional surveillance of millions of law-abiding Americans,” Lee Tien, an attorney at the EFF, wrote on the group’s blog after the vote. “In the wake of tonight’s vote, Congress must stop stalling and address the surveillance and secrecy abuses of our government.”

Update 10:18am CT, May 23: Added statements from members of Congress and civil-liberties groups.

Update 11:01am CT, May 23: Added video of a showdown between McConnell and Paul.

Update 1:46pm CT, May 23: Added EFF comment.

Photo via Naval History & Heritage Command/Flickr (CC BY 2.0) | Remix by Jason Reed