Senate Majority Leader Mitch McConnell on Thursday night set up a key Friday vote to determine whether the government stays open or partially shuts down by the weekend.

The Senate easily agreed to proceed to the spending bill that would keep the government open until Feb. 16. But the measure is poised to fail, thanks to near-unanimous opposition from Democrats.

Democrats clamored to hold a vote to end debate on the bill Thursday night, but McConnell rejected that idea in what some saw as a bid to ramp up the pressure on Democrats to support the measure on Friday, just hours before the shutdown. Senate Minority Leader Chuck Schumer, D-N.Y., complained that Republicans were just delaying the failed vote, and wasting time that could otherwise be used to reach a deal.

"We should move...tonight, see the outcome," Schumer said. "I think we all know it will be defeated, and start negotiations tomorrow morning."

But McConnell was not swayed.

The decision is a gamble for McConnell, who is hoping Democrats come around and accept language that keeps the government open for another four weeks, and funds the Children's Health Insurance Program for six years.

If the bill goes down on Friday, McConnell has signaled he would keep the Senate in all weekend to continue voting on the bill until it passes.

Democrats instead argued for a five-day spending bill that gives lawmakers time to work out broad agreements on spending and immigration. The minority party has pushed for a deal to protect Dreamers and wants it included in the spending bill, but Republicans argued on the floor that immigration is a separate issue that has yet to be agreed, since Democrats have refused to agree to adding funding for a border wall and other changes.

Schumer said getting Dreamer language onto the spending bill is the last point of leverage for Democrats, but McConnell dismissed that, and said the current Executive Branch program that protects Dreamers today doesn't expire until March 5, which means there is still time to treat those issues separately.

"Where is the urgency here?" McConnell said of the Democrats' demands on immigration. "There isn't any."

"We've been in discussions for a couple of months," McConnell added. "They are prepared to shut down the government over illegal immigration."

And with that, shortly after 10 p.m., McConnell moved to adjourn for the night, after hearing one last objection.

"I don't understand why we're adjourning when we're in this urgent situation," Sen. Angus King, I-Maine.

The Senate was set to return Friday at 11 a.m.