WASHINGTON — Lawmakers remained deadlocked Thursday night as lawmakers nudged closer to a Friday deadline the Senate’s vote to avert a government shutdown.

The Senate adjourned Thursday night unable to agree when to vote on a stopgap measure to keep the government open.

The impasse adds pressure on Republican leadership and Democrats, who are using the threat of a government shutdown to force Republicans to make a deal to extend protections for undocumented immigrants who arrived in the U.S. as young children, reauthorize a children’s health insurance program and boost spending caps.

Earlier in the evening, the House passed Congress’ fourth temporary funding bill since September, which would keep the government funded through Feb. 16. But, as party leaders traded barbs on the Senate floor, a shutdown seemed ever more likely.

Senate leaders had sought a Thursday night vote on the bill, which Democrats expected to defeat, but they could not get unanimous consent to proceed.

In the partisan blame game ahead of a possible shutdown, each side accused the other of hurting the military. The immigration controversy over a program known as Deferred Action for Childhood Arrivals has entangled talks to raise statutory budget caps and pass overdue 2018 federal spending legislation for the military and the rest of government.

Republicans have insisted that Democrats are putting undocumented immigrants ahead of the military by holding out for an agreement to codify in law the Obama administration’s DACA program.

“My Democratic colleagues’ demand on illegal immigration at the behest of their far-left base have crowded out all other important business, crowded it all out,” Senate Majority Leader Mitch McConnell, R-Ky., said in a floor debate late Thursday.

“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.”

Senate Minority Leader Chuck Schumer, D-N.Y., countered by reading a statement from Pentagon spokeswoman Dana White, which called CRs “wasteful and destructive” and called for a fully funded fiscal 2018 budget on DoD’s behalf.

“Just ask [Defense] Secretary [Jim] Mattis if this is what he would prefer we do, another continuing resolution or an honest-to-goodness budget that allows our Defense Department to plan ahead and meet their obligations,” Schumer said. “We all know he would prefer the latter.”

Democrats have repeatedly accused Republicans, who control the White House and both chambers of Congress, of disarray, saying President Trump has been a wobbly negotiating partner.

“How can you negotiate when the president, who has to sign the legislation, is like a sphinx on this issue, or says one thing one day and one thing the next?” Schumer said.

Earlier, the House passed the stopgap continuing resolution, 230-197, with six Democrats voting “yes” and 11 Republicans voting “no.”

That CR gained needed votes from the conservative Freedom Caucus after the chamber’s GOP leaders promised a future vote on a stand-alone defense appropriations bill.

Senate Republicans have not been in lockstep either. Sens. Rand Paul and Lindsey Graham, or Kentucky and South Carolina, respectively, have said they plan to vote against the CR for various reasons.

Sen. Jerry Moran, R-Kan., has not stated his position on a 30-day CR, but he has supported a shorter alternative.

Sen. Mike Rounds, R-S.D., initially opposed a 30-day CR, but he has reportedly changed positions.

Graham, who is both pro-defense and a player in DACA negotiations, is arguing the path to a long-term defense boost is to make a bipartisan deal for DACA recipients.

“The American people want us to deal with BOTH issues sooner rather than later,” Graham said in a statement Thursday.

In the lower chamber, Rep. Rob Wittman, R-Va., chairman of the House Armed Services seapower subcommittee, voted against the CR, citing the damage that unstable funding wreaks on the military.

“The key is, does this 30 days give all sides enough ability to negotiate a deal they can agree upon with DACA — and if not, aren’t we in the same place?” Wittman said. “I think [House GOP] leadership did exactly what they need to do, but I just don’t see the path ahead from here.”

The agreement between House GOP leadership and the House Freedom Caucus was for a House vote on defense appropriations within the next few weeks and an internal vote count on an immigration bill crafted by House conservatives.

The defense vote would likely provide an opportunity for House Republicans to publicly convey their support for the military and force a tough vote on Democrats, who are demanding a dollar-for-dollar match in nondefense discretionary spending. However, it faces uncertain prospects in the Senate, where Republicans have a razor-thin majority.

Even if the Senate GOP’s leadership were to bring it to a vote, the proposal is “dead on arrival” there, according to the HASC’s top Democrat, Washington Rep. Adam Smith, because Democrats would be needed to pass it.

“To ignore that [no-defense] portion of the budget is completely irresponsible,” Smith said.