WASHINGTON (AP) — The Senate passed a spending bill on Wednesday night to fund the government through early February, bringing the government one step closer to avoiding a shutdown in the coming days.

The bill now must be passed by the House and signed by President Donald Trump to ensure the federal bureaucracy will continue to operate through Feb. 8.

Senate Majority Leader Mitch McConnell, R-KY, said earlier Wednesday the “simple” bill would show that Republicans will finish the year by governing, rather than prolonging a potential crisis.

"Republicans will continue to fill our duty to govern," McConnell said. "We can continue this vital debate after the new Congress has convened."

The swift turn of events came after Trump moved off his demand for $5 billion for a U.S.-Mexico border wall. But facing criticism from supporters, Trump continued to argue Wednesday the wall would be built.

Trump has not said that he would sign a temporary spending measure without the border wall funds. But White House counselor Kellyanne Conway signaled Wednesday that he may consider it, saying “he’ll take a look at that certainly.”

It’s also unclear how many House Republicans, with just a few weeks left in the majority before relinquishing power to House Democrats, will even show up midweek for possible votes.

Many Republicans say it’s up to Trump and Democrats to cut a deal.

On Twitter, Trump appeared to respond to criticism that he was backing down, insisting that “One way or the other, we will win on the Wall!”

In our Country, so much money has been poured down the drain, for so many years, but when it comes to Border Security and the Military, the Democrats fight to the death. We won on the Military, which is being completely rebuilt. One way or the other, we will win on the Wall!

Trump also argued that Mexico will pay "indirectly" for the wall because the terms of a new trade deal will boost U.S. revenue. But that outcome is not assured and is not the same as his campaign promise that Mexico would pay for the wall, which the country has refused to do.

The White House shifted its rhetoric this week after days of impasse leading up to a potential partial government shutdown.

Just last week, Trump said he would be "proud" to shut the government down over the wall.

Without a resolution, more than 800,000 government workers could be furloughed or sent to work without pay beginning at midnight Friday, disrupting government operations days before Christmas.

Press secretary Sarah Huckabee Sanders indicated that Trump doesn’t want to shut down the government and said the administration was looking at ways to find the money elsewhere.

The stopgap measure would simply approve government funding at existing levels, without a boost for the border.

Should the Senate legislation pass the House, the border funding fight would be punted to the new year and the next Congress, which could prove even more difficult for Trump with a Democratic-led House.

The turn of events kick-started negotiations that had been almost nonexistent since last week's televised meeting at the White House, when Trump neither accepted nor rejected the Democrats' offer.

They had proposed keeping funding at current levels of $1.3 billion for border security fencing and other improvements but not for the wall.

House Democratic leader Nancy Pelosi and Senate Minority Leader Chuck Schumer have made it clear they are not interested in funding Trump’s border wall.

During a meeting earlier Tuesday on Capitol Hill, McConnell had proposed $1.6 billion for border fencing, as outlined in a bipartisan Senate bill, plus an additional $1 billion that Trump could use on the border, according to a senior Democratic aide unauthorized to speak about the private meeting.

"We cannot accept the offer they made of a billion-dollar slush fund for the president to implement his very wrong immigration policies," Pelosi told reporters. "So that won't happen."

Democrats also rejected the administration’s idea of shifting money from other accounts to pay for Trump’s wall. Schumer said there will be no wall money, “plain and simple.”

Pelosi will probably be able to quickly approve a longer-term measure to keep the government running in the new year. She called it a “good sign” that the White House appeared to be backing off its demands.

The White House showed its willingness to budge as it became apparent the president does not have support in Congress for funding the wall at the $5 billion level.

Sanders said Tuesday there are “other ways” to secure the funding. She pointed to the Senate’s bipartisan appropriation measure for the Department of Homeland Security, which provides $26 billion, including $1.6 billion for fencing and other barriers. It was approved by the committee in the summer on a bipartisan vote.

"That's something that we would be able to support," she said, as long as it's coupled with other funding.

Congress did pass legislation to fund much of the government through the fiscal year, until Oct. 1. But a partial shutdown would occur at midnight Friday on the remaining one-fourth of the government.

If the Senate bill dies in the House, the standoff dispute could affect nine of 15 Cabinet-level departments and dozens of agencies, including the departments of Homeland Security, Transportation, Interior, Agriculture, State and Justice, as well as national parks and forests.

About half the workers would be forced to continue working without immediate pay. Others would be sent home. Congress often approves their pay retroactively, even if they were ordered to stay home.

Many agencies, including the Pentagon and the departments of Veterans Affairs and Health and Human Services, are already funded for the year and will continue to operate as usual.

The U.S. Postal Service, busy delivering packages for the holiday season, wouldn’t be affected by any government shutdown because it’s an independent agency.