WASHINGTON (Reuters) - Supreme Court Justice Anthony Kennedy said on Wednesday he plans to retire after three decades as a pivotal vote on the highest U.S. judicial body, giving President Donald Trump an opportunity to make the court more firmly conservative.

Kennedy, who turns 82 in July and is the second-oldest justice on the nine-member court, has become one of the most consequential American jurists since joining the court in 1988 as an appointee of Republican President Ronald Reagan. A traditional conservative, he advanced gay rights, buttressed abortion rights and erased political spending limits.

His retirement, which takes effect on July 31, gives Trump a second Supreme Court appointment in his 17 months in office after the Republican president last year selected Neil Gorsuch, who has already become one of the most conservative justices.

Kennedy, mild-mannered and professorial, sometimes joined the liberal justices on key rulings, earning a reputation as the court’s “swing” vote who heartened conservatives and liberals alike, depending on the issue.

His retirement sets the stage for a major showdown in the Republican-led U.S. Senate over the confirmation of Trump’s eventual pick for the lifetime appointment to replace Kennedy, all coming before November elections in which Democrats are seeking to seize control of Congress from Trump’s Republicans.

“I’m very honored that he chose to do it during my term in office because he felt confident in me to make the right choice and carry on his great legacy,” Trump said of Kennedy at a rally in North Dakota on Wednesday night.

“We have to pick a great one. We have to pick one that’s going to be there for 40 years, 45 years,” Trump added.

Top Senate Democrat Chuck Schumer called it “the most important Supreme Court vacancy for this country in at least a generation.”

“It has been the greatest honor and privilege to serve our nation in the federal judiciary for 43 years, 30 of those years on the Supreme Court,” Kennedy said in a statement issued by the court that said his retirement was motivated by a desire to spend more time with his family. He previously served as a federal appeals court judge in California.

Trump said he would begin the selection process with a list of 25 conservative candidates.

Trump’s list was assembled with the input of conservative legal activists who also touted Gorsuch for the previous court vacancy. A person familiar with the White House nomination process said there were five front-runners on Trump’s list.

They are Brett Kavanaugh, a judge on the U.S. Court of Appeals in Washington; Thomas Hardiman of the Philadelphia-based 3rd U.S. Circuit Court of Appeals; Raymond Kethledge of the Cincinnati-based 6th U.S. Circuit Court of Appeals; Amul Thapar, who Trump named to the 6th Circuit; and Amy Coney Barrett, who Trump named to the Chicago-based 7th U.S. Circuit Court of Appeals.

While Kennedy’s replacement will not change the numerical ideological balance on the court, Trump could appoint a justice more staunchly conservative than Kennedy and less likely to occasionally side with the court’s liberal wing. The move could also mean that conservative Chief Justice John Roberts, as the most centrist of the court’s current conservatives, would become the decisive vote in certain cases.

Slideshow ( 4 images )

Trump already has left an imprint on the court, restoring its 5-4 conservative majority with the appointment of Gorsuch after the Republicans in the Senate in 2016 refused to consider former Democratic President Barack Obama’s nominee, Merrick Garland.

While Kennedy sided with conservative colleagues on many issues and authored the landmark 2010 ruling that allowed unlimited corporate spending in political campaigns, his tenure also included support for key liberal causes.

Slideshow ( 4 images )

MAJOR SOCIAL ISSUES

Without Kennedy on the bench, the high court could move to the right on major social issues including abortion, gay rights and the death penalty. Kennedy wrote the landmark 2015 ruling that legalized same-sex marriage nationwide and has backed limitations on the application of the death penalty.

Conservative activists have long dreamed of building a firmly conservative majority on the court that would push to overturn the landmark 1973 ruling in the case Roe v. Wade that legalized abortion nationwide.

Kennedy disappointed conservatives by joining Supreme Court decisions that affirmed the Roe decision, including a 1992 ruling in the case Planned Parenthood v. Casey.

The high court would take an even more dramatic ideological turn if one of the two liberal justices who have served on the court since the 1990s leaves the court, 85-year-old Ruth Bader Ginsburg or 79-year-old Stephen Breyer, and Trump was able to name a conservative replacement.

The Senate is controlled 51-49 by Trump’s fellow Republicans, meaning that if they remain unified they can overcome any Democratic opposition like that mounted against Gorsuch. Senate Republicans changed the chamber’s rules during the Gorsuch nomination battle to prevent Democrats from insisting on a 60-vote super-majority, allowing court nominees to win confirmation by a simple majority vote.

Senate Majority Leader Mitch McConnell, a Republican, said there would be a vote on Trump’s nominee “this fall,” but did not specify whether it would come before the court’s new term starts in October or before the November elections.

Schumer said it would be “the absolute height of hypocrisy” for the Senate to move forward with confirming Trump’s pick during an election year after using the 2016 election as the rationale for refusing to act on Garland.

Kennedy’s retirement was disclosed on the final day of the court’s current term, which began in October.

Kennedy on Tuesday joined the court’s four other conservatives in giving Trump a huge legal victory by upholding the Republican president’s travel ban targeting people from several Muslim-majority countries. On Wednesday, he joined his fellow conservatives in a ruling that dealt a major setback to organized labor by shutting off a key union revenue source.

Kennedy personally delivered his retirement letter to the White House on Wednesday afternoon, after he told his fellow justices of his plans.