WASHINGTON — The House passed a short-term extension of government funding late Thursday after Republican leaders, with help from President Trump, cobbled together enough Republican votes to overcome an internal revolt.

Still, the possibility of a federal shutdown moved closer to a certainty after Senate Democrats rallied against the Republican proposal, announcing they would not lend their votes to a bill that did not reflect their priorities on immigration, government spending and other issues.

By Thursday evening, nine members of the Senate Democratic Caucus who had voted for a spending measure in December – including Maine Sen. Angus King, an independent – said they would not support the latest proposed four-week extension. They joined 30 other Democrats and at least two Senate Republicans who oppose the measure, leaving the bill short of the 60 votes needed to advance.

As a result, Republican leaders – long on the defensive against claims that they were failing to govern – appeared emboldened as they sought to cast the Democrats as the obstacle to a compromise to keep critical government functions operating.

“My Democratic colleagues’ demands on illegal immigration, at the behest of their far-left base, have crowded out all other important business,” Senate Majority Leader Mitch McConnell, R-Kentucky, said Thursday night. “And now they are threatening to crowd out the needs of veterans, military families, opioid treatment centers and every other American who relies on the federal government – all over illegal immigration.”

The Senate adjourned late Thursday night without taking a vote on the House bill. Senate Minority Leader Charles Schumer, D-New York, said Democrats remained opposed to the measure and proposed a spending extension that would last just a few days to allow talks on a broader agreement to continue.

“We have to sit down together and solve this, with the president or without,” he said.

Republican leaders rejected that suggestion. They did not lay out a Plan B to pursue if the House bill is ultimately rejected, except to blame Democrats for a shutdown.

“I ask the American people to understand this: The only people in the way of keeping the government open are Senate Democrats,” House Speaker Paul Ryan, R-Wis., said Thursday night. “Whether there is a government shutdown or not is entirely up to them.”

‘THESE ISSUES ARE NOT GOING AWAY’

Senate Republican leaders prepared to force Democrats into a series of uncomfortable votes, aimed at splitting their ranks by pitting moderates from states that Trump won against party leaders and the handful of outspoken liberals considering a run for the presidency.

For one, Republicans attached a long-term extension of the Children’s Health Insurance Program and delays to several unpopular health care taxes. The bill does not include protections for “dreamers,” immigrants brought to the United States illegally as children or who overstayed their visas as children, a top Democratic priority.

That represented an election-year bid by the Republican Party to cast the spending vote as, in part, a choice between poor children and undocumented immigrants. Ryan, McConnell and other Republicans also sought to highlight the potential erosion to military readiness that could result from a shutdown.

Emboldened Democratic leaders, meanwhile, rallied lawmakers for a showdown on what they believe is favorable ground, fighting on behalf of popular policies against an unpopular president who has had a brutal week of news coverage. As Thursday wore on, undecided senators steadily stepped forward to say that they would oppose the Republican measure – risking Republican political attacks and angry constituents.

Sens. Tim Kaine and Mark Warner, Virginia Democrats who represent tens of thousands of federal employees who stand to be furloughed during a shutdown, said they could not vote for a bill that did not include relief for dreamers, disaster funding, opioid treatment funding and more – echoing the demands of Democratic leaders.

“These issues are not going away and need to be addressed immediately,” they said in a joint statement that also criticized Trump: “He has to decide whether he wants to be president and engage in necessary compromise, or continue offering commentary from the sidelines.”

Trump fired back at Democrats during a trip to Coraopolis, Pennsylvania, saying that they’re pushing for a shutdown to distract voters from the recent tax legislation. “That is not a good subject for them, the tax cuts,” Trump said.

TWEETS INFLAME FRUSTRATIONS ON BOTH SIDES

The late-night showdown capped a long, tense day on Capitol Hill that began with a flurry of tweets from Trump that doubled down on his demands for an expensive border wall and accused Democrats of snubbing the military. Another tweet, however, seemed to upend the Republican strategy for avoiding a shutdown and contradict his administration’s stated policy position – suggesting that the children’s health program ought not to be attached to a temporary spending bill.

Republican lawmakers and aides, who were already pressed to secure enough party votes to get the bill through the House, scrambled to decipher Trump’s intentions. Much as he had to do a week ago after Trump tweeted about an intelligence bill, Ryan got on the phone with the president to clarify matters, and hours later, the White House confirmed that Trump indeed supported the bill.

The tweets inflamed frustrations in both parties over what they characterized as an all-too-often uncooperative president.

“We don’t have a reliable partner at the White House to negotiate with,” said Sen. Lindsey Graham, R-S.C. “This has turned into an s-show for no good reason.”

NATIONAL PARKS MAY REMAIN OPEN

Schumer called Trump and his administration “agents of chaos” who have foiled attempts to reach a bipartisan agreement on immigration, which remained the most salient sticking point Thursday.

“The one thing standing in our way is the unrelenting flow of chaos from the other end of Pennsylvania Avenue,” Schumer said. “It has reduced the Republicans to shambles. We barely know who to negotiate with.”

Meanwhile, Republican leaders were having trouble smoothing out a wrinkle in their plans to blame a shutdown on Democrats: Hard-line House conservatives demanded concessions in return for their votes, casting doubt on whether the funding patch would even reach the Senate.

All but a few House Democrats said they would not support the bill without an immigration or long-term budget deal.

“If we can’t agree, your party has the majority in the House and the Senate to pass your own funding resolution. But that will be a bill we cannot support,” 171 of 193 House Democrats wrote in a letter to Ryan on Thursday.

The Trump administration is drawing up plans to keep national parks and monuments open despite a shutdown as a way to blunt public anger, and while the military would not cease to operate, troops would not be paid unless Congress specifically authorizes it.

The last shutdown, in 2013, lasted for 16 days as Republicans tried unsuccessfully to force changes to the Affordable Care Act. On Jan. 30, Trump is scheduled to deliver his State of the Union address.