The Senate’s failure to extend the USA Patriot Act will bring the legislation on NSA phone-record collection and other key surveillance activities perilously close to expiring on June 1, forcing senators to return early from recess for a rare Sunday session.

The Senate vote was just one of two this weekend that set the stage for dramatic showdowns on Capitol Hill in the coming weeks and months.

The GOP-led upper chamber passed bipartisan legislation Friday night to strengthen President Obama's hand in global trade talks. However, the legislation must now pass the Republican-led House, with help from Democrats because some conservative members oppose the legislation.

Speaker John Boehner supports the measure and says Republicans will do their part to pass it.

Dozens of House Republicans oppose the legislation either out of ideological reasons or because they are loath to enhance Obama's authority, especially at their own expense.

Senate and now House Democrats are showing little inclination to support legislation that much of organized labor opposes.

On the Patriot Act bill, Senate Majority Leader Mitch McConnell says he will bring the upper chamber back into session on Sunday, May 31 -- roughly 24 hours before the post-9/11 legislation expires.

Meanwhile, the National Security Agency is starting to winding down its bulk collection of domestic-calling records in preparation for the Senate voting again against the legislation, according to the Justice Department, which says the collection takes time to halt.

The Senate went into the early hours on Saturday morning to vote on the legislation before leaving Washington for Memorial Day recess.

By the time senators broke for the holiday, they had blocked a House-passed bill and several short-term extensions of the key provisions in the Patriot Act.

The main stumbling block was a House-passed provision to end the NSA collecting the phone-call metadata and instead have the records remain with telephone companies subject to a case-by-case review.

McConnell warned against allows the NSA and other key surveillance programs under the act to expire.

However, he and other key Republican senators oppose the House approach, backed by officials who argued it is the best way for the United States to keep valuable surveillance tools.

Fellow GOP Kentucky Sen. Rand Paul, also a 2016 presidential candidate, called the Senate's failure to allow the extension a victory for privacy rights.

"We should never give up our rights for a false sense of security," Paul said in a statement. "This is only the beginning -- the first step of many. I will continue to do all I can until this illegal government spying program is put to an end, once and for all."

The White House has pressured the Senate to back the House bill, which drew an overwhelmingly bipartisan vote last week and had the backing of GOP leaders, Democrats and the libertarian-leaning members.

But the Senate blocked the bill on a vote of 57-42, short of the 60-vote threshold to move ahead. That was immediately followed by rejection of a two-month extension to the existing programs. The vote was 54-45, again short of the 60-vote threshold.

McConnell repeatedly asked for an even shorter renewal of current law, ticking down days from June 8 to June 2. But Paul and other opponents of the post-Sept. 11 law objected each time.

At issue is a section of the Patriot Act, Section 215, used by the government to justify secretly collecting the "to and from" information about nearly every American landline telephone call. For technical and bureaucratic reasons, the program was not collecting a large chunk of mobile calling records, which made it less effective as fewer people continued to use landlines.

When former NSA contractor Edward Snowden revealed the program in 2013, many Americans were outraged that NSA had their calling records. President Obama ultimately announced a plan similar to the USA Freedom Act and asked Congress to pass it. He said the plan would preserve the NSA's ability to hunt for domestic connections to international plots without having an intelligence agency hold millions of Americans' private records.

Since it gave the government extraordinary powers, Section 215 of the Patriot Act was designed to expire at midnight on May 31 unless Congress renews it.

Under the USA Freedom Act, the government would transition over six months to a system under which it queries the phone companies with known terrorists' numbers to get back a list of numbers that had been in touch with a terrorist number.

But if Section 215 expires without replacement, the government would lack the blanket authority to conduct those searches. There would be legal methods to hunt for connections in U.S. phone records to terrorists, said current and former U.S. officials who spoke on condition of anonymity because they were not authorized to discuss the matter publicly. But those methods would not be applicable in every case.

Far less attention has been paid to two other surveillance authorities that expire as well. One makes it easier for the FBI to track "lone wolf" terrorism suspects who have no connection to a foreign power, and another allows the government to eavesdrop on suspects who continuously discard their cellphones in an effort to avoid surveillance.

The Associated Press contributed to this report.