Senate Majority Leader Mitch McConnell (R-Ky.) listens as President Trump speaks during a meeting with Republican lawmakers in the Roosevelt Room of the White House on Sept. 5. The Senate passed a “minibus” of three spending bills on Sept. 12. (Evan Vucci/AP)

The Senate passed a bipartisan spending package Wednesday paying for veterans affairs, military construction and other programs for 2019 — a big step forward as congressional leaders maneuver to avoid a government shutdown at month’s end.

The vote was 92 to 5. The legislation is expected to pass the House on Thursday and then go to President Trump, who is expected to sign it.

The measure would mark the first batch of spending bills for 2019 to be signed into law, and comes with time running out for Congress to finalize all the must-pass bills before government funding expires Sept. 30.

It’s progress for lawmakers who are trying to avoid a repeat of what happened in March, when Trump threatened to veto a massive $1.3 trillion spending package for 2018 that arrived at his desk months late. Trump ultimately signed the “omnibus” bill but vowed never to sign another one like it.

This time lawmakers have wrapped the spending bills into smaller “minibus” packages to be able to move them more quickly. The legislation approved Wednesday comprised three of the 12 annual spending bills Congress must approve each year to keep the government funded. The three bills cover funding for military construction and veterans affairs; energy and water development; and the legislative branch.

“This week’s bills contain $147 billion for projects ranging from water and infrastructure to military family housing to nuclear security and much more,” said Senate Majority Leader Mitch McConnell (R-Ky.). “These are national priorities with local impacts that will be felt in every one of our states.”

The White House applauded the agreement, while criticizing the spending as too high, and said the president looks forward to signing it.

The appropriations bills passed Wednesday are usually the three easiest to get agreement on. Lawmakers have already decided to delay the trickiest issues — including the homeland security bill that contains funding for Trump’s border wall — until after the November midterm elections.

Trump has vacillated about whether he’ll go along with that strategy or force a shutdown Oct. 1 to pressure Congress to give him the $5 billion he wants for the wall — a figure that Senate Democrats are unwilling to go along with after the Senate struck a bipartisan deal to spend only $1.6 billion on the wall next year.

House Speaker Paul D. Ryan (R-Wis.) and other GOP leaders have sought repeatedly to convince the president that shutting down the government ahead of crucial midterms is not a good idea, but Trump has said he thinks it would be good politics.

Lawmakers hope to pass another spending package, containing bills to fund the Pentagon and the Health and Human Services Department, ahead of the Sept. 30 end of the fiscal year. If they succeed in sending those bills to Trump, they will have provided for most of the government’s budget for next year. And they hope Trump will be willing to declare victory over a big boost in Pentagon funding and delay the border wall fight.

The rest of the government, including the Homeland Security Department, would be put on auto­pilot with a short-term spending bill that extends 2018 spending levels until lawmakers finalize the budget after the midterm elections.

The legislation passed Wednesday contains significantly higher spending for some programs than Trump recommended in his budget proposal for 2019 — the price Democrats exacted across domestic agencies in exchange for agreeing to higher spending for the military.

It also leaves out a number of “poison pill” riders sought by Republicans in the House, but opposed by Senate Democrats and therefore omitted from the final product because spending bills require bipartisan support to pass the Senate. Democrats boasted about killing provisions to allow guns to be carried on Army Corps of Engineers lands, and to repeal the “Waters of the United States” rule, which conservatives claim allows the federal government to overreach in its management of wetlands and small streams.

Rep. Cathy McMorris-Rodgers (R-Wash.), a member of the House GOP leadership who is facing a tough reelection battle, was on the losing end of a fight over a complicated provision involving diversion of water from dams to help salmon. The legislation omitted language to counter an Oregon court decision providing for more water diversions.

The legislation contains provisions on a wide range of topics, among them:

● $1 million for the Capitol Police for lawmaker security at events away from the Capitol, following last year’s shooting at a congressional baseball practice

● $174,000 for a death gratuity payment to the family of the late Republican Sen. John McCain of Arizona has been in effect since 2009

● $6.5 billion for the Department of Energy Office of Science, which is $1.2 billion more than Trump requested;

● A new fund allowing lawmakers to pay congressional interns, who have long been unpaid;

● A one-year funding fix for the new VA Mission Act signed by Trump, which consolidates programs allowing veterans to receive private care coordinated by VA. This follows a fight over how to pay for the new law; the outcome was a short-term solution that will require lawmakers to revisit the issue in a year.