For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

Justice Anthony Kennedy is retiring after serving 30 years on the Supreme Court. The announcement gives President Donald Trump the opportunity to nominate the second Supreme Court justice of his presidency and sets up an epic political fight over Kennedy’s replacement. Republicans are likely to push for a quick confirmation hearing before November’s midterm elections, when there is a possibility of Democrats regaining control of the Senate.

Kennedy wrote a letter to Trump on Wednesday announcing his intention to retire effective July 31.

Appointed in 1988 by President Ronald Reagan, Kennedy has been the court’s least ideological conservative for a number of years, voting with the liberal justices in 5-4 decisions more often than any other conservative justice. His role as a swing voter has made him the court’s most powerful justice, with Supreme Court advocates tailoring oral arguments specifically to try to win his favor.

His votes with liberals on everything from same-sex marriage to abortion to banning the execution of intellectually disabled defendants have occasionally prompted conservatives to attack him as a sellout. As far back as 2005, then-House Majority Leader Tom DeLay (R-Texas), a conservative, publicly denounced Kennedy as an activist justice whose opinions reflected his isolation from ordinary Americans. “We’ve got Justice Kennedy writing decisions based upon international law, not the Constitution of the United States? That’s just outrageous,” DeLay told Fox News Radio. “And not only that, but he said in session that he does his own research on the internet? That is just incredibly outrageous.”

Conservatives have been urging Kennedy to get out of the way so that Trump can appoint his replacement, preferably before the midterm elections in November. They would like someone more reliably conservative than Kennedy, in the mold of Justice Neil Gorsuch, a former Kennedy clerk whom Trump nominated to the court 11 days into his presidency. In a not-so-subtle message to Kennedy, the president’s daughter, Ivanka Trump, even made a trip to the Supreme Court with her daughter and observed oral arguments as Kennedy’s guest.

Liberals, meanwhile, have been channeling anguished pleas to the California-born justice to hang on to protect his legacy. Most notably, the New York Times editorial board in April published a lengthy letter to Kennedy begging, “Please don’t go.” The Times noted that he was an “equal-opportunity disappointer”—he joined the conservative majority in landmark cases such as Citizens United, the controversial 2010 decision that opened the door to unlimited corporate contributions to political campaigns. Nonetheless, the Times implored Kennedy to think about his legacy on a few important cases where he pushed the court in the direction of civil liberties, abortion rights, and protections for LGBT people—a record that culminated in the historic Obergefell decision legalizing same-sex marriage nationwide in 2015.

Kennedy’s decision to retire gives Trump the opportunity to move the court farther to the right. He’s been angling for the opportunity for many months, randomly releasing an updated “short list” of 25 potential nominees in November. Among the leading contenders to replace Kennedy is Brett Kavanaugh, a former Kennedy clerk and judge on the DC Circuit Court of Appeals, a court that has been the stepping stone for three sitting Supreme Court justices. Appointed by President George W. Bush, Kavanaugh earned his spot on the DC Circuit after working for Ken Starr investigating President Bill Clinton’s relationship with intern Monica Lewinsky and preparing an impeachment case against Clinton. At 53, Kavanaugh is, like Gorsuch, young enough to influence the court for decades to come.