The Senate on Thursday voted to end debate on a measure extending three key provisions of the Patriot Act, with less than 14 hours remaining until the law currently extending the provisions of the counterterrorism surveillance law is set to expire.

The Senate voted 79 to 18 to end debate on the measure. Among the 18 “no” votes were 14 Democrats and four Republicans. Like a vote on the Patriot Act this week, Thursday’s vote received overwhelming bipartisan support.

The vote sets the stage for a final passage vote sometime within the next day, although the exact timing remains uncertain.

The three provisions, which are set to expire at 12:01 a.m. Friday, include one authorizing the FBI to continue using roving wiretaps on surveillance targets; another allowing the government to access “any tangible items,” such as library records, in the course of surveillance; and a “lone wolf” provision allowing for the surveillance of targets who are not connected to an identified terrorist group.

After a final passage vote in the Senate, the House will have to approve the bill for it to be sent to President Obama for his signature. (With the president traveling overseas, the logistics of getting it to him could be tricky and might involve flying the legislation abroad for him to sign.)

A senior Republican Senate aide said that it’s possible the upper chamber may be able to finish its work on the extension before the end of the day Thursday, although that depends on whether members insist on using the full 30 hours of debate – and with many members of both parties, particularly Sen. Rand Paul (R-Ky.), expressing reservations about a long-term renewal of the provisions without including additional oversight language, that could be tricky.

Thursday’s vote marks the second time this week that the Senate has approved ending debate on the Patriot Act extension. The Senate had originally been scheduled to hold a final passage vote on the measure Wednesday, but after an impasse between Paul and Senate Majority Leader Harry Reid (D-Nev.) over a gun-rights amendment, Reid on Tuesday scrapped the original plan and reintroduced the bill through a legislative move that would limit the amendments allowed.

The last-minute scramble to extend the measure is in a way a backfiring of Senate leaders’ attempts to push the legislation through at the last moment. Reid and Senate Minority Leader Mitch McConnell (R-Ky.) late last week announced that they’d reached a deal on the four-year extension, and while Reid had earlier this year promised a week of debate on the measure, that did not appear to be possible early this week. Several senators responded by calling for further debate, with Paul vowing to block the measure unless his amendments were considered.

The Obama administration has called for extending the three provisions for as long as possible, and Director of National Intelligence James Clapper wrote to Reid and McConnell on Wednesday urging them to move forward with the reauthorization.