A last-ditch battle to avert a looming US government shutdown moved to the senate on Friday, where Democrats angered by the collapse of immigration talks have vowed to block a stop-gap funding bill.
With the federal government set to run out of money on Friday at midnight - the eve of the one-year anniversary of president Donald Trump's inauguration - the bill cleared the House of Representatives with a 230-197 vote.
But prospects appeared gloomy in the senate, where Democrats eager for leverage on budget and immigration deals were intent on shooting it down.
Senate minority leader Chuck Schumer, a Democrat, said that if agreement was not reached by Friday night, there should be an even shorter-term funding measure of a few days that would "give the president a few days to come to the table."
Mitch McConnell, the senate Republican majority leader, said the House bill provides for four weeks of funding, enough to allow talks to continue "without throwing the government into disarray for no reason".
Mr Schumer wants to "hold the entire country hostage", he said.
"The leader is looking to deflect blame, but it just won't work," said Mr Schumer.
House speaker Paul Ryan called on Mr Schumer to avoid a government shutdown, saying: "It is risky. It is reckless. And it is wrong."
Mr Trump, who Mr Schumer said was "like a Sphinx on this issue", on Thursday added to the chaos gripping Washington, weighing in on the intense Republican manoeuvring aimed at avoiding a politically embarrassing funding debacle.
After a burst of tweets he second-guessed top Republican legislators and slapped down his own chief of staff, who had been leading a White House push on Capitol Hill for a budget compromise.
Arriving at the Pentagon for a visit, Mr Trump told reporters the government "could very well" shut down on Friday.
In the event the funding dries up, federal employees for agencies considered non-essential are ordered to stay home until a budget deal is struck, at which point they are paid retroactively.
The most recent shutdowns - in 1995, 1996 and 2013 - saw about 800,000 workers furloughed per day.
Key government bodies such as the White House, Congress, State Department and Pentagon would remain operational, but would likely furlough some staff.
The military would still report for duty, but troops - including those in combat - would potentially not be paid.
Each side is blaming the other for a failure to reach a budget compromise after three previous funding extensions.
"A government shutdown will be devastating to our military ... something the Dems care very little about!" Mr Trump tweeted in the morning.
And yet in another tweet, Mr Trump criticised the Republican short-term funding measure, opposing an offer intended to make it hard for Democrats to vote against it.
The sweetener is a six-year extension of CHIP, a popular children's health insurance programme which Democrats have worked hard to protect.
Up against a similar deadline last month, legislators passed a short-term resolution to keep the federal government funded until January 20.
If the Republican-led measure fails, Democrats will gain greater leverage to insist on a funding compromise that includes protection from deportation for the so-called "Dreamers", the estimated 700,000 immigrants brought to the United States illegally as children.
Negotiations on a bipartisan compromise that includes a solution for the Dreamers programme collapsed in acrimony at a White House meeting last week.
Mr Trump's reported reference to African nations and Haiti as "s***hole countries" at that meeting ignited a still-smouldering political firestorm.
White House chief of staff John Kelly met on Wednesday with the Congressional Hispanic Caucus to make the case that Mr Trump had "evolved" on his signature campaign promise to build a wall the length of the US border with Mexico.
Funding for border security, but not a full-blown wall, was part of the bipartisan budget compromise presented at last week's contentious White House talks.
Participants at the meeting with Mr Kelly quoted the retired general and former head of the Department of Homeland Security as saying Mr Trump was not "fully informed" when he made the wall promise.
But Mr Trump hit back on Twitter on Thursday: "The Wall is the Wall, it has never changed or evolved from the first day I conceived of it," he wrote.
"If there is no Wall, there is no Deal!" the president said in another tweet that described Mexico as "now rated the most dangerous country in the world".
The mixed messages from the White House prompted a rebuke on Wednesday from a frustrated Mr McConnell.
"I'm looking for something that President Trump supports, and he's not yet indicated what measure he's willing to sign," Mr McConnell told reporters.