WASHINGTON (Reuters) - The U.S. Senate on Wednesday passed legislation to fund several federal agencies through Feb. 8 and avert a partial government shutdown, but without including $5 billion for a U.S.-Mexico border wall that President Donald Trump demanded.

By a voice vote the Senate approved the stop-gap measure, sending it to the House of Representatives for passage before a midnight Friday deadline when existing funding expires for several federal agencies, including the Department of Homeland Security.

The bill would continue spending at current levels for about 25 percent of programs administered by Washington.

If approved by the House and signed by Trump, the measure would force a newly-seated Congress to begin 2019 facing yet another in a series of budget and border security fights.

By postponing longer-term decisions on spending for agencies that also include the departments of Justice, Commerce, Interior and Agriculture, Democrats will be in a somewhat stronger bargaining position next year when they take majority control of the House.

Democrats and many Republicans have challenged the wisdom of giving Trump $5 billion this year to build a wall - which carries an estimated $24 billion price tag - that they argue would be less effective in securing the border than building on a mix of tools already in place.

In a last-ditch attempt to resolve the impasse this year, McConnell on Tuesday proposed giving Trump a $1 billion fund that he could use at his discretion for border security.

Senate Democratic Leader Chuck Schumer labeled that a “slush fund” that would lack the votes to pass Congress.

On Wednesday, McConnell attacked Democrats for rejecting it, saying, “It seems like political spite for the president may be winning out over sensible policy.”

The White House said on Tuesday it would search for already appropriated government funds to be redirected towards building the wall, since Congress was not cooperating with its request for the money.

It was a tacit acknowledgment that Congress was unlikely to fund the wall and marked a move away from Trump’s tough rhetoric last week that he would be “proud” to shut down the government over wall funding.

But Schumer, speaking on the Senate floor on Wednesday, said the administration could not shift money around without Congress’ consent.

“The House and Senate will not approve a wall from reprogrammed funds or anything else. It won’t happen,” Schumer warned.

Trump accused Democrats in a Twitter post earlier on Wednesday of being willing to fund everything but “border security and the military,” while his senior adviser Kellyanne Conway took Republican lawmakers to task for not pushing harder on the issue.

“On this, they’re walking away,” Conway said in an interview on Fox News.

Just before passing the spending bill, a group of Democratic senators took the unusual step of singing Christmas songs in the chamber as other lawmakers engaged in serious conversation.