The House on Wednesday passed a $854 billion spending bill to avert an October shutdown, funding large swaths of the government while pushing the funding deadline for others until December 7.

President Trump has said he will sign the bill, avoiding the possibility of a government shutdown only weeks before the midterm elections and putting to rest speculation over whether he would force a shutdown over his proposed border wall.

The House vote was 361-61. The Senate already passed an identical measure a week ago by a vote of 93-7.

The package included two appropriations bills, which fully funded Defense, Labor, Health and Human Services and Education for fiscal 2019. It also includes a continuing resolution providing funding until December 7 for agencies for which appropriations bills have not been finished.

The Defense bill amounted to $674 billion (including off-budget funds not counted under the spending cap), including a 2.6 percent military pay raise.

The Labor-HHS bill included $180 billion in funds, including programs to combat the opioid epidemic, funding increases for the National Institute of Health, increases for Pell Grants, and a variety of community block grants.

Leaders of the conservative House Freedom Caucus hoped to derail the bill through amendments that would strike the Labor-HHS bill from the conference report, include $25 billion in funds for the border wall, and include a conservative immigration bill in the package among others.  The amendments did not advance.

If Trump signs the bill, it will be the first time in 22  years that five spending bills were enacted on time.  Last week, President Trump signed a package of three bills, including military construction and veterans’ affairs, legislative branch and water. In total, the five bills amount to some 77 percent of the annual discretionary spending total.

Meanwhile, the House and Senate were rushing to iron out differences on a third package of bills, including Agriculture, Interior, Transportation, Financial Services and general government.

With the House expected to adjourn on Friday until after the midterm elections, failure to do wo would punt action on the bills until November or December.