The Supreme Court building in Washington. A battle for the future of the court is underway after Justice Anthony M. Kennedy’s announcement on Wednesday that he will retire.

WASHINGTON — A political war over replacing Justice Anthony M. Kennedy roared to life on Thursday in Washington, the start of an election-season clash over a Supreme Court retirement that will reshape the country’s judicial future.

Hours after Justice Kennedy’s announcement on Wednesday that he will step down July 31, conservative organizations were mobilizing to support the Republican-controlled Senate in a quick confirmation of a justice who would be expected to vote against the court’s liberal precedents. One group, the Judicial Crisis Network, has already started a $1 million ad campaign urging people to support the president’s choice.

Democrats and liberal advocacy organizations face enormous challenges if they hope to prevent President Trump and the Republicans from installing a conservative justice who would shift the ideological balance of the court for generations. Mr. Trump has promised to pick from a list of highly conservative jurists, and Republicans control the Senate, which can confirm the president’s choice by a simple majority.

Mr. Trump began wooing senators late Thursday night, meeting at the White House separately with three Republicans and with the three Democrats — Joe Donnelly of Indiana, Heidi Heitkamp of North Dakota and Joe Manchin III of West Virginia — who broke party ranks last year and voted to confirm Judge Neil M. Gorsuch, the president’s first Supreme Court pick.

After the meeting, Ms. Heitkamp said in a statement that she urged the president to appoint someone who is “pragmatic, fair, compassionate, committed to justice, and above politics.”

With Kennedy’s Retirement, the Supreme Court Loses Its Center

The swing vote in many decisions, Justice Anthony M. Kennedy shifted toward more conservative opinions in the final months of his 30-year justice tenure.

June 27, 2018

But the effect of Justice Kennedy’s departure has already ignited opposition from many Democratic lawmakers, party strategists and liberal activists, who vowed a fierce battle to try to preserve decades of liberal court precedents on abortion, civil rights, gay rights, affirmative action and the death penalty.

“I think it has sunk in very quickly that this is the biggest fight of them all,” said Brian Fallon, a veteran Democratic operative whose organization, Demand Justice, is leading the charge against Mr. Trump’s pick. “If we don’t succeed in this fight, Trumpism will be here for 40 years, not just four years.”

Democratic strategists say the party needs to model its resistance to the successful fight Democratic senators waged in 1987 against Judge Robert H. Bork, President Ronald Reagan’s pick for the Supreme Court. After they defeated Judge Bork, Mr. Reagan eventually settled on Justice Kennedy, who was seen as a more moderate choice.

If they can mobilize Democrats and liberals, lawmakers say they hope to demand a more moderate justice from the current president, as well.

“There are people who have had to withdraw over the years because you get information out and you question them and the public is focused on it and galvanized by it,” said Senator Amy Klobuchar, Democrat of Minnesota and a member of the Judiciary Committee.