President Biden is expected to sign it later Saturday. The new legislation will keep the government open but did not include the debt ceiling increase that President-elect Donald J. Trump had demanded. The Senate approved legislation to avert a federal government shutdown just after a midnight deadline, capping a chaotic week in which President-elect Donald J. Trump blew up a bipartisan spending deal, only to see his own preferred plan collapse as Republicans defied him. President Biden is expected to sign the measure, which would extend funding into mid-March and approve disaster relief for parts of the nation still recovering from storms. The White House said early Saturday that it was not instituting a government shutdown, even though funding to run the government technically ran out at midnight. Earlier Friday, House Republicans stripped out a provision sought by Mr. Trump to suspend the federal debt limit and spare him the usually politically difficult task of doing so when he takes office. The debt measure incited a revolt by Republicans on Thursday and led to the defeat of Speaker Mike Johnson’s first attempt to extend government funding. Here is what else to know: Speaker’s bind: Mr. Johnson abandoned the bipartisan funding deal he had reached with Democrats this week under a barrage of criticism from both Mr. Trump and the billionaire Mr. Musk, whom the president-elect has designated to lead his push to rein in government. That sent Mr. Johnson toiling to cut a deal that would not only avert a shutdown but also salvage his chances of keeping his job. Many Republicans were angry about the initial spending compromise he forged with Democrats. Musk on German politics: Mr. Musk, who helped sink the bipartisan spending compromise this week by inveighing against it on social media, weighed in on German politics in the same forum on Friday. In post on X, Mr. Musk endorsed the far-right and anti-immigrant Alternative for Germany party ahead of federal elections in February. A correction was made on Dec. 20, 2024: An earlier version of this article misstated which Democratic House member voted present. Jasmine Crockett of Texas voted present, not Marcy Kaptur of Ohio. When we learn of a mistake, we acknowledge it with a correction. If you spot an error, please let us know at nytnews@nytimes.com.Learn more Show more Maya C. Miller Dec. 21, 2024, 1:16 a.m. ETDec. 21, 2024 Maya C. MillerReporting from the Capitol A late-night attempt to revive a measure to increase funding for juvenile cancer research failed when Senator Rand Paul, Republican of Kentucky, objected to the bill. The measure, known as the Give Kids a Chance Act, had been dropped from the larger government funding bill earlier this week. Because senators were trying to pass the bill using a method known as unanimous consent, Paul’s objection was the only one necessary to kill it. Maya C. Miller Dec. 21, 2024, 12:39 a.m. ETDec. 21, 2024 Maya C. MillerReporting from the Capitol The Senate has voted 85 to 11 to pass the stopgap spending bill approved in the House earlier today and keep the government open. The bill now goes to President Biden’s desk.