WASHINGTON (AP) — The Senate has left hundreds of thousands of "Dreamer" immigrants in limbo, rejecting rival plans that would have spared them from deportation and strengthened the nation's border security. Senators dealt President Donald Trump an especially galling defeat as more than a quarter of fellow Republicans abandoned him on an issue that helped propel him to the White House.

Also defeated Thursday was a plan by a bipartisan group of senators who offered a compromise that would have shielded the young immigrants and financed Trump's demands for money to build his border wall, though more gradually than he wants. Eight Republicans joined most Democrats in backing that plan, but it fell short after the White House threatened a veto and GOP leaders opposed it.

The day's votes, in which four separate proposals were defeated, illustrated anew Congress' steep challenge in striking a deal on an issue that's proven intractable for years and on which each party's most fervent supporters refuse to budge. The outcome suggested there may be no permanent solution soon to help the young immigrants, who were brought to the U.S. as children, despite their sky-high support in public polling.

The Senate votes left the young immigrants facing a March 5 deadline that Trump has given Congress for restoring the Deferred Action for Childhood Arrivals program, or DACA, that he annulled last year. Federal courts have blocked him temporarily from dismantling the Obama-era initiative, but without congressional action the immigrants will face growing risks of deportation as their protections expire.

"Dreamers" are immigrants who were brought to the U.S. as children and now risk deportation because they lack permanent authorization to stay. DACA gives them the ability to live and work in the U.S. for two-year periods that can be renewed.

"It looks like demagogues on the left and the right win again on immigration," said Sen. Lindsey Graham, R-S.C., who helped craft the bipartisan package but also backed Trump's plan. He added, "The only way forward is for President Trump to grab the reins and lead us to a solution."

That scenario wasn't in sight Thursday. The White House trashed the bipartisan proposal as "dangerous policy that will harm the nation," denouncing a provision directing the government to prioritize enforcement efforts against immigrants who arrive illegally — beginning in July. Trump proved unwilling to fold on his demands for a tougher bill, reflecting the hard-line immigration stance that fueled his presidential run.

After the Senate rejected all four proposals on Thursday, Senate Majority Leader Mitch McConnell, R-Ky., blamed Democrats for failing to accept what he said was a "generous" offer from Trump.

"They turned away from a golden opportunity to solve the issue," said McConnell. He expressed openness to considering a future compromise but said, "For that to happen, Democrats will need to take a second look" at Trump's demands.

Trump had dangled a chance for citizenship for 1.8 million young immigrants, meeting a top Democratic demand. But that plan also included $25 billion to build his border wall with Mexico and enact other border security measures, tighter curbs on relatives whom legal immigrants could sponsor for citizenship and an end to a visa lottery that encourages immigration from diverse nations.

No. 2 Senate GOP leader John Cornyn of Texas said after the votes that lawmakers might consider temporarily protecting Dreamers from deportation in a government-wide spending measure Congress will consider next month.

He said that approach "to me is not great, but that's kind of where we are."

Democrats said Trump was the major hindrance to a broader deal.

"This vote is proof that President Trump's plan will never become law," said Senate Minority Leader Chuck Schumer of New York. "If he would stop torpedoing bipartisan efforts, a good bill would pass."

The Senate derailed Trump's proposal by voting 60-39 against it — 21 votes shy of the 60 it needed to survive.

Fourteen Republicans — more than 1 in 4 — joined 46 Democrats in opposition. The "no" votes included some of the chamber's most conservative Republicans, many of whom were uncomfortable with offering citizenship to immigrants here illegally.

Just three Democrats backed Trump's proposal, all of them facing dicey November re-election in states he carried easily in 2016: Indiana's Joe Donnelly, North Dakota's Heidi Heitkamp and West Virginia's Joe Manchin.

The vote on the bipartisan plan was 54-45, six short of the required 60. Eight Republicans who helped craft that compromise supported it, and three Democrats voted "no," including Sen. Kamala Harris, D-Calif., who's viewed as a 2020 presidential hopeful.

That proposal offered the citizenship pathway for Dreamers and $25 billion for border security, but doled it out over 10 years. Trump's bill would have prevented legal immigrants from sponsoring parents and siblings for citizenship and would have ended a visa lottery aimed at allowing more diverse immigrants into the U.S. The compromise bill would have left the lottery system intact but barred the young immigrants known as Dreamers who obtain citizenship from sponsoring their parents.

The bipartisan measure's sponsors included eight GOP senators. It was produced by a group led by Republican Sen. Susan Collins of Maine and Democrat Manchin.

Also rejected was a modest plan by Sens. John McCain, R-Ariz., and Chris Coons, D-Del. It would have let many Dreamers qualify for permanent residency and directed federal agencies to more effectively control the border by 2020. But it didn't offer a special citizenship pathway, raise border security funds or make sweeping changes in legal immigration rules.

A proposal by Sen. Pat Toomey, R-Pa., was killed that would have blocked federal grants to "sanctuary cities," communities that don't cooperate with federal efforts to enforce immigration laws.