WASHINGTON - The Republican-led Senate on Thursday blocked both President Donald Trump's immigration plan and a bipartisan alternative, a failure that cast doubt on whether Congress will ever resolve the fate of hundreds of thousands of young undocumented immigrants.

In a series of afternoon votes, senators failed to muster enough votes for a Republican plan backed by Trump that would have granted legal status to 1.8 million young immigrants and spent at least $25 billion to bolster security along the U.S.-Mexico border. It also would have made changes to family-based legal migration programs and ended a diversity lottery system used by immigrants from smaller countries.

The vote was 39-60, well short of the 60 needed to move ahead.

The Senate also couldn't produce enough votes for a bipartisan plan that would legalize the same number of undocumented immigrants and appropriate $25 billion for southern border security construction projects over the next decade - not immediately, as Trump wants. The bill also would have curbed family-based immigration programs, but not to the extent Trump is seeking, and it said nothing about the diversity visa lottery program.

The vote was 54-45, short of the 60 necessary to move ahead.

The White House threatened a veto of that plan and in a tweet shortly before the vote, Trump called it a "total catastrophe."

The failed votes could plunge the nation's immigration system into further crisis, as millions of "dreamers" are set to lose legal protections when the Obama-era Deferred Action for Childhood Arrivals (DACA) program is set to end on March 5. Federal court challenges continue, meaning the program may continue under legal limbo until June.

The votes underscored the inability of Congress to resolve a problem that has vexed Republican and Democratic administrations despite repeated efforts to overhaul the nation's immigration system. In an election year, lawmakers on both sides found the political pressures insurmountable.

Senators also rejected a watered-down bipartisan plan to grant legal status to dreamers and provide billions in border security. Also coming up short of the necessary votes was a Republican plan to punish so-called "sanctuary" municipalities that refuse to help enforce federal immigration laws.

Ahead of the votes, the White House pressed hard to scuttle the bipartisan immigration plan that was emerging as the best hope for a legislative deal and top GOP leaders were doing little to encourage bipartisan accord.

Trump tweeted that the bill "would be a total catastrophe" and reiterated his support for a more conservative alternative offered by Sen. Chuck Grassley, R-Iowa, that Democrats have opposed.

"Voting for this amendment would be a vote AGAINST law enforcement, and a vote FOR open borders," Trump wrote. "If Dems are actually serious about DACA, they should support the Grassley bill!"

Press secretary Sarah Huckabee Sanders also said in a statement that the administration "strongly opposes" the proposal unveiled a day earlier.

The plan from the self-anointed "Common Sense Coalition" would have made immigration policy "worse by weakening border security," Sanders said. If the plan reached Trump's desk, his advisers would "recommend he veto it," she added.

In another Thursday morning tweet, Trump appeared to reiterate his calls to end a diversity visa lottery program, which is not mentioned in a bipartisan plan unveiled late Wednesday. The issue of ending the program is what sparked Trump's expletive-ridden tirade in a January Oval Office meeting with lawmakers.

Late Wednesday, a senior administration official vowed that the White House would strongly lobby against the bipartisan legislation, likely to make striking a deal far more difficult, if not impossible, with time running out. Senate Majority Leader Mitch McConnell, R-Ky., has said the debate must be concluded this week.

"We're doing everything in our power" to block the bill, said the official, who spoke on the condition of anonymity to discuss White House strategy.

The administration official said the White House already had been in contact with individual Republican senators, as well as House leadership, asking them to oppose the bill. Plans were underway to ensure that key Cabinet members also lobby lawmakers, said the official, who added that the legislation jeopardizes a potential deal on "dreamers" - undocumented immigrants who have been in the country since they were children.

The Department of Homeland Security said just after midnight Thursday that the bill from a group headed by Sen. Susan Collins, R-Maine, and Sen. Joe Manchin, D-W.Va., "destroys the ability" of the agency to enforce immigration laws and represents an "egregious violation" of Trump's immigration framework.

"Instead of helping to secure the border as the President has repeatedly asked Congress to do," the DHS statement warned, "it would do the exact opposite and make our border far more open and porous."

Responding to DHS' statement at a news conference about the bipartisan bill, Sen. Lindsey Graham, R-S.C., said he thought, "Who the hell wrote this? Because it sounded like something that came from a political hack, not DHS."

Graham singled out White House domestic policy adviser Stephen Miller, who is driving much of the administration's opposition to the bipartisan plan.

"There are some crazy people around here. Just shut them out. This is the best shot you'll ever get," Graham said. "America is with us, Mr. President. You be with us; we can make this bill better ."

On a conference call with reporters, a White House official, speaking on condition of anonymity to discuss strategy, lambasted Graham, noting that he was at the center of past immigration debates that ultimately fizzled and suggesting he has been "part of the problem."

Another administration official, responding to Graham's attack on the agency's "fact sheet," said: "Let the senator know it was written by a group of people at DHS who care deeply about the rule of law."

The White House official suggested some Republican co-sponsors had been misled on the bill and indicated that the administration would attempt to pressure them to drop their names from the bill.

"We were surprised to see a bill that proactively went backward in terms of enforcement," the administration official said. The White House declined two requests from reporters to put the comments on the record.

The White House's criticism came as the bipartisan group introduced a plan that would fulfill Trump's calls to grant legal status to 1.8 million young undocumented immigrants and would appropriate $25 billion for southern border security construction projects over the next decade - not immediately, as Trump wants. The bill also would curb family-based immigration programs, but not to the extent Trump is seeking, and it says nothing about the diversity visa lottery program.

On Thursday morning, McConnell dismissed the plan. Democrats so far have "yet to bring forward a single proposal that gives us a realistic chance to make law," he said. "That is, pass the Senate, pass the House and earn the president's signature."

Senate Minority Leader Chuck Schumer, D-N.Y., blasted Trump, saying the president "has not been constructive" during weeks of negotiations on immigration policy and "seems eager to spike the latest bipartisan compromise potentially with a veto."

Defending the new bipartisan plan, Schumer admitted, "there's a lot I don't like in it, believe me. I think the wall will not accomplish anything, will be a terrible waste of money."

But "compromise is compromise," Schumer added. "Democrats and Republicans will find provisions they don't want, wouldn't include if they had written it. But we have to do our jobs today. We have to rise above our differences, admit that no one will get everything they want and accept painful compromises that come with democratic government."

Last fall, Trump terminated DACA, which had provided temporary work permits to about 690,000 dreamers. Trump set a March 5 deadline for Congress to provide a legislative solution before the bulk of the work permits would begin expiring. However, courts in California and New York have issued temporary injunctions forcing the administration to restart the program, which could render Trump's deadline moot.

In its statement, DHS highlighted a provision in the bill that said the agency would be required to prioritize the removal of undocumented immigrants who arrived after June 30 of this year - a provision that DHS said would provide a "safe haven" to more than 10 million people already living in the country illegally.

The agency also said the bill does not do enough to curb "chain migration," using a term that advocates say is derogatory to refer to the ability of U.S. citizens to sponsor relatives to join them in the United States.

On Friday, Vice President Mike Pence and Homeland Security Secretary Kirstjen Nielsen are scheduled to travel to the Rio Grande Valley of Texas to visit the U.S.-Mexico border. The White House said Pence and Nielsen are scheduled to meet with local law enforcement officials and representatives from U.S. Customs and Border Protection.

- - -

The Washington Post's Mike DeBonis and Erica Werner contributed to this report.

Outbrain