Politico and NBC News reported that Senate Majority Leader Mitch McConnell was preparing to keep the chamber in session all weekend in the event a shutdown happens, with the intention of forcing Democrats from states that backed Trump into politically perilous votes. Some of those Democrats, like Claire McCaskill of Missouri and Joe Manchin of West Virginia, face tough re-election bids this year.

Two Senate Democratic aides told CNBC that Democrats have the votes to block the House bill. Meanwhile, Senate Minority Whip Dick Durbin, D.-Ill., said the count was ongoing, according to NBC News. "It's going to be close," Durbin told NBC News. "We're asking our members where they stand."

Yet doubts emerged about the Senate's ability to approve the short-term funding legislation the House hopes to pass. As many Senate Democrats and even some Republicans said they would oppose another stopgap spending plan, third-ranking GOP Sen. John Thune said he was "concerned" the bill would not have 60 votes to pass the Senate, according to Politico .

House Speaker Paul Ryan said Thursday that he had "confidence" the House would pass a bill to avoid a government shutdown – a measure the White House said President Donald Trump supports. A deal apparently reached between the skeptical House Freedom Caucus and GOP leaders put the House on the brink of approving its proposal on Thursday night.

The threat of a federal government shutdown surged ahead of a rapidly approaching weekend deadline as doubts emerged about a last-minute spending plan passing both chambers of Congress.

Speaker of the House Paul Ryan (R-WI) answers questions on the possibility of a government shutdown at the U.S. Capitol on January 18, 2018 in Washington, DC.

Ryan, like Trump and McConnell, put the burden on Senate Democrats to back the proposal — which would extend government funding to Feb. 16 and reauthorize the Children's Health Insurance Program for six years — and avert a government shutdown. Republicans control the House, Senate and White House, and the House can pass a spending plan with only GOP votes.

While Ryan projected confidence, he faces some resistance within his own membership. Mark Meadows, leader of the conservative Freedom Caucus, told media outlets throughout the day that the group is largely opposed to the continuing resolution. However, after a phone call with Trump and meeting with Ryan on Thursday evening in which he said he secured military concessions, Meadows moved the caucus toward "yes."

"The majority of the @freedomcaucus has taken a vote to support the CR effort this evening," the group said in a tweet.

The GOP may have to go it alone in the House. House Minority Leader Nancy Pelosi, D-Calif., said "we'll be opposing" the continuing resolution, which she called a "bad idea" and "wrong." She added that majority Republicans will "own" a shutdown.

The Senate, meanwhile, will need support from nine Democrats, if all Republicans back the legislation. Virginia Democrats Mark Warner and Tim Kaine, among others, announced their opposition to the bill.

"If the Senate Democrats want to shut the government down, if the Senate Democrats want to deny funding for our troops, if the Senate Democrats want to stop funding CHIP for unrelated issues — that's a choice they would make, I don't think it's a good choice for them to make — but that would be their decision to make," Ryan told reporters on Thursday.

Meanwhile, Republican Sens. Rand Paul of Kentucky, Lindsey Graham of South Carolina, Mike Lee of Utah and Mike Rounds of South Dakota also said they would oppose the funding bill as crafted by the House.

"I am not going to support continuing this fiasco for 30 more days by voting for a continuing resolution," Graham said in a statement on Thursday evening.

Democrats have threatened to oppose the plan if they cannot also pass a bill this week protecting hundreds of thousands of young immigrants from deportation. The Deferred Action for Childhood Arrivals program, which President Donald Trump ended in September, will start to phase out on March 5.

Shortly before Ryan spoke, Trump said a shutdown "could happen" and also said "it's up to the Democrats" to avoid it.

Earlier, Trump's tweet about CHIP added more confusion to the already contentious scramble to keep the government funded. Trump said "CHIP should be part of a long term solution, not a 30 Day, or short term, extension!"

Later Thursday, a White House spokesman clarified Trump's position: "The President supports the continuing resolution introduced in the House. Congress needs to do its job and provide full funding of our troops and military with a two year budget caps deal. However, as the deal is negotiated, the President wants to ensure our military and national security are funded. He will not let it be held hostage by Democrats."

Ryan on Thursday said Trump's tweet is "not causing us problems at all." He added that Trump understands how CHIP works.

While Republicans have looked to pin the blame on Democrats for a possible shutdown, Senate Minority Leader Chuck Schumer said Wednesday that a shutdown "will fall squarely on the majority leader's shoulders and the president's shoulders."

Negotiations on an immigration bill that would protect immigrants shielded by DACA and meet Republican demands to boost border security and tweak extended family migration and the visa "lottery" system hit a snag last week when Trump rejected a deal reached by bipartisan senators.

-CNBC's Kayla Tausche contributed to this article.