The US government has narrowly avoided a crippling shutdown after politicians agreed on a last-minute spending deal.

Failure to reach an agreement would have meant federal employees would have missed pay ahead of the festive season, impacting various public services.

Plans to approve the government’s budget were thrown into disarray this week after billionaire Elon Musk hit out at a bill put forward by Republicans and Democrats.

His opposition was backed by president-elect Donald Trump who wanted to increase the debt ceiling, which caps the amount the government can borrow.

But his revamped plan to suspend the cap for two years lost in a vote on Thursday, putting Congress in a race against time to agree a deal before midnight local time.

Read more from Sky News:
King’s cancer treatment will continue in 2025
‘Prince of Darkness’ named new US ambassador

A restructured plan from House Speaker Mike Johnson dropped Mr Trump’s demands for a debt limit increase into the new year.

Mr Johnson had insisted Congress would “meet our obligations” and not allow federal operations to shutter ahead of the Christmas holiday season.

Late on Friday, the new plan cleared the Republican-controlled House of Representatives with bipartisan support by 336-34 votes.

Hours later, the Democratic-controlled Senate passed the bill in an 85-11 vote, 38 minutes after it expired at midnight.

Even though the deadline was missed, the government did not invoke shutdown procedures.

The bill will now be sent it to White House where President Joe Biden is expected to sign it into law later on Saturday.

This breaking news story is being updated and more details will be published shortly.

Please refresh the page for the fullest version.

You can receive breaking news alerts on a smartphone or tablet via the Sky News app. You can also follow us on WhatsApp and subscribe to our YouTube channel to keep up with the latest news.