President Donald Trump is trying to shift the blame after his last-minute flip-flop on a government-funding bill is set to push the federal government into a shutdown.

Last week, Trump said he would be " proud to shut down the government for border security" and told Democratic leaders he would "take the mantle of shutting it down."

But on Friday, Trump tried to point the finger at Democrats for the predicament, saying they "now own the shutdown."

The retreat came after multiple polls found a shutdown over Trump's promised border wall would be unpopular with a majority of Americans.

Now that a government shutdown appears to be imminent, President Donald Trump is trying to shift responsibility.

In a tweet on Friday, just hours before the federal government was set to enter a partial shutdown, the president attempted to point a finger at Democrats for the standoff over border-wall funding.

"The Democrats now own the shutdown!" the president said.

That sentiment is vastly different than Trump's declaration during a meeting with Democratic leaders Chuck Schumer and Nancy Pelosi at the White House just 10 days ago. In that meeting, Trump put the possibility of a shutdown entirely on his shoulders.

"I am proud to shut down the government for border security, Chuck, because the people of this country don't want criminals, and people that have lots of problems, and drugs pouring into our country," Trump said. "So I will take the mantle. I will be the one to shut it down. I'm not going to blame you for it — the last time you shut it down, it didn't work. I will take the mantle of shutting it down. And I'm going to shut it down for border security."

Trump's about-face came less than 14 hours before the government was set to run out of funding. A solution to avoid a shutdown and keep the government open until February 8 sailed smoothly through Senate on Wednesday, but Trump's sudden change of heart has pushed the government back to the brink.

Read more: Trump urges Mitch McConnell to use 'nuclear option' to pass border wall funding in morning tirade about likely government shutdown

After pushback from conservative TV pundits and the hardline House Freedom Caucus, Trump decided not to support the short-term continuing resolution (CR), since it did not include money for his long-promised wall along the US-Mexico border.

The House then added an amendment to the CR on Thursday that would allocate $5.7 billion in additional border security funding, but the revised bill will likely be dead on arrival in the Senate.

The president was set to huddle with Senate GOP leaders at the White House on Friday morning to try and find a way forward.

Trump's flip-flop on blame also comes after numerous polls found that the American people do not want a government shutdown over a border wall. An INSIDER poll found that 60% of people would not tolerate a shutdown over the issue.