The fight over President Trump’s intention to replace retiring Justice Anthony M. Kennedy, the Supreme Court’s crucial swing vote, with a reliable conservative immediately became a rallying cry for base voters of both political parties ahead of this fall’s midterm elections.

The already-ferocious nomination battle is likely to clarify the choices for voters in Senate races across the country, strategists said, and affect other contests down the ballot. And even if Republicans install a replacement for Kennedy before the November election, the debate is still likely to thrust to the forefront issues that have been largely overlooked on the campaign trail until now.

Suddenly, everything seems at stake, according to the messages party leaders delivered on Wednesday, and both parties saw an advantage in boosting voter turnout. Democrats said no less than the future of abortion rights, health care, collective bargaining and same-sex equality is in peril, while Republicans claimed a seminal opportunity to shift the high court’s ideological orientation solidly to the right for a generation or more.

“There’s nothing like a Supreme Court debate to energize partisans,” said Republican pollster Neil Newhouse. “Whatever advantage Democrats had in terms of voter energy may have just been negated . . . This is like giving our GOP base voters a shot of adrenaline.”

Democratic pollster Geoff Garin said, “The stakes for Democratic voters in this election already were extremely high, and the Supreme Court vacancy supercharges all of that.”

Midterm elections historically have been referendums on the president, and there were few indications that 2018 would be an exception. But strategists said Kennedy’s retirement will raise other issues, such as abortion or gay rights, that traditionally galvanize key blocs of activists.

Campaigning Wednesday night in Fargo, N.D., Trump declared, “Justice Kennedy’s retirement makes the issue of Senate control one of the vital issues of our time.” Electing more Republicans, he said, is “the most important thing we can do.”

Democrats have been trying to capi­tal­ize on Trump’s chronically low approval ratings with American voters overall — and especially among the well-educated suburban voters who could swing many key House races — to win the majority of seats in the House, and perhaps in the Senate, too.

Party officials now hope to use the Supreme Court vacancy as a tool to mobilize progressives, giving them a cause other than their dislike of Trump to volunteer and vote for Democratic candidates.

Whereas Trump’s first Supreme Court nominee, Neil M. Gorsuch, had a conservative record in the mold of the late justice Antonin Scalia he replaced, the president could reshape the court by nominating a staunch conservative to replace Kennedy, a moderate whose opinions determined rulings preserving Roe v. Wade and enshrining same-sex marriage.

“If there was ever any question whether the November elections would be the most important of our lifetime, Justice Kennedy’s retirement should remove all doubt,” Democratic National Committee Chairman Tom Perez said in a statement.

In remarks on the Senate floor, Minority Leader Charles E. Schumer (D-N.Y.) said, “This is the most important Supreme Court vacancy in the country in at least a generation.”

Though Trump said he would move swiftly to choose a replacement for Kennedy, Schumer and other Democrats argued that the Senate should hold off on considering his eventual nominee until after the November elections, citing similar rhetoric used by Senate Majority Leader Mitch McConnell (R-Ky.) in blocking President Barack Obama’s nominee to replace Scalia in 2016.

“Given the stakes of this seat which will determine the fate of protected constitutional rights, the American people, who are set to vote in less than four months, deserve to have their voice heard,” Sen. Kamala D. Harris (D-Calif.) said in a statement.

Democrats sought to connect Kennedy’s retirement to Tuesday’s court ruling upholding Trump’s travel ban on people from some majority-Muslim countries to scare voters about what a more conservative-leaning Supreme Court might rule.

Rep. Keith Ellison (Minn.), who is Muslim and serves as DNC deputy chair, said in a fundraising appeal that Republicans are trying to use the high court to “jam any racist, xenophobic, ugly policy down the throats of the American people.”

And Sen. Chris Murphy (D-Conn.) said this was “a red alert moment for the American people.”

“We need all hands on deck to stop the Court from taking a vicious, anti-worker, anti-women, anti-LGBT, anti-civil rights turn,” Murphy said in a statement.

Democrats may look to the 1992 elections as a model. Bill Clinton won the White House, and a number of female candidates won Senate and House seats that year, following court decisions limiting abortion rights and sexual harassment allegations against Supreme Court nominee Clarence Thomas. Now, with America well into the #MeToo movement and with the possibility that Trump nominates a justice who could be the decisive fifth vote to overturn Roe v. Wade, a new class of female Democrats are running for Congress.

But Democrats face a conundrum: The court battle motivates partisans on the left, but most of the contests that will determine control of the Senate, which votes on all judicial nominees, are taking place on treacherous terrain for their party.

Democratic senators are endangered in five states Trump won solidly in 2016 — Indiana, Missouri, Montana, West Virginia and North Dakota, where the president was campaigning Wednesday night for Rep. Kevin Cramer, the GOP Senate candidate.

Republican pollster Frank Luntz said Indiana looks to be “ground zero” for the political fight over the Supreme Court. Trump won the Hoosier State by 19 percentage points, and Sen. Joe Donnelly (D) is up for reelection there this fall.

“It’s a socially conservative state that does vote for moderate Democrats,” Luntz said of Indiana, where Mike Pence was governor before becoming vice president. “But if you don’t get behind Trump’s nominee, they will punish you. And if Donnelly does say he’ll support Trump’s nominee, he’ll have Democrats stay home in protest.”

Donnelly surely will face pressure to support Trump’s eventual nominee, as will Sens. Heidi Heitkamp (D-N.D.), Joe Manchin III (D-W.Va.), Claire McCaskill (D-Mo.) and Jon Tester (D-Mont.).

Donnelly was careful with his words on Wednesday, saying in a statement, “I will thoroughly review the record and qualifications of any nominee presented to the Senate.”

During the 2016 presidential campaign — when Scalia’s vacant Supreme Court seat hung in the balance and both Trump and Democratic nominee Hillary Clinton campaigned hard on the issue — it proved to be a more motivating factor for Trump’s supporters. Of the 21 percent of voters who considered court nominations “the most important factor” in their decisions, 56 percent voted for Trump and 41 percent for Clinton, according to exit polls.

Republican leaders have been concerned they will not be able to generate as much enthusiasm among conservative activists to counter the anti-Trump fervor on the Democratic side. Trump repeatedly has urged his crowds at rallies, “Don’t be complacent!”

But top Republican strategists are convinced the coming Supreme Court fight will pay dividends in the fall.

“Midterm elections are about base turnout,” said Corry Bliss, who runs the Congressional Leadership Fund, a group that aims to spend $100 million to keep Republican control of the House. “And there is no greater issue and no more motivating issue for our base. This just shows how important the election is.”

Scott Reed, the chief strategist for the U.S. Chamber of Commerce, which is helping to elect a number of GOP Senate candidates, concurred: “This Supreme Court opening motivates the base like nothing else and ensures an enthusiasm advantage for Team Trump.”

Key to Trump’s 2016 victory was his strong support among evangelical Christians and other social conservative voters — and key to their support was Trump’s pledge to nominate strict constructionists who oppose abortion rights to the federal bench. Now, the Supreme Court vacancy gives Republicans an issue to rally religious conservatives.

Supreme Court fights historically have been important motivators for both parties. But Luntz argued that this one will prove to be an overall advantage for Republicans because, until Kennedy’s retirement, their base did not have a strong motivation to turn out.

“The average grass-roots Republican doesn’t love Congress, and while they appreciate the president, there really wasn’t a reason to vote,” Luntz said. “Now there’s a reason — a big reason.”

Michael Scherer contributed to this report.