The US is edging towards another government shutdown after the lower chamber of Congress failed to pass a spending bill to keep federal agencies open.
Funding is set to lapse at midnight on Friday unless Republicans and Democrats can agree on a way forward.
Here’s a breakdown of how we got here and what this means for Americans – and for Donald Trump.
Why is this shutdown looming?
Many federal government agencies rely on annual funding approved by Congress.
Every year, these agencies submit their requests, which Congress must pass, and the president must sign budget legislation for the next fiscal year.
If an agreement is not reached, then all non-essential, discretionary functions of the US government stop.
In September, both parties agreed a bill to keep government funding until 20 December.
This week, three days before lawmakers were set to head off for a holiday break, the Speaker of the House of Representatives, Republican Mike Johnson, released a bill to extend funding until March.
It was agreed with Democratic leadership but included some measures like a pay rise for lawmakers that made some Republicans unhappy.
Tech billionaire Elon Musk, an ally of Trump, posted his opposition to it and then the president-elect signalled he wanted his party to kill it, which is what happened.
A second, slimmed-down bill did make it to the floor of the House on Thursday night but failed to get enough votes to pass.
Who is affected by a government shutdown?
If no deal is struck by midnight, then the US will have its first shutdown since early 2019.
Essential workers continue as normal, some of them without pay, while government employees deemed non-essential are put temporarily on unpaid leave.
Border protection, in-hospital medical care, law enforcement and air-traffic control will continue to operate.
But services like the food assistance programme, federally funded preschool, the issuing of student loans and food inspections, and National Parks will be curtailed or close.
While Social Security and Medicare cheques are sent out, benefit verification and card issuance stops.
There could also be travel delays if the stand-off drags on.
“An extended shutdown could mean longer wait times at airports,” said Transport Security Administration spokesman Carter Langston.
Why did Elon Musk oppose the bill?
The Tesla boss has been tasked with identifying spending cuts by co-leading the proposed Department of Government Efficiency (DOGE).
It is not an official government department but he has vowed to find $2tn in savings.
On Wednesday he made dozens of posts on X, the platform he owns, to express his disgust with Mike Johnson’s bill.
Amplifying some false statements about what was in the bill, he called it criminal and outrageous.
After Musk drummed up opposition, Trump and JD Vance, the incoming vice-president, dealt the final blow to Johnson’s deal that evening.
They said in a joint statement they wanted streamlined legislation without the Democratic-backed provisions that Johnson had included.
They also called for Congress to raise or eliminate the debt ceiling, which determines how much the government can borrow to pay its bills.
What happens now?
Johnson has promised to find a solution on Friday so there will be much wrangling on Capitol Hill as the clock ticks down.
But to get the support required in the House to pass, he will need Democratic votes.
Democrats say they will only support the original bill that Trump and Musk opposed.
If no agreement is reached then the US federal agencies will shut down at midnight.
How common are shutdowns in the US?
Quite common. President Ronald Reagan oversaw eight shutdowns during his tenure – though all were relatively brief.
And there were three when Donald Trump was president, including the longest in history at 36 days which ended in January 2019.
That one happened because of disagreements over funding a wall on the Mexico border.
The Congressional Budget Office (CBO) estimated that it reduced economic output by about $11bn, including $3bn that it never regained.
Shutdowns over budgets are almost unique to US politics.
Under the US system, the different branches of government have to reach an agreement on spending plans before they can become law.
In most countries, budget votes become votes of confidence in the government itself. But because the US has equal and often divided branches of government, that isn’t the case.
Why does Trump want to raise the debt ceiling?
Also known as the debt limit, this is a law that restricts the total amount of money the government can borrow to pay its bills.
This includes paying for federal employees, the military, Social Security and Medicare, as well as interest on the national debt and tax refunds.
Every so often, US Congress votes to raise or suspend the ceiling so it can borrow more.
Trump adding this condition to the deal was an unexpected demand that has made it harder for right-wing Republicans who often rail against increased government spending to back the bill.
The debt ceiling was going to have to be increased in the coming months regardless of the efficiency drive being promised.
But by demanding it happen now, some analysts believe Trump is signalling the cost of his proposed tax cuts and tougher border restrictions will test the ceiling limits. And he prefers the fight over the increase happens before he takes office.
Democrats are usually in favour of raising the debt ceiling without strings but they are in no mood to help Republicans now.
The risk to Trump is that the mini-rebellion chips away at the cloak of invincibility he has worn since the election.
And it raises questions over how smoothly his party will be able to deliver on his campaign promises that require legislation.