The House of Representatives has passed a bill to fund government operations until 16 February - the first move in efforts to avert a government shutdown.
The bill must now be voted on by the Senate, where it faces an uncertain future.
The Republicans do not have enough votes. Backing from at least some Democrats is needed to pass the bill ahead of the Friday midnight deadline.
The last US shutdown happened in 2013 and lasted for 16 days.
What happens next?
A vote is now expected in the Senate at some point in the next 24 hours, but it is unclear exactly when it will take place.
Republican leaders - who need some support from the Democrats - also face resistance from their rank-and-file conservatives, who are demanding more military spending, among other things.
This so-called stopgap spending measure would keep federal agencies funded only until 16 February.
The US government is already operating on its third temporary funding extension since this fiscal year began last October.
What's the main sticking point?
Democrats are demanding help for "Dreamers", more than 700,000 immigrants who entered the US illegally as children.
Liberals were in uproar when Mr Trump last year ordered the Obama-era Deferred Action for Childhood Arrivals (Daca) programme, which shielded Dreamers from deportation, to end this March.
In order to convince Democratic lawmakers to back their budget bill, Republicans are offering a six-year extension of the Children's Health Insurance Program (Chip), which benefits lower-income families.
What is Donald Trump's position?
The president caused a minor muddle on Thursday morning when he tweeted: "CHIP should be part of a long term solution, not a 30 Day, or short term, extension!"
The president's posting appeared to contradict Republican lawmakers' legislative strategy.
A White House spokesperson was forced to issue a clarification later clarifying that Mr Trump did actually support the House measure.
Arriving at the Pentagon for a visit, the president told reporters the government "could very well" shut down.
Another conservative lawmaker vented his frustration with Mr Trump.
"We don't have a reliable partner at the White House to negotiate with," said Senator Lindsey Graham, of South Carolina, according to the Washington Post.
What's at stake politically?
For Republicans, this would be the first government shutdown ever to occur when one party controls both chambers of Congress and the White House.
Senate Majority Leader Mitch McConnell emailed fellow Republicans on Thursday imploring them to vote in unison so they can blame Democrats.
Neither party wants to be held responsible for a federal shutdown with US midterms elections approaching in November.
Any backlash could also be problematic for 10 Democratic senators who are up for re-election this autumn in states that Mr Trump won in 2016.
What happens in a shutdown?
Mr Trump warned on Thursday that the consequences would be "devastating".
But essential services would still run.
That includes national security, air traffic control, inpatient medical services, emergency outpatient medicine, disaster assistance, prisons, taxation, electricity production and the military.
National parks and monuments could face closure, which provoked an angry public reaction during the last shutdown.
The Washington Post reports the Trump administration is making contingency plans to keep the parks running if no deal is reached.
Visa and passport processing could also be delayed, reports BBC.