The National Security Agency lost its authority to collect Americans' phone records in bulk at midnight, after Kentucky Republican Sen. Rand Paul stood in the way of extending the fiercely contested program in an extraordinary Sunday session.

But that program and several other post-Sept. 11 counterterror measures look likely to be revived in a matter of days. With no other options, Senate Majority Leader Mitch McConnell, in an about-face, reluctantly embraced a House-passed bill that would extend the anti-terror provisions that expire Sunday at midnight, while also remaking the bulk phone-collections program.

Although the lapse in the programs may be brief, intelligence officials warned that it could jeopardize Americans' safety. But civil liberties groups applauded as Paul, who is running to become the Republican presidential candidate, forced the expiration of the once-secret program made public by NSA contractor Edward Snowden, which critics say is an unconstitutional intrusion into Americans' privacy.

The Senate voted 77-17 to move ahead on the House-passed bill, the USA Freedom Act, which only last weekend fell three votes short of the 60 needed to advance in the Senate. For McConnell, it was a remarkable retreat after objecting ferociously that the House bill would make the bulk phone collections program unwieldy by requiring the government to search records maintained by phone companies.

“It's not ideal but, along with votes on some modest amendments that attempt to ensure the program can actually work as promised, it's now the only realistic way forward,” McConnell said.

But the Senate adjourned without final action on the bill after Paul asserted his prerogative under Senate rules to delay a final vote for several days.

“This is what we fought the revolution over, are we going to so blithely give up our freedom? ... I'm not going to take it anymore,” Paul declared on the Senate floor, as supporters wearing red "Stand With Rand" T-shirts packed the spectator gallery.

McConnell countered: “We shouldn't be disarming unilaterally as our enemies grow more sophisticated and aggressive, and we certainly should not be doing so based on a campaign of demagoguery and disinformation launched in the wake of the unlawful actions of Edward Snowden.”

The Obama administration backs the House bill. White House Press Secretary Josh Earnest said in a statement: “The Senate took an important — if late — step forward tonight. We call on the Senate to ensure this irresponsible lapse in authorities is as short-lived as possible. On a matter as critical as our national security, individual Senators must put aside their partisan motivations and act swiftly.”

Paul's moves infuriated fellow Republicans and they exited the chamber en masse when he stood up to speak after the Senate's vote on the House bill.

Sen. John McCain, R-Ariz. complained to reporters that Paul places “a higher priority on his fundraising and his ambitions than on the security of the nation.”

In addition to the bulk phone collections provision, two lesser-known Patriot Act provisions also lapse at midnight: one, so far unused, helps track “lone wolf” suspects unconnected to a foreign power; the second allows the government to eavesdrop on suspects who continually discard their cellphones. The House bill, backed by the White House, extends those two provisions unchanged, while remaking the bulk collection program over six months by giving phone companies the job of hanging onto records the government could search with a warrant.

The FBI's use of the Patriot Act to collect hotel, travel, credit card, banking and other business records in national security investigations would also be extended under the House bill. Law enforcement officials say the collection of those business records is more valuable than the better-known bulk phone collections program. Ongoing investigations would be permitted to continue even after authority for the programs lapses.

CIA Director John Brennan was among those warning that letting the authorities lapse, even for a time, will make America less safe.

Terrorists “are looking for the seams to operate within,” Brennan said on CBS' “Face the Nation.” “'This is something that we can't afford to do right now.” He bemoaned “too much political grandstanding and crusading for ideological causes that have skewed the debate on this issue” and said the terrorism-fighting tools are important to American lives.

Senate members already made two unsuccessful attempts last week to reach a settlement: First by bringing to the floor a measure called the USA Freedom Act — which would have renewed the NSA’s authority while imposing some new limitations on its extent — and then by trying to push through a straight two-month extension of the agency’s statutory authority. Both those measures failed, causing Sunday’s last-ditch effort to pass some form of surveillance authorization.

The Obama administration is urging passage of the USA Freedom Act, which would eliminate NSA bulk collection and replace it with a system by which telecom companies hold onto their customers’ metadata, making it available to the government under particular, FISA court-approved circumstances. The House has already given its approval to the bill.

White House Press Secretary Josh Earnest emphasized “the need for the Senate to take decisive action to pass the USA Freedom Act” during a Tuesday press conference.

“They’re facing an important upcoming deadline, and the President is hopeful that for the sake of our country’s security and for the sake our citizens’ privacy that the Senate will meet that deadline,” said Earnest.

Independent studies of the NSA's data collection program have found little evidence that it has helped prevent attacks on the United States.

As early as Tuesday, Congress could begin the process of crafting a new authorization for NSA surveillance to replace the expired one, using legislation proposed by either Sen. Richard Burr, R-N.C., or Sen. Dianne Feinstein, D-Calif., as a model.

ACLU legislative counsel Neema Singh Guliani described both the Burr and Feinstein proposals as “significantly weaker than the USA Freedom Act.”

“I would say Burr and Feinstein are bills that call themselves reform bills but don’t really offer reform,” she said.

The ACLU has not taken a position yet on the USA Freedom Act. Its preferred scenario, said Singh Guliani, is “a sunset of the authority” for the NSA surveillance program.

For Paul, the issue represents a potent political opportunity, and his presidential campaign has been sending out numerous fundraising appeals focused on it. A super PAC supporting him even produced an over-the-top video casting the dispute as a professional wrestling-style “Brawl for Liberty” between Paul and President Barack Obama — even though Paul's main opponent on the issue is McConnell.

The NSA already had begun winding down the phone collection program in anticipation that it will not be renewed. To ensure the program has ceased by the time authority for it expires at midnight, the agency planned to begin shutting down the servers that carry it out at 3:59 p.m. Sunday. Rebooting would take about a day.

With The Associated Press