The Department of Homeland Security came out swinging early Thursday against a Senate bill that it said would grant amnesty to an estimated 10 million illegal immigrants and “destroy” the agency’s ability to remove illegal residents from the country.

“It would be the end of immigration enforcement in America and only serve to draw millions more illegal aliens with no way to remove them,” the DHS wrote in a lengthy press release that doesn’t name or quote any department officials.

“By halting immigration enforcement for all aliens who arrived before June 2018, it ignores the lessons of 9/11 and significantly increases the risk of crime and terrorism.”

White House press secretary Sarah Huckabee Sanders warned senators that President Donald Trump was likely to veto the measure if it passed.

By day’s end, the bill had failed 54-45 in the Senate, falling well short of the 60 votes necessary to proceed. The Senate rejected three other immigration measures, including one supported by Trump, before recessing until Feb. 26.

The bill slammed by homeland security officials is sponsored by Senate Minority Leader Chuck Schumer, D-N.Y.; Sen. Mike Rounds, R-S.D.; and Sen. Susan Collins, R-Maine.

If the president were presented such a bill, Sanders said in a written statement, his advisers “would recommend that he veto it.”

DHS calls it an “egregious” violation of Trump’s “four pillars” of immigration reform, laid out in his State of the Union address Jan. 30.

Trump’s four pillars include:

—Providing a pathway to citizenship to about 1.8 million so-called “Dreamers,” those brought to the U.S. illegally as children.

—Securing the southern border with $25 billion for walls, fencing, and other measures.

—Abolishing the Diversity Visa Lottery system, by which visa recipients are selected randomly rather than based on merit.

—Ending chain migration, the policy that allows immigrants to bring in family members who might not otherwise have qualified to enter.

Trump, before the veto threat issued by Sanders, wrote on Twitter that the bill would be “a total catastrophe”:

The department said the legislation from Schumer, Rounds, and Collins would provide a “safe, enforcement-free haven” for more than 10 million illegal immigrants. It is not a “Dreamer” bill, the agency said, but rather would give “mass amnesty” for illegal immigrants regardless of age.

The bill would expand chain migration and keep the diversity lottery, DHS said.

The legislation also would fail to secure the border, the department says, because it would leave “long-standing loopholes wide open,” the agency said, “undermining [its] ability to remove aliens and perpetuating the catastrophic ‘catch and release’ policy.”

Trump has been a proponent of ending “catch and release,” the policy under which those caught entering the country illegally are released to live freely while they await a hearing before an immigration judge. The chief problem with the policy, opponents say, is that most of those released don’t show up for their scheduled hearing.

Trump tweeted last month:

This report was updated to include the White House’s veto threat and the Senate’s inability to attract enough votes to advance any immigration proposal.