WASHINGTON (TNS) — Justice Anthony M. Kennedy, the Supreme Court centrist who for a generation has cast the deciding vote in the biggest cases, plans to retire, giving President Donald Trump a chance to shift the court sharply to the right.

Kennedy's decision to step down, announced Wednesday, offers conservatives the opportunity they have long sought to lock in a reliable five-member conservative majority on the high court. And for them, it comes at an ideal time, since Republicans control the Senate and have voted in unison to confirm Trump's conservative court nominees.

With five solid conservatives, the justices could repeal the right to abortion, expand protections for gun owners, narrow gay rights and strengthen the president's power to arrest and deport immigrants who are here illegally.

The leading candidate to replace Kennedy is Judge Brett Kavanaugh, a staunch conservative and a former law clerk for Kennedy. He served as a top deputy to former Independent Counsel Kenneth Starr in the drive to impeach President Bill Clinton in the late 1990s. He then served as a White House lawyer for President George W. Bush, who appointed him to the U.S. Court of Appeals for the District of Columbia.

Since ascending to the high court 30 years ago, Kennedy has been its pivotal figure, splitting his votes between its conservatives and liberals in a way that has made him arguably the court's most influential justice. For years, his presence as a moderate has prevented both sides from pressing too far in one direction.

More often than not, Kennedy, an appointee of President Ronald Reagan, has sided with the conservatives. He wrote the 5-4 decision in the 2010 Citizens United case that opened the floodgates for big money to flow into political races. Earlier, he played a key role in the 5-4 decision in Bush v. Gore that ended the vote recount in Florida and preserved George W. Bush's narrow win in the presidential race of 2000.

But Kennedy also led the way for the recognition of gay rights. He spoke for the 5-4 majority in 2015 to declare that same-sex couples had a right to marry nationwide.

His departure puts into doubt the fate of the Roe vs. Wade decision and the right of pregnant women to choose abortion. Conservatives have never accepted that ruling as legitimate, and Republican lawmakers continue to pass state measures that would outlaw nearly all abortions.

In 1992, Kennedy surprised his fellow conservatives when he switched sides in a pending abortion case and joined with former Justices Sandra Day O'Connor and David Souter to uphold the right to abortion as a matter of precedent.

But if Trump and the Republican-controlled Senate appoint a solid conservative to fill Kennedy's seat, the high court could cut back on the right to an abortion or overturn it entirely.

Kennedy arrived at the court in February 1988 after a titanic battle in the Senate between Reagan and Senate Democrats led by Sens. Ted Kennedy and Joe Biden, then chairman of the Judiciary Committee. It began in June 1987 when Justice Lewis Powell, the swing vote of his era, announced his retirement.

Despite a warning from Biden, Reagan nominated Judge Robert H. Bork, a conservative who had derided the Roe decision and several of the court's key civil rights rulings. After televised hearings in September, the Senate rejected Bork on a 42-58 vote.

Reagan then chose a younger conservative, Judge Douglas Ginsburg, but Ginsburg was forced to withdraw after reports that he smoked marijuana regularly when he was a law professor. The news was especially awkward because Nancy Reagan, the president's wife, had popularized the slogan "Just Say No" in an anti-drug campaign.

The White House was shaken by the two defeats. Reagan then turned to a young lawyer he had known from Sacramento. Kennedy's father was a well-liked lobbyist at the state Capitol, and young "Tony" Kennedy had offered legal advice to then-Gov. Reagan's team on several ballot measures.

In 1975, Reagan recommended Kennedy, then just 38 years old, for a seat on the 9th Circuit Court of Appeals. And 12 years later, Reagan turned to Kennedy for the vacant Supreme Court seat. He won unanimous confirmation from the Senate.