WASHINGTON — Republicans have largely backed President Donald Trump’s war in Iran even as it spiked gas prices and doomed them in the midterm elections, but now they’re negotiating with Democrats over putting limits on the war in order to avoid a government shutdown next week.

Democrats have said they want any bill to fund federal agencies after a Dec. 11 deadline to defund the war, and bipartisan negotiations are ongoing. Both parties are eager to avoid a shutdown ahead of the Christmas holiday.

“We’re talking to Democrats, talking to the administration about some language that would be agreeable regarding Iran,” Sen. John Hoeven (R-N.D.) told HuffPost on Wednesday.

Combat veteran Sen. Tammy Duckworth (D-Ill.) has led negotiations for Democrats along with Sens. Tim Kaine (D-Va.) and Jeff Merkley (D-Ore.). The group has been working on language that would disallow offensive operations against Iran in an amendment to an upcoming spending bill. Such language would presumably block Trump from carrying out further strikes against Iran, which he has intermittently threatened to do for months, while allowing the continuation of “defensive” operations.

“There’s not strong opposition to it,” Duckworth told HuffPost during a briefing with reporters. “I think both sides want to get to a place where we can actually implement this language because it’s for the benefit of the American people.”

Republicans still mostly support the war, but striking a deal with Democrats could help unlock some of their priorities, including funding for the Defense Department and the Federal Aviation Administration, or even a farm policy bill.

“It’s going to bring down gas prices if we open up the Strait of Hormuz,” Duckworth said, explaining why Republicans should like to make a deal. “It’s going to allow us to rebuild our military readiness. It’s going to take care of our military men and women, and we can start to do things like repairing and rebuilding our vessels, which are so far overextended right now.”

Democrats have previously signaled openness to money for replacing munitions used in the Iran and Ukraine wars.

“Part of the question here is whether there are some provisions for some replacement of munitions, and if there were, how much and what kind of munitions?” Sen. Chris Van Hollen (D-Md.), who said he has been involved in the talks, told HuffPost.

Van Hollen suggested at the outset of his unsuccessful bid for majority leader that Democrats should risk shutting down the government to try to force the Trump administration to end the war. Most Senate Democrats seem to view a shutdown over the holidays, and potentially at the outset of a new Democratic Congress next year, as a bad idea.

“If we shut down the government, but we’re not cutting off funding for the war, then what are we actually doing?” Sen. Ruben Gallego (D-Ariz.) told HuffPost.

Senate Majority Leader John Thune (R-S.D.) told reporters this week that Iran war restrictions could present a “landing spot” for lawmakers to avoid a shutdown.

“We have gotten more openness on this from the Republican side than we might have thought,” Kaine said.

The White House did not respond to a request for comment.

One potential hangup could be whether the Trump administration is allowed to maintain its naval blockade against Iran, which Duckworth said is an act of war and wouldn’t count as defensive under her amendment. She said the military could still conduct naval operations near Iran.

“It does not stop naval operations to escort both military and civilian vessels through the Strait of Hormuz,” Duckworth said. “They can still conduct freedom of navigation operations. They can still conduct operations if they see that Iran is trying to further mine the strait. They can. Those will be defensive operations.”

Despite the war’s massive unpopularity — and its contribution to Democrats’ huge midterm victories — it’s unlikely Republicans or the administration would agree to a full shutdown of the conflict, even with significant policy concessions.

“Whatever we put together, we have to be able to keep the pressure on Iran,” Hoeven said. “But there’s a lot of things you can do. You can identify that funding is going to go for munitions. You can identify reporting requirements. There’s a lot of things we can agree on, but as far as us being in a position of strength and ending the conflict from a position of strength is very important as far as we’re concerned.”