The U.S. House of Representatives on Thursday overwhelmingly passed legislation to keep federal agencies funded until April 28 and avert government shutdowns at the end of this week when existing appropriations expire.

By a vote of 326-96, the House passed the bill that now goes to the Senate for passage.

A provision is also embedded in the spending bill to make it easier for Trump to win confirmation of General James Mattis to be defense secretary early next year. Republicans demanded it to help Mattis get around a requirement that the defense secretary be a civilian for seven years before taking the job. Mattis retired from the military in 2013.

The stop-gap funding bill reflects the inability of the Republican-controlled Congress to pass the dozen regular appropriations bills for the fiscal year that began Oct. 1 and runs through Sept. 30, 2017.

Congress was unable to pass all of the regular spending bills in part because of internal disagreements among Republicans on some of those measures and because Democrats held firm to an earlier budget deal that aims to restrain spending caps on defense as long as those caps were imposed on other domestic programs.

As a result, Congress may end up arguing well into 2017 over spending priorities for the current year even as it must begin considering funding government operations in fiscal 2018.

Congress' delay in finishing its work also means that President-elect Donald Trump, who takes office on Jan. 20, will have some say in government spending priorities for the period of April 28-Sept. 30, instead of President Barack Obama.

Assuming this temporary funding bill is passed by the Senate and signed by Obama, spending will be kept at the $1.07 trillion level for "discretionary" programs that was set in a 2011 budget deal.

Discretionary programs are those that Congress funds each year, versus "mandatory" programs, such as Social Security, that are automatically renewed every year.

The bill moving through Congress this week, as lawmakers try wrapping up their work for the year, contains $5.8 billion for waging military operations against the Islamic State worldwide.

It also provides $4.1 billion in disaster relief from hurricanes, floods, drought and other natural disasters.

Coal-state lawmakers were successful in getting a provision in the bill to extend until April 28 healthcare benefits for retired miners that were due to expire at year's end.

Republican leaders refused to allow a longer extension or an extension of a pension program that also expires soon.