Senators were optimistic they had the votes to end the government shutdown Monday after leaving meetings more confident about a compromise deal to allow Congress to pass a short-term funding bill.

The chamber passed a stopgap bill on Monday afternoon to keep the government open through Feb. 8 by a comfortable 81-18 margin.

"We will vote today to reopen the government," said Senate Minority Leader Chuck Schumer, D-N.Y.

Once the measure clears the Senate, it would move to the House, where if it gets approved it would go to President Donald Trump's desk. The bill also reauthorizes the popular Children's Health Insurance program for six years and delays some Affordable Care Act taxes.

Schumer said Democrats have received assurances that the Senate will take on immigration issues, such as the Deferred Action for Childhood Arrivals program. Earlier Monday, Senate Majority Leader Mitch McConnell, R-Ky., said he intends to allow debate on immigration before Feb. 8.

Schumer said he was "confident" a bipartisan bill to protect hundreds of thousands of immigrants brought to the U.S. illegally as children could win 60 votes. Protections under DACA end on March 5, the date Trump gave Congress to fix the program when he announced he was ending it.

Whether McConnell holds to his assurance and whether the Senate can pass an immigration bill remain to be seen. Democrats were holding out to get to vote on shielding those immigrants as part of a spending bill, but appeared not to have that demand met.

However, Schumer said he trusted McConnell's pledge.

"I expect the majority leader to fulfill his agreement to the Senate," the New York Democrat said, adding that if he does not, he will have "breached the trust" of bipartisan senators who worked the chamber out of an impasse.

Immediately after Schumer spoke, McConnell again cast the shutdown as a Democrat-driven decision over "illegal immigration."