The White House on Tuesday said it “strongly supports” a bill that would end the National Security Agency’s mass collection of Americans’ phone records, a program recently ruled illegal by a federal appeals court.

The bipartisan USA Freedom Act, the administration said, strengthens the surveillance law’s privacy protections, while “preserving essential authorities” needed to protect the nation, the White House said in statement.

The House is widely expected to pass the legislation on Wednesday, setting the stage for a battle in the Senate ahead of a June 1 deadline for action.

On Tuesday, Attorney General Loretta Lynch and Director of National Intelligence James R. Clapper sent a letter to congressional leaders also expressing support for the bill, calling it “a reasonable compromise that preserves vital national security authorities, enhances privacy and civil liberties and codifies requirements for increased transparency.”

In the Senate meanwhile, Senate Majority Leader Mitch McConnell (R-Ky.) and Sen. Richard Burr (R-N.C.), chairman of the Senate Intelligence Committee, have introduced a bill to continue the NSA program as is for another five-and-a-half years.

Burr this week continued to criticize USA Freedom, saying it would be "rolling [the nation] back to exactly where we were pre-9/11.”

He mentioned last week's incident in Garland, Tex., in which two Islamic State sympathizers were shot and killed outside of a cartoon contest seen as insulting to Muslims, as an example of the threats that the NSA program combats. The House reform bill, he said, would make it more difficult for authorities to quickly trace threats.

"In today's atmosphere of terrorism, that may be too lengthy a process to go through," Burr said. "Why would we roll back something that has not had a privacy concern up till this point?"​

But Sen. Patrick J. Leahy (D-Vt.), ranking member of the Judiciary Committee and a cosponsor of the USA Freedom Act, noted that former counterterrorism official Richard Clarke testified before the committee that the NSA program was not necessary to have prevented the 2001 attacks because the government had the information it needed, and federal agencies had failed to share it.

Leahy also noted that a presidentially-appointed review group on surveillance, which included two former national security officials, concluded in December 2013 that the program “was not essential to preventing attacks” and could readily be obtained using conventional court orders.

The effort to pass USA Freedom was boosted by the ruling last week by the Second Circuit Court of Appeals in New York that the NSA program did not meet the law.

The law at issue is Section 215 of the USA Patriot Act, which expires in a few weeks.

That measure requires that records sought be “relevant” to an authorized terrorism investigation.

A three-judge panel for the appeals court ruled that the government’s collection of “all” call detail records from major U.S. phone companies stretched the meaning of “relevance” in an “unprecedented and unwarranted” manner.

Some legal analysts have said that adding language to McConnell and Burr’s bill to make clear that it authorizes NSA bulk collection would leave no doubt of Congress’ intention and would moot the appeals’ court’s ruling.

But Burr said Monday there were no efforts underway to draft language explicitly authorizing the NSA records collection program.

“I think you leave it up to the full judicial review,” Burr told reporters.

The McConnell-Burr bill is what’s known as a “clean reauthorization.”

Some national security officials say that even without adding explicit language, passage of a clean reauthorization of Section 215, after two years of highly public debate about the program, would constitute a ratification of the collection under the law.

"I would think the government would have a strong argument that relevance now at least for this statute means that it's broad enough to encompass" the NSA collection, said one senior intelligence official, who was not authorized to speak publicly.

“If the statute is reauthorized, it will be with full knowledge of how the program works and the language on which it relies,” said Stewart A. Baker, a former NSA general counsel who is now a partner at Steptoe & Johnson. “So the very argument that the Second Circuit made up no longer applies.”

But other analysts said that the court decision made clear that Congress would have to “unambiguously” make clear its intent, or the district court to which the case has been remanded could issue an injunction to halt the program.

Steven Vladeck, an American University law professor, said that there are arguments in both directions and that one could reach the conclusion that Congress was ratifying the Second Circuit's decision—that “relevance” cannot extend to millions of call records. The bottom line, he said, is neither supporters nor opponents of a clean reauthorization "could now be entirely confident what effect the language of his bill would have were it enacted into law."