(Bloomberg) -- The US Senate cleared a $1.2 trillion government funding bill early Saturday to avert a partial government shutdown after beating back efforts by conservative Republicans to enact steep spending cuts and restrictions on migration.

“It wasn’t easy, but tonight our persistence has been worth it,” Majority Leader Chuck Schumer said just before midnight as he announced a deal to end a Republican filibuster.

The 74-24 vote sends the bill to President Joe Biden. “The president will sign the bill on Saturday,” the White House said in a statement after an accord had been reached. “Because obligations of federal funds are incurred and tracked on a daily basis, agencies will not shut down and may continue their normal operations.”

The government had been funded for the first six months of the federal fiscal year through temporary spending measures, with Republicans bedeviled by serial infighting. 

House Speaker Kevin McCarthy was ousted last October after he agreed to a deal with Democrats to keep the government open temporarily. 

While the House passed the bill 286 to 134, a majority of Republicans voted against it. On Friday, his successor, Mike Johnson, faced a threat to his speakership after he cut a bipartisan spending deal that didn’t fulfill Republican hardliners’ demands. Representative Marjorie Taylor Greene of Georgia took the first step toward ousting him, although it’s unclear whether she’ll force a vote. 

Read More: Republican Greene Threatens to Oust Johnson as House Speaker

The funding package increases defense appropriations by 3% while keeping overall domestic spending flat. Military troops get a 5.2% pay raise, and there are increases in child care, cancer research and primary school funding prioritized by Democrats. 

The spending package covers three-quarters of federal agency funding, including the Homeland Security Department, until the Sept. 30 end of the federal fiscal year. Congress earlier this month funded the other agencies for the remainder of the year.

Democrats made concessions including accepting a ban on providing US funds to the United Nations aid agency operating in the Palestinian territories. Social conservatives won a prohibition on flying the LGBTQ Pride flag at US embassies.

But Republicans accepted earmarks for LGBTQ-related projects and $200 million in funds for a new FBI headquarters in Maryland.

The deal also included an agreement to vote on legislation blocking implementation of the Biden administration’s tailpipe emissions after the Easter recess at a 60-vote threshold.

Read More: BGOV Summary of Spending Package

The bill doesn’t include supplemental spending sought by Biden  for Ukraine, Israel and other security priorities.  Johnson has said he plans to talk with his members and work on a supplemental security bill after a two-week recess. 

Several Democrats have said they would consider voting against any attempt to oust Johnson, but they want him to put Ukraine assistance — which Greene adamantly opposes — up for a vote.

©2024 Bloomberg L.P.