WASHINGTON - Bitterly divided US lawmakers on Monday faced a shrinking window to reach elusive deals on immigration and federal spending, as President Donald Trump threatened to walk away from any immigration proposal that does not meet his demands.

Just days before a government shutdown would kick in at midnight Thursday absent a spending agreement, an impasse over immigration was overshadowing negotiations on multiple fronts.

Trump vowed during his State of the Union address last week to "extend an open hand" to both parties in pursuing an immigration deal that shields 1.8 million undocumented migrants from deportation -- in exchange for curbs on legal immigration.

But Democrats have savaged his proposal, and Trump was soon wagging an accusatory finger at an opposition he blames for refusing to help replace the program known as Deferred Action for Childhood Arrivals before a March deadline.

"Any deal on DACA that does not include STRONG border security and the desperately needed WALL is a total waste of time," Trump tweeted, referring to his long-sought wall on the US border with Mexico.

"March 5th is rapidly approaching and the Dems seem not to care about DACA. Make a deal!"

Congress has also been haggling over spending caps for domestic programs and the military, as lawmakers seek to finalize a budget for the remainder of 2018.

Republican and Democratic leaders have already acknowledged they will not meet Thursday's deadline, and will have to pass yet another stopgap to avoid a new government shutdown.

Lawmakers are smarting from an embarrassing three-day shutdown last month, when Democrats refused to back a spending measure that did not address the situation of the "Dreamers" -- hundreds of thousands of immigrants brought to the country as minors.

Senate Majority Leader Mitch McConnell said this time he did not expect a repeat of the shutdown, for which both camps have traded blame.

"There's no education in the second kick of a mule," the Kentucky lawmaker said.

DEBT CEILING LIMIT LOOMS

Complicating the legislative schedule, Treasury Secretary Steven Mnuchin has warned Congress that the Treasury has only enough cash to pay its bills through February 28, without hitting the debt limit and using extraordinary measures to keep payments flowing.

That is earlier than expected, the Congressional Budget Office said, because last year's $1.5 trillion tax cut is resulting in less federal revenue.

The crammed to-do list is further jeopardized by partisan feuding over an explosive Republican memorandum that Trump declassified Friday.

In a letter to the president, top Democrats -- including Congressman Adam Schiff -- warned of a "constitutional crisis" should he use the memo as a pretext to fire the special prosecutor heading an investigation into possible collusion between Trump's presidential campaign and Moscow.

Against this toxic backdrop, lawmakers are bracing for a heavyweight brawl on immigration.

In September, Trump decided to end DACA, meaning that its beneficiaries, the "Dreamers," could face deportation if Congress fails to act.

He unveiled a proposal last week that puts Democrats in a bind. It would place 1.8 million immigrants, including nearly 700,000 Dreamers, on a pathway to citizenship -- a top priority for the opposition.

But it would also require tightening border security including through $25 billion for Trump's border wall, ending the green card visa lottery, and curtailing the family reunification procedure that prioritizes relatives of US citizens in immigrating to the country.

In a bipartisan push to break the deadlock, Senate Republican John McCain and Democrat Chris Coons announced a plan that both offers a pathway to citizenship for Dreamers and boosts border security, but does not address family reunification or the visa lottery.

The White House quickly doused the plan -- which does not specifically fund a border wall -- with legislative affairs director Marc Short telling reporters it was "not sufficient" to gain Trump's support.

But Republican Senator John Cornyn essentially accused Democrats of negotiating in bad faith over the issue.

"We want to achieve a solution that can become law, and so far we haven't had a willing dance partner in our Democratic colleagues," he said.

Trump warned Democrats against blocking his proposal.

"We'll either have something that's fair and equitable and good and secure, or we're going to have nothing at all," he said last week.

House Republicans were set to meet late Monday to address a path forward, aides said.

But defiant Democrats warned against a plan being floated by Ryan that would temporarily cover domestic spending but fund military spending through the end of the year as a way to rally support from his fractured caucus, including conservatives who oppose concessions on immigration.

Such a move would equate to "barreling head first into a dead end," top Senate Democrat Chuck Schumer said.