Democrats have a rare chance to win major concessions in a U.S. Congress they do not control by taking advantage of a battle within the Republican Party over keeping the government open.
With a Friday deadline looming when most funding for federal agencies runs out, Democrats finally have some clout. But their power is strongest while the Republicans in Congress remain fractured and fighting.
The showdown with Republicans could come to a head on Thursday when Democrats are expected to press their demands to President Donald Trump at a White House meeting.
For Trump, the complex, and very public, battle over the shutdown will also be a demonstration of his ability to deliver on a central 2016 campaign promise of adding billions of dollars to the U.S. military budget. That issue is at the core of Republicans' behind-the-scenes negotiations with Democrats.
Most Republicans want a defense buildup. But many also want to limit government spending. While many Democrats also support bolstering defense, they insist on raising spending on non-defense programs too.
Democrats' top two demands include passage of legislation that has eluded them for 16 years: protecting from deportation nearly 700,000 young people known as "Dreamers," whose parents brought them illegally to the United States as children.
The Democrats also want to shore up Obamacare by reversing Trump's decision to stop monthly subsidy payments to insurance companies offering healthcare policies to lower-income people.
Democrats will enter the White House meeting knowing their support is crucial to Senate Republicans passing any spending bills. Republicans control the chamber by 52-48, but need 60 vote for passage of most spending measures.
While a partial government shutdown would keep emergency services and the military mainly operating, thousands of operations would be suspended, such as the operation of national parks.
Republicans have clear control of the House of Representatives. But a core of conservative Republicans who consistently vote against funding bills in their drive for smaller government could balk. Democrats have a history of strongly supporting stopgap funding bills, providing the cushion for victory in the Republican House.
Conservative Republicans said on Tuesday they would try to pass temporary spending bills without House Democrats' support. If so, it is unclear whether such a bill could clear the Senate, where Democratic votes are necessary to pass most bills.
There is another wild card for both parties in Thursday's meeting: Trump. Democrats will test the unpredictable president to see whether he is willing to go the bipartisan route in order to keep federal agencies running smoothly or whether he will be in a confrontational mood.
In May, angry he did not win money to build his promised wall along the border with Mexico, Trump said the United States needed a "good shutdown" to force his agenda on Congress. Just last week, he wrote on Twitter about the spending bills: "I don't see a deal."
Democrats are counting on the bipartisan Trump showing up, betting that he and fellow Republicans in Congress do not want to leave the immigration legislation, popularly known as the Dreamers Act, to fester until a March deadline, so close to the 2018 congressional election season.
Chuck Schumer, Senate minority leader, and Nancy Pelosi, House minority leader, are calculating that voters' wrath would rain down on Republicans if the government lights go out.
Republicans would blame Democrats. At a news conference last Thursday, House Speaker Paul Ryan said that if Democrats vote against the temporary spending bill because they have not won their demands, "then they will have chosen to shut the government down."
Republicans already are trying to exploit possible differences among Democrats over whether to link support for the stopgap spending bill to the immigration measure.
Democratic Senator Dianne Feinstein said she expected Democrats to vote for the government funding bill this week, telling Reuters in an interview that while it "is important to all of us" to take care of the Dreamers, "I don’t think we should shut the government down."
Senator Dick Durbin, the chamber's No. 2 Democrat, told the Washington Post last week he would oppose any spending bill if Congress had not first taken care of the Dreamers.
On Tuesday, Schumer noted there were "good negotiations" under way on the immigration measure.
This week's vote to keep the government operating on temporary funding is likely to be the first of a three-step process that could stretch to Jan. 31.
A second step would be another short-term funding bill, followed by one to fund the government through the fiscal year ending Sept. 30.
(Reporting by Richard Cowan; Additional reporting by Susan Cornwell; Edited by Damon Darlin and Peter Cooney)