WASHINGTON – A short-term spending bill that would fund the government through early next year and avert a looming government shutdown cleared its first hurdle Wednesday night when it won approval in the Senate.

Senators voted by voice vote to approve the spending measure, which would temporarily end a budget impasse by funding nine federal departments and several smaller agencies at their current funding levels through Feb. 8.

The bill now goes to the House, which could approve it on Thursday.

Senate Majority Leader Mitch McConnell, R-Ky., offered the temporary spending bill after President Donald Trump’s demand for $5 billion in funding for a wall along the nation’s southern border resulted in a standoff that threatened to shut down parts of the government. The temporary spending bill punts a decision on border wall funding until next year.

“We don’t want to end this year the way we began it, with another government shutdown,” McConnell said.

Nine federal departments and several smaller agencies – a quarter of the government – will run out of money and shut down at midnight Friday unless Congress and the White House agree to extend their funding.

Whether Trump will sign the short-term funding bill remains uncertain. Trump boasted during an Oval Office meeting with Democratic leaders last week that he would be “proud” to shut down the government over border security and that he’d be willing to take the blame for any fallout.

But the White House retreated from that threat this week. White House spokeswoman Sarah Sanders said Tuesday that Trump asked his Cabinet secretaries to look for other sources of funding to help protect the border and suggested that the administration is looking to Congress for ways to avoid a shutdown.

“We've laid out clearly what our parameters are with members of Congress,” Sanders said. “We want to know what they can pass. We want to know what they think they can actually get done. We've laid out what we'd like to see. In the meantime, we're looking at other areas where we can draw money from to make sure that the president can actually protect our border and protect American citizens.”

Earlier Wednesday, before McConnell had announced plans for the temporary funding bill, one of Trump’s top advisers, presidential counselor Kellyanne Conway, said he might sign a short-term measure. But she insisted he was not giving up on his campaign promise to build a border wall.

“There are other ways for him to get that money and he said, one way or another, he will get the money for the border security,” Conway said.

Afp Afp 1bi80e A Pol Usa Dc
Presumptive speaker, House Minority Leader Nancy Pelosi, D-Calif., listens while Senate Minority Leader Chuck Schumer, D-N.Y., and President Donald Trump argue before a meeting at the White House Dec. 11, 2018, in Washington, D.C.
BRENDAN SMIALOWSKI, AFP/Getty Images

On Capitol Hill, McConnell expressed confidence that a shutdown would be avoided even though Democrats rejected an earlier GOP proposal to end the impasse.

In an 11th-hour attempt at compromise, McConnell proposed approving a spending bill that would include $1.6 billion for border fencing along with an additional $1 billion for immigration. Democrats described the additional funding as a "slush fund" and rejected the offer.

House Minority Leader Nancy Pelosi, D-Calif., said the GOP proposal would have allowed Trump to continue “his very wrong immigration policies.”

“That won’t happen,” she said.

McConnell followed up with the offer of a short-term spending bill, and Pelosi said House Democrats would support it.

On the Senate floor, McConnell accused Democrats of rejecting the earlier compromise out of "knee-jerk, partisan opposition" to Trump.

“It seems like political spite for the president may be winning out over sensible policy," he said.

Nine federal departments wait for Congress to approve their budgets. Those departments are Agriculture, Commerce, Justice, Homeland Security, Interior, State, Transportation, Treasury and Housing and Urban Development, as well as several smaller agencies.

Both of the government shutdowns during Trump’s presidency were ended by short-term funding bills.

In January, parts of the government shut down for three days after an impasse in the Senate over federal funding. The shutdown ended when the Senate passed a short-term spending measure.

Less than three weeks later, the government shut down for a second time after Congress failed to pass a spending bill to keep the agencies running. That shutdown ended after only six hours when lawmakers passed a six-week spending bill.

Contributing: John Fritze, Nicole Gaudiano and David Jackson

More: Americans' message to Washington on the looming shutdown: Don't

More: Will NORAD's Santa Tracker still monitor St. Nick's journey even if there's a government shutdown?

More: The Ghost of Shutdowns Past haunts latest talks to keep the federal government open