The Senate majority leader, John Thune, at the US Capitol on 4 August. Photograph: Bonnie Cash/UPI/Shutterstock
The Senate majority leader, John Thune, at the US Capitol on 4 August. Photograph: Bonnie Cash/UPI/Shutterstock

The US Senate on Friday passed a government funding bill that will prevent a shutdown through the midterm elections, though it still must be approved by the House of Representatives.

The continuing resolution (CR) passed by a 90-6 vote will keep the government running at its current funding levels until 11 December, more than a month past the midterms in which Democrats are hoping to regain control of Congress and block Donald Trump's legislative agenda for the final two years of his presidency.

The measure's passage signals a recognition by both parties that they would prefer to avoid a messy battle over federal spending in the weeks leading up to the 3 November vote.

The government will shut down after 30 September if new funding is not approved, and the Republican Senate appropriations committee chair, Susan Collins, called the CR "a major step toward averting a damaging shutdown that only harms vital programs and federal workers", and noted it makes no major changes to funding levels.

The House had last month approved a different CR that would continue funding until 4 December. It is unclear which bill will ultimately be adopted – the House is on recess until the end of the month, and senators were expected to leave Washington DC for their break following the vote.

Patty Murray, the top Democrat on the Senate appropriations committee, said the House's bill had "several major issues" that the Senate's version addressed. It would block until 11 December a new rule by the White House office of management and budget that Democrats fear would allow the Trump administration to cancel grants at any time for any reason. The Senate CR also closes what Murray called a "loophole" in the House bill that would have allowed the White House to take money meant for other purposes and give it to the border patrol.

"Today's CR gives us the breathing room necessary to work out a budget that helps make life more affordable to working families and reins in Trump's rampant chaos, his rampant corruption," the Democratic minority leader, Chuck Schumer, said ahead of the vote.

Democrats instigated a government shutdown last year when they refused to approve funding bills without an agreement to extend subsidies for Affordable Care Act health plans. That led to the longest funding lapse in US history, but ultimately no agreement to keep the cost offsets going after the shutdown ended 43 days later.

Some government agencies shut down again briefly earlier this year after Democrats held up a funding bill for the Department of Homeland Security (DHS) in protest of the killings by federal agents of two US citizens in Minneapolis during an intensive immigration enforcement drive.

While an agreement was reached to resolve that blockade, the two parties did not agree on funding DHS for weeks, as Democrats held out for reforms to immigration enforcement operations.

A bipartisan agreement was reached to fund the department operations exclusive of the agencies involved in Trump's mass deportation push, then Republicans passed a party-line bill that allocated funding to Immigration and Customs Enforcement and Customs and Border Protection for the duration of Trump's presidency, with no reforms to immigration enforcement.