US President Donald Trump
US President Donald Trump waits for a meeting with presumptive Speaker, House Minority Leader Nancy Pelosi (D-CA) and Senate Minority Leader Charles E. Schumer (D-NY) at the White House December 11, 2018 in Washington, DC.BRENDAN SMIALOWSKI/AFP/Getty Images

The U.S. government was headed towards a partial shutdown at midnight on Friday after President Donald Trump's fellow Republicans in the Senate failed to muster the votes needed to approve $5 billion he has demanded for a border wall fiercely opposed by Democrats.

Trump said the impending shutdown of key parts of the federal government could last "a very long time," and he sought to blame Democrats. They, in turn, put the blame squarely on him for his Thursday demand for wall funding after earlier backing bipartisan short-term government funding legislation passed by the Senate on Wednesday without any such money.

The impending shutdown was the latest evidence of dysfunction in Washington and might not bode well for next year, when Democrats will have a stronger hand as they take control of the House of Representatives.

"President Trump has thrown a temper tantrum and now has us careening towards a 'Trump shutdown' over Christmas," Senate Democratic Leader Chuck Schumer said on the Senate floor.

A child embraces a woman as people protest against Trump
A child embraces a woman as people hold signs to protest against U.S. President Donald Trump's executive order to detain children crossing the southern U.S. border and separating families outside of City Hall in Los Angeles, California, U.S. June 7, 2018.REUTERS/Patrick T. Fallon

"You're not getting the wall today, next week or on January 3rd, when Democrats take control of the House," Schumer added.

Hours before the deadline, lawmakers met with Vice President Mike Pence and other White House officials in a last-ditch effort to find a compromise government funding bill acceptable to both political parties and Trump. There was little indication any such agreement was imminent, but senators said talks would continue.

Congressional funding for about one-quarter of the federal government's programs expires at midnight (0500 GMT), and a shutdown would ensue if Congress, controlled by Trump's fellow Republicans, does not pass legislation to provide money to keep the agencies open.

Before meeting with Senate Republicans at the White House, Trump wrote on Twitter that "Democrats now own the shutdown," despite having said last week that he would be "proud" to close the federal government over the issue of border security and "I'll be the one to shut it down."

The House adjourned just before 7 p.m. (0000 GMT on Saturday) without approving government funding, all but ensuring a government shutdown.

Negotiators were discussing $1.6 billion for a range of border security measures - not specifically for a wall - and retaining financial assistance for areas hit by natural disasters that was added by the House, according to a Republican Senate aide.

That $1.6 billion would only be $300 million more than the amount the Senate approved in a temporary funding bill it passed late on Wednesday.

"It's possible that we'll have a shutdown. I would say the chances are probably very good," Trump said at the White House.

"We're going to get a wall," Trump added.

A wall along the U.S.-Mexican border to combat illegal immigration and drug trafficking was a key Trump campaign promise in the 2016 election, when he said it would be paid for by Mexico, and he sees it as a winning issue for his 2020 re-election campaign. Democrats oppose the wall, calling it unnecessary and ineffective.

PROCEDURAL VOTE

With Pence casting a tie-breaking vote, the Senate, where Republicans have a 51-49 majority, passed a procedural measure on Friday related to legislation approved by the House on Thursday with the wall money that Trump wanted. But Senate Republicans came up short of the votes needed to pass the wall funding.

Senate Majority Leader Mitch McConnell said the procedural vote merely ensured the White House and Democrats could keep discussing a potential compromise to avert a shutdown. Schumer said he was willing to continue talks. A Schumer spokesman said the senator met with Pence, Trump's new chief of staff, Mick Mulvaney, and Trump son-in-law and adviser Jared Kushner.

"There are some people on the White House team who think this can be done in hours. There are others that think it takes 24 (hours)," Republican Senator Bob Corker said.

Republican Senators Lamar Alexander and Marco Rubio expressed frustration with what they said was a shifting position by the White House. Rubio said that earlier in the week the Republicans went with their funding bill, which included $1.3 billion for general border security but nothing specifically for a wall, because Pence had told them the White House was open to such a proposal.

"We had a reasonable path and there was every indication from the president that he would sign it," Alexander said.

In a series of early-morning tweets on Friday, Trump called on McConnell to use the "nuclear option" to allow a Senate vote on legislation with a simple majority, rather than the standard "supermajority" of 60 votes. But there was not enough support among Republican senators to do so.

The possibility of a government shutdown fed investor anxieties that contributed to another down day on Friday for U.S. stocks. The Dow Jones Industrial Average .DJI fell 1.82 percent, the S&P 500 .SPX lost 2.06 percent and the Nasdaq Composite .IXICdropped 2.99 percent.

The showdown added to tensions in Washington as lawmakers also grappled with Trump's sudden move to pull troops from Syria, which prompted Defense Secretary Jim Mattis to resign and furthered concerns over the investigation of Russian meddling in the 2016 election that Trump won.

Three-quarters of government programs are fully funded through the end of the federal fiscal year next Sept. 30, including those in the Defense Department, Labor Department and Health and Human Services. Funding for other agencies, including the Department of Homeland Security, Justice Department and Agriculture Department, was set to expire at midnight on Friday.

A partial government shutdown could begin with affected agencies limiting staff to those deemed "essential" to public safety. Such critical workers, including U.S. border agents, and nonessential employees would not get paid until the dispute ends. National parks also would close unless the government declares them essential.

More than half of the 1,700 people who work for the executive office of the president would be furloughed.