The USA Freedom Act has failed in the Senate, stalling an effort to reform certain federal surveillance programs before an end-of-the-month deadline ends the government’s ability to collect the phone records of Americans.

During a Senate vote on Friday, the bill was rejected by a vote of 57-42. It had previously been passed in the House of Representatives with overwhelming success.

The Senate will return to Washington on May 31 to consider ways to prevent the expiration of the program on June 1, according to Republican US Senate Majority Leader Mitch McConnell.

Had lawmakers approved the Freedom Act, the bulk collection of Americans’ telephone records, as conducted by the government under a controversial interpretation of Section 215 of the Patriot Act, would have been limited by new restrictions.

The “USA Patriot Act” as a whole also fell short of being adopted, with the Senate voting 45-54. A total of 60 votes in favor were needed to advance the measure.

On June 1, the legal authorization permitting the bulk collection of American’s so-called phone “metadata” expires, calling into question the future of federal counter-terrorism and national security operations.

On Friday, White House press secretary Josh Earnest lashed out at the Senate’s reluctance to move on the bill as the deadline drew nearer.

“The refusal of the Senate to consider this legislation in a similar bipartisan spirit puts at risk not just the bipartisan compromise, but it puts the risk of our national security professionals to keep us safe,” Earnest said.

Meanwhile, a federal appeals court recently concluded that the Patriot Act provision never authorized the federal investigators to collect business records containing telephone data and other information, contrary to the government’s post-9/11 assertions.