The US government has avoided a federal shutdown after both House and Senate agreed on a short-term funding deal.
A bill ensuring funding until 17 November received overwhelming support, and was signed into law by President Joe Biden minutes before a deadline.
However, it was stripped of any new aid for Ukraine for its war against Russia - a key Democrat demand.
Republican House Speaker Kevin McCarthy submitted the bill in defiance of hard-liners in his own party.
A government shutdown, which would place tens of thousands of federal employees on furlough without pay and suspend various government services, was slated to begin at 00:01 ET (04:01 GMT) on Sunday.
But in a dramatic turnaround on Saturday afternoon, Mr McCarthy decided to put to a vote the temporary funding measure that would keep the government which contains funding for natural disasters but makes no major concessions on spending levels - a key demand of the Republicans controlling the lower house.
A majority of lawmakers were keen to avert a shutdown, and the bill was backed by more Democrats than Republicans, with as many as 90 House Republicans voting against it.
The move was a blow to a small group of right-wing Republicans who have held up negotiations in the chamber with unyielding demands for spending cuts and no new aid for Ukraine.
And with the House adjourning immediately after the vote, the Senate which had agreed its own bill that included aid for Ukraine was left with no choice but to pick up the House legislation. Only nine senators voted against - all Republican.
In a statement released shortly after the Senate vote, President Joe Biden said "extreme House Republicans" had sought to create a "manufactured crisis", and urged Speaker McCarthy to allow a further funding deal for Ukraine to pass without delay.
He said: "We cannot under any circumstances allow American support for Ukraine to be interrupted."
In an unusual move, senior Senate leaders from both parties, including minority leader Mitch McConnell, released a joint statement signalling their intention to "ensure the US government continues to provide" support to Ukraine in the coming weeks.
It came after Senator Michael Bennet - a Democratic member from Colorado, who backs more funding for Kyiv - held up Saturday's proceedings in protest at the lack of guarantees for Ukraine included in the deal.
Congress has approved about $113bn (£92bn) in military, humanitarian and economic aid to Ukraine since Russia waged its full-scale invasion last year. President Biden has requested another $24bn.
Shutdowns happen when both chambers of Congress are unable to agree on the roughly 30% of federal spending they must approve before the start of each fiscal year on 1 October.
With Republicans holding a slim majority in the House and Democrats holding the Senate by a single seat, any funding measure needs buy-in from both parties.
Repeated efforts to pass spending bills in the House have been thwarted in recent weeks by rebel right-wingers.
The group has opposed short-term spending measures and pushed for making cuts by passing long-term spending bills with agency-specific savings, even though such bills stand little chance of advancing through the Senate.
Mr McCarthy had been extremely reluctant to rely on Democratic votes to pass the House's bill until the last minute, given this would anger these hard-line conservative members of his party.
This drama is likely to be repeated again in less than seven weeks as fundamental disagreements over government spending levels and policies between Republicans and Democrats, and among Republicans themselves, have not been resolved.
In the meantime, Florida Congressman Matt Gaetz and hard-line conservatives in the House have a decision to make.
Mr McCarthy's decision to rely on Democratic votes to pass the short-term bill was supposedly a red line that, if crossed, would prompt an attempt to remove the Speaker from his leadership position, by triggering a so-called motion to vacate.
At his Saturday news conference, Mr McCarthy challenged those who oppose him to "bring it", adding: "There has to be an adult in the room."
The days ahead will reveal whether Mr Gaetz and company were serious about their threat - or just bluffing.
Latest Stories
-
Ghana and Seychelles strengthen bilateral ties with focus on key sectors
7 mins -
National Elections Security Taskforce meets political party heads ahead of December elections
10 mins -
Samsung’s AI-powered innovations honored by Consumer Technology Association
30 mins -
Fugitive Zambian MP arrested in Zimbabwe – minister
48 mins -
Town council in Canada at standstill over refusal to take King’s oath
59 mins -
Trump picks Pam Bondi as attorney general after Matt Gaetz withdraws
1 hour -
Providing quality seeds to farmers is first step towards achieving food security in Ghana
1 hour -
Thousands of PayPal customers report brief outage
2 hours -
Gary Gensler to leave role as SEC chairman
2 hours -
Contraceptive pills recalled in South Africa after mix-up
2 hours -
Patient sues Algerian author over claims he used her in novel
2 hours -
Kenya’s president cancels major deals with Adani Group
2 hours -
COP29: Africa urged to invest in youth to lead fight against climate change
2 hours -
How Kenya’s evangelical president has fallen out with churches
3 hours -
‘Restoring forests or ravaging Ghana’s green heritage?’ – Coalition questions Akufo-Addo’s COP 29 claims
3 hours