President Donald Trump was faced Friday with the prospect of marking the first anniversary of his inauguration at the head of a broke government, after senators failed to pass a stop-gap funding measure.
Republicans and Democrats traded blame for the crisis, which came to a head when the Senate failed to agree to bring forward a motion to fund federal spending and the military from midnight.
Essential services and military operations will continue, but many American civil servants and diplomats could arrive at work on Monday only to find themselves sent home without pay until the political crisis is resolved.
Trump, who cancelled a trip weekend trip to his Florida golf resort to join 11th hour horsetrading accused the Democratic opposition of putting US troops and border security at risk to score political points.
But Democratic leaders accused Republicans of poisoning chances of a deal and pandering to Trump's populist base by refusing to fund a program that protects 700,000 "Dreamers" -- undocumented immigrants who arrived in the US as children -- from deportation.
"Not looking good for our great Military or Safety & Security on the very dangerous Southern Border," Trump tweeted, shortly before the 100-member Senate failed to muster the minimum 60 votes needed to get an emergency funding motion to the floor.
"Dems want a Shutdown in order to help diminish the great success of the Tax Cuts, and what they are doing for our booming economy," he alleged.
After the Senate vote failed and with half an hour to go before the shut down was to start, White House spokeswoman Sarah Sanders tweeted: "Democrats can't shut down the booming Trump economy. Are they now so desperate they'll shut down the government instead?"
Earlier, after meeting top Senate Democrat Chuck Schumer, Trump had sounded more upbeat, saying the two New Yorkers were "working on solutions" to share with Republican Senate Majority Leader Mitch McConnell and House Speaker Paul Ryan.
But Schumer admitted a "good number of disagreements" remain between the two sides, despite a "long and detailed meeting" at which they discussed "all of the major outstanding issues."
The president shelved plans to fly to Florida to celebrate at his Mar-a-Lago estate the first anniversary of his inauguration to remain in Washington to ride out the storm.
"He's not leaving until this is finished," White House budget director Mick Mulvaney said.
Republicans have a tenuous one-seat majority in the Senate but would have needed to lure some Democrats to their side to get a 60 vote supermajority to bring the motion forward.
After around 15 minutes of voting more than 40 senators had voted against the motion, which is not technically closed until the last vote is cast.
When it became clear that this threshold was not going to be reached, Senate majority leader Mitch McConnell launched into a private debate with Schumer on the senate floor.
Democrats had insisted on a deal that would protect from deportation the so-called "Dreamers" -- immigrants who entered the country illegally but as children.
The measure brought to Congress would have extended federal funding until February 16 and reauthorized for six years a health insurance program for poor children -- a long-time Democratic objective.
But it would have cut the Deferred Action on Childhood Arrivals program, known as DACA, that affects Dreamers.
White House officials insisted there was no urgency to fix DACA, which expires March 5.
"This is purely an attempt by the Senate Democrats led by Schumer -- why we call it the 'Schumer shutdown' -- to try and get a shutdown the president gets blamed for," Mulvaney said.
With mid-term congressional elections looming later this year, Republicans risk being blamed by voters when the government stops functioning over lack of funds.
A new Washington Post/ABC poll found that 48 percent of Americans blame Trump and the Republicans for a potential shutdown, and only 28 percent hold Democrats responsible.
There have been four government shutdowns since 1990. In the last one in 2013, more than 800,000 government workers were put on temporary leave.
Essential functions like the military, law enforcement, the White House and Congress would continue working but with reduced staff. Some agencies would shut altogether.
But others in the massive bureaucracy will be sent home without pay.
International ratings agency Fitch said a partial shutdown was unlikely to affect America's AAA/stable rating for US sovereign debt.
Negotiations with the White House on a bipartisan compromise on DACA blew up last week after Trump reportedly referred to African nations and Haiti as "shithole countries."
"Tonight's failure in US Senate can be laid squarely at Donald Trump's feet," Democratic congressman Gerry Connolly tweeted.
"Mr. Art of the Deal showed indecision, profound vulgarity and racist sentiments. Today he was barely active in trying to get a deal. Exactly one year in the job he proves he's not up to it."
Trump's unpredictable Twitter outbursts and sudden changes of position also have bedeviled Republican leaders as they maneuver to cut a deal.