Supreme Court Justice Anthony Kennedy's announcement Wednesday that he would retire jolted American politics, handing Republicans a high-profile issue to energize their base for the midterm elections and infuriating Democrats who fear a Trump-packed court.

Kennedy is considered the swing vote on the high court, and President Trump will now get to cement his imprint with a second pick who could secure a conservative majority for years to come. Trump already appointed Neil Gorsuch to the court to replace the late Justice Antonin Scalia.

Trump on Wednesday said he would begin his search for a replacement immediately, and Senate Majority Leader Mitch McConnell said the Senate would vote to confirm a new justice this fall. Kennedy's retirement is effective July 31.

Liberals and conservatives alike raised the prospect that with Trump's replacement, the Supreme Court may reverse its landmark abortion-rights decision, Roe v. Wade.

Kennedy was unpopular among liberals for his positions on money in politics and, most recently, Trump's travel ban.

But he also wrote the court's decision legalizing gay marriage and supported abortion rights.

Democrats, citing the GOP's refusal to consider President Barack Obama's Supreme Court nominee in 2016, said they would try to block any appointment made before the midterm elections.

Democrats need a net gain of two seats in November to take control of the Senate; the electoral map favors Republicans.

Trump called Kennedy a "great justice" and a "man who has displayed great vision."

Trump supporters pointed to Kennedy's retirement as the latest evidence that the so-called "Never Trump" movement inside the GOP was misguided.