Key parts of the USA Patriot Act are set to expire tonight at midnight, and it currently appears as though there will be no last-minute deal to allow US spy agencies to continue the contested anti-terror surveillance measures authorized by the law.

The Senate convened a rare Sunday session in an attempt to hash out a way forward and keep the Patriot Act provisions in place, but Kentucky Senator Rand Paul, a Republican presidential candidate, vowed to stand in the way.

"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.

If midnight deadline passes, the NSA will lose the legal authority to collect and search domestic phone records. The NSA reportedly started to wind down the phone records collection program on Sunday afternoon by shutting down some of its servers in anticipation of the Patriot Act not being renewed.

CIA Director John Brennan stressed that the programs authorized by the Patriot Act are important to protect American lives. "Too much political grandstanding and crusading for ideological causes have skewed the debate on this issue," he said.

The White House similarly asserted that letting the surveillance powers expire would potentially jeopardize national security. "Heaven forbid we've got a problem where we could have prevented a terrorist attack or apprehended someone who is engaged in dangerous activity but we didn't do so simply because of inaction in the Senate," President Barack Obama said on Friday.

In addition to section 215, which allows the bulk collection of phone records, two lesser-known Patriot Act provisions are also expected to lapse this evening. One, so far unused, helps track "lone wolf" terrorism suspects unconnected to a foreign power, terrorist group, or rogue nation. The other allows the government to use "roving wiretaps" to eavesdrop on suspects who continually discard their cellphones.

President George W. Bush signed the Patriot Act into law after the 9/11 terror attacks, and parts of it have been renewed by Obama. The NSA spy programs authorized by the law were first revealed in 2013 by Edward Snowden, a former contractor for the agency.

According to USA Today, all investigations of phone records under Section 215 of the Patriot Act will not stop immediately if the law does indeed expire at midnight. A clause in the law allows the NSA to continue investigations it has already started.