The Senate cleared a crucial hurdle on the PATRIOT Act Thursday, smoothing the way for final passage, though whether or not this can occur before the act expires at midnight is in doubt.

The Senate voted 79-18 to end debate on the bill which extends for four years three expiring provisions of the terrorism surveillance law, shutting off the possibility of amendments.

But freshman Sen. Rand Paul, who has detailed a number of privacy concerns, could potentially dig in his heels and insist on the full 30 hours of debate required after a filibuster is broken. The Kentucky Republican, a member of the Senate Tea Party Caucus, had a number of amendments to tighten judicial oversight on the bill, but Senate Majority Leader Harry Reid, D-Nev., accused Paul, in a rare, stinging rebuke, of slow-walking the bill over unrelated matters and throwing U.S. national security in jeopardy.

At issue is a Paul amendment addressing gun laws that would ensure that some gun-purchase records remain secret, with federal officials unable to access them, unless a judge approves that access.

Reid attacked Paul Wednesday night, essentially accusing him of enabling terrorist activities by holding out for the gun provision.

"He's fighting for an amendment to protect the right - not of average citizens, but of terrorists - to cover up their gun," Reid said. "It he thinks that it's going to be a badge of courage on his side to have held this up for a few hours, he's made a mistake."

Paul rushed to the floor in his own defense, calling the Reid accusations "offensive" and accused Democrats of being "petrified to vote on issues of guns." The conservative senator called for "a debate on a higher plane," saying he was merely trying to institute some "Constitutional constraints."

Lawmakers on both sides of the aisle took to the Senate floor Thursday to urge Congress to pass the final legislation before the midnight deadline.

The Intelligence Community weighed in, as well. The Director of National Intelligence, James Clapper, sent a letter to Senate leaders with a stark warning that allowing the law to lapse "even for the briefest of time, the nation will be less secure." Clapper noted the treasure trove of intelligence materials found at the compound of the now-deceased terror leader, Usama bin Laden, and urged members to extend the expiring provision of the law so that every tool can be used to track down terror leads.

Congress is expected to approve the extension, which renews the ability of federal officials to access, with warrants, business or so-called "library" records, get court-approved roving wiretaps, and a so-called "lone wolf" provision that involves the surveillance of suspected terrorists not linked to a specific terrorist organization.

"I have no doubt that the four-year PATRIOT Act extension that members of both parties have agreed to will safeguard us from future attacks," said Senate Minority leader Mitch McConnell, R-Ky. "Now is not the time to surrender the tools authorized by this act, or to make them more difficult to use."

Trish Turner contributed to this report