The Senate voted 88-9 to approve a stopgap spending bill to fund the federal government through Nov. 17, narrowly averting a shutdown by a midnight deadline. President Biden signed the bill into law shortly afterward.
The legislation also includes $16 billion in emergency disaster assistance requested by the White House and extends authorization for the Federal Aviation Administration through the end of the year. It does not include any additional aid to Ukraine, despite widespread bipartisan support for that funding in the Senate.
Biden praised the legislation before signing it and called for Congress to move quickly to address the lack of funding for Ukraine.
"We cannot under any circumstances allow American support for Ukraine to be interrupted," Biden said in a statement. "I fully expect the Speaker will keep his commitment to the people of Ukraine and secure passage of the support needed to help Ukraine at this critical moment."
The sudden agreement in Congress on spending was a major reversal after House Republicans remained at an impasse for weeks. House Speaker Kevin McCarthy, R-Calif., unveiled the bill Saturday morning after a closed-door meeting with House Republicans.
The vote came after an hours-long delay led in part by Sen. Michael Bennet, D-Colo., who demanded a firm commitment from leaders in both parties on the Ukraine aid.
"I think it's really important for us to send a message that the dysfunction that we have, in terms of this immediate question about opening or closing the government, doesn't reflect on our bipartisan commitment to make sure that the United States stays in this battle and that we continue to support the Ukrainian people in their fight," Bennet told reporters outside the Capitol.
The Senate vote capped a day of dramatic swings in Congress ahead of the shutdown deadline.
Earlier in the day, the House voted 335-91 to approve the extension. McCarthy has refused for weeks to consider any spending bill that would require the support of Democrats. But facing the potential for a politically and economically harmful shutdown, McCarthy reversed course, specifically calling on Democrats for help passing the bill.
"What I am asking, Republicans and Democrats alike, put your partisanship away, focus on the American public," McCarthy told reporters before the vote.
In the final vote of 209-126, more Democrats than Republicans supported the measure.
No funding for for Ukraine
The White House, congressional Democrats and many Senate Republicans have insisted on including financial support for Ukraine, because current funding is set to run out at the beginning of October. However, a bloc of House Republicans strongly oppose more funding for Ukraine, and lawmakers abandoned those plans in order to pass a deal on spending.
Senate Democrats lamented the lack of Ukraine funding but said there is a bipartisan commitment to find a path for funding. House Republicans have suggested the only way to do that is to pair the funding with money to address illegal immigration at the U.S. border with Mexico. Sen. Chris Murphy, D-Conn., rejected that idea.
"I just think it's much better for all of us, much better for the world if we separate the question of Ukraine from any other political question," Murphy told reporters in the Capitol.
He said lawmakers are "going back to the drawing board" to figure out what would go in a Ukraine assistance package but "that can't happen overnight."
Many Republicans in the House and some in the Senate oppose new funding for Ukraine without further accounting of how the previous funds have been spent.
"We're going to have a really, really tough conversation about whether and how we're going to fund Ukraine," said Sen. J.D. Vance, R-Ohio. "I think this is a victory for those of us who are skeptical of indefinite funding for Ukraine. But there's going to be another fight, whether it's next week or three weeks from now."
McCarthy's reversal
The sudden rush of action came after House Republicans huddled in the basement of the Capitol to discuss strategy.
Some McCarthy allies, like Rep. Dusty Johnson, R-S.D., argued a temporary fix to funding the government was needed so House Republicans can continue to push for conservative spending policy without the threat of a shutdown. Leaders stressed that with continued resistance from a group of conservative GOP members, there was no way to move a bill with just Republicans. McCarthy holds a narrow majority and can't lose any more than four votes.
Johnson pointed to the 21 far-right Republican members who blocked a GOP bill on Friday as the reason why the speaker moved to this new plan. Those members "put us in a position to unfortunately pass something a little less conservative. Now the good news is this is still a pathway to get the kind of conservative wins we need through the appropriations process."
House Republican leaders canceled the planned district recess for the beginning of October and said the House will continue to move their own spending bills — they passed four of the 12 that fund federal agencies.
Conservatives pushed back against the stopgap bill. Rep. Bob Good, R-Va., told reporters he would vote no against a continuing resolution. "There's no such thing as a clean CR." He argued if one passed he didn't believe the House would continue taking up the rest of the annual spending bills.
The threat to McCarthy's leadership
McCarthy's move opens him up to a challenge for his gavel. Florida GOP Rep. Matt Gaetz has been hinting for days he was planning to file a resolution to oust the speaker. Under rules McCarthy agreed to in January when he was elected, only one lawmaker is needed to file a "motion to vacate" — a resolution that calls for a vote of confidence in the speaker.
Asked by reporters if he was worried about his job, the speaker said, "You know what, if somebody wants to remove because I want to be the adult in the room, go ahead and try."
Democrats join with McCarthy's plan
There was drama early in the day as House Democrats attempted to stall progress on the House bill in order to give the Senate time to vote first on their own version of the legislation that would have provided roughly $6 billion for Ukraine.
As senators crept toward their own vote, across the Capitol, the House Appropriations Committee's Democratic staff members released an analysis criticizing the bill for not including money for Ukraine.
But it quickly became clear that Senate Republicans were on board with McCarthy's plan and House Democrats relented.
Rep. Jim McGovern, D-Mass., the top Democrat on the Rules Committee, said he was disappointed with the decision to remove Ukraine aid, but Congress needed to move ahead with the deal they could reach.
"There's bipartisan consensus on [Ukraine], we've had overwhelming votes on this, so I think we will work that out," McGovern told reporters. "But right now this is a bill — I mean I would have written the bill a little bit better, but this is a bill that Democrats can support and I think we won some important victories."
NPR's Deepa Shivaram contributed to this report.