WASHINGTON — Democratic senators running for re-election in red states where President Donald Trump remains popular face an agonizing choice over his coming Supreme Court nominee: Vote to confirm the pick and risk demoralizing Democratic voters ahead of the midterm elections, or stick with the party and possibly sacrifice their own seats — and any chance at a Democratic majority in 2019.

The actions of a handful of Senate Democrats struggling to hold their seats in those states — notably Heidi Heitkamp of North Dakota, Joe Donnelly of Indiana and Joe Manchin of West Virginia — will have broad implications for the party at a critical political juncture.

A decision by one or all of them to try to bolster their standing with Republican-leaning voters in their states by backing the president’s nominee would undermine Democratic leaders as they try to sustain party unity. And if their votes put the president’s choice on the court, it could hasten the move to the left by the party’s aggressive activist core, while intensifying the clamor for new, more confrontational leadership.

But if they hold together on a “no” vote, those senators could not only surrender their own seats, but by expanding the Republican majority, they could also narrow the path of Democrats to a Senate majority for years to come by ceding those states to Republicans.

“It is a terrible vote,” Jennifer Duffy, a longtime nonpartisan analyst of Senate races for the Cook Political Report, said about the showdown, which will escalate Monday with the scheduled official announcement of the nominee.

It could not come at a worse time. A final confirmation vote will probably be called just weeks before an election in which Democrats are defending a sprawling battleground, including 10 states carried by Trump, with Democratic pickup opportunities in only a handful of states. A failure to hang on to nearly all 10 would make a Senate takeover very difficult.

The situation is complicated by the fact that Republicans last year denied Democrats the ability to filibuster a Supreme Court candidate, a tool that would have enabled the most vulnerable Democrats to side with the president even as the rest of the party held the line against the nominee and satisfied anxious liberal voters.

In the run-up to his announcement, Trump has sought to intensify the pressure on Democrats who are on the ballot in Republican-leaning states.

“You deserve a senator who doesn’t just talk like he’s from Montana,” Trump said Thursday night during a combative stop in Great Falls, Montana, as he assailed Jon Tester, the conservative state’s two-term Democrat. “You deserve a senator who actually votes like he’s from Montana.”

The president delivered a nearly identical attack on Heitkamp a week earlier in Fargo, North Dakota, in what appears destined to become a stock line as Trump visits Senate battlegrounds.

Much of the attention has been focused on Heitkamp, Manchin and Donnelly because they broke with their party last year and backed Neil Gorsuch, Trump’s first nominee to the court, showing their willingness to get behind the president’s choices. Trump racked up huge margins in their states and still draws enthusiastic crowds.

But other Democratic incumbents need to be wary as well, including Sen. Bill Nelson of Florida, who is in a difficult re-election fight with Rick Scott, the Republican governor. Nelson will need the support of Republican and independent voters to prevail, but also that of Democratic voters in Florida’s urban centers.

Another endangered Democratic incumbent, Sen. Claire McCaskill of Missouri, is viewed as highly unlikely to back any Trump nominee despite the political risk. And if Trump selects Judge Raymond Kethledge of Michigan, it could present difficulties for Sen. Debbie Stabenow, D-Mich., who is seeking her fourth term in a state carried narrowly by Trump two years ago though she has so far escaped formidable competition.

As they plot strategy for the coming weeks, top Democrats and their allies are focused initially on holding Senate Democrats together to put most of the court pressure on two Republican senators, Susan Collins of Maine and Lisa Murkowski of Alaska, who are centrist abortion-rights advocates. Democrats believe that quick signs of any defections in their party could relieve that pressure on the two Republicans while simultaneously frustrating Democratic voters.

“It is very important that we send a signal out of the gate that this is a winnable fight,” said Brian Fallon, the head of a new Democratic judicial advocacy group called Demand Justice. “By throwing in the towel before there was an opportunity to really pressure the pro-choice Republicans, you would have a sense of deflation among progressives that is the last thing you should want going into the midterms.”

The Democratic leader, Sen. Chuck Schumer of New York, is facing calls from activist groups to keep his party in line, and he and his team are intent on doing so. But that does not mean he will want embattled incumbents to yield their seats if the nominee is ultimately going to be confirmed with Republican votes. At the same time, Republican and conservative groups have initiated campaigns in select states trying to establish the president’s coming choice as unobjectionable, while urging supportive calls to Senate offices. They will also try to make any resistance seem the work of far-left activists.

“Radical Left Takes the Reins,” shouted a headline over a release from the office of Sen. Mitch McConnell, R-Ky., the majority leader. “Radical Groups Demand Absolute Resistance Against Yet-to-Be-Named SCOTUS Nominee, Senate Democrats Comply With ‘Unwavering Opposition.'”

The Democrats under scrutiny have had little to say so far about their intentions as they await the identity of the nominee.

“Like my colleagues, I’ll wait to see who he nominates for the position — and then get to work exhaustively reviewing and vetting the nominee and their record to meet my constitutional duty as a U.S. senator to provide advice and consent for filling this vacancy,” Heitkamp said after a White House meeting with the president the day after he had attacked her back home in Fargo.

Tester chose to ignore the president’s assault and instead emphasized his bipartisan credentials.

“Jon’s record is clear — if it’s good for Montana, Jon works with anyone from either party to get things done,” his campaign said in a statement following the Trump rally.

That approach reflects what Democrats believe is a potential backstop for the embattled red-state Democrats. Politicians like Heitkamp, Manchin and Tester have well-established identities in their home states and remain popular with voters of both parties. They hope that relationship, built over years of campaigns, could sustain them should they break with the president.

Other issues are also at work. The new trade war could have negative consequences for agriculture in a farm state like North Dakota, driving down allegiance to Trump. It was no coincidence that Heitkamp in the past week held multiple meetings across her state on trade and a new farm bill — two issues with direct impact on voters.

In addition, Democrats proved they could remain united against the president on the tax bill and on repealing the Affordable Care Act, two past instances that were also seen as carrying big political risks. Party strategists say if they can make health care a cornerstone of the Supreme Court fight, it could embolden the red-state Democrats to push back against the White House.

But Republicans have a history of elevating the Supreme Court above all else, given its influence on major social policy such as abortion, immigration, education, voting rights and the environment.

"For Republicans, the Supreme Court is their biggest voting issue,” said Duffy, the Senate elections analyst. “What this does is it wakes up the base.”

For Democrats, the test will be whether they can mount a strong challenge to the nominee that satisfies their voters without exacting too high a cost from their most endangered lawmakers.