After days of heated debate, top Senate Democrat Chuck Schumer broke the logjam on Thursday night, saying that he would vote to allow the bill to advance. Schumer said he did not like the bill but believed triggering a shutdown would be a worse outcome as Trump and his adviser Elon Musk were moving swiftly to slash spending.
The Senate voted 54-46 to pass the bill and send it to Trump for signing into law, after fending off four amendments.
The Republican-controlled House of Representatives earlier this week passed the measure, which largely leaves spending steady at about $US6.75 trillion ($A10.68 trillion) in the fiscal year that ends September 30. Democrats had expressed anger over the bill, which will cut spending by about $US7 billion ($A11 billion) and which they said does nothing to stop Trump's campaign to halt congressionally mandated spending and slash tens of thousands of jobs.
The moves come as Trump is locked in a trade war with some of the US's closest allies that has sparked a major sell-off in stocks and raised recession worries.
Schumer's manoeuvre sent shockwaves through the Democratic Party and laid bare members' divisions over how to stand up to Trump while they remain in the governing minority.
"When the Senate Minority Leader sells you out, the only option is to take back the party and country with grassroots activists in blue and red districts to stand up for the Constitution and our democracy," Democratic Representative Ro Khanna said in a social media post.
Senate Democrats refrained from attacking Schumer, focusing their harsh words on Trump and Musk.
House Minority Leader Hakeem Jeffries refused to answer reporters' questions about whether he backed Schumer's leadership at a Friday press conference, exposing stunning cracks in the party leaders' strategy.
Schumer's decision particularly rattled House Democrats, who were huddled at a retreat in a suburb of Washington DC Jeffries rushed back to Washington to hold an impromptu press conference on the spending bill.
Schumer told Reuters he was unfazed by the criticism, or Jeffries' refusal to say he had confidence in him.
"We've been friends for a long time. There are always going to be disagreements on issues," Schumer said in a brief interview. "When I took my position. I knew some would disagree, but I felt shutting down the government would have been a disaster."
Blocking the bill would have required the support of at least 41 of Schumer's Democrats, who have long opposed government shutdowns as causing needless chaos to American families.
Republicans hold a 53-47 majority in the Senate.
The partisan bill will reduce spending by about $US7 billion ($A11 billion) from last year's levels. The US military will get about $US6 billion ($A9.5 billion) more, while non-defence programs will see a $US13 billion ($A21 billion) reduction.