Supreme Court Justice Anthony Kennedy announced on Wednesday that he is retiring after more than 30 years on the court, kicking off what is sure to be a vicious confirmation battle.

Kennedy informed the president of his decision, effective July 31, in a letter, which the court's spokeswoman said he personally delivered to the White House on Wednesday afternoon.

Chief Justice John Roberts had adjourned the court for its summer recess just hours earlier.

ADVERTISEMENT

"It has been the greatest honor and privilege to serve our nation in the federal judiciary for 43 years, 30 of those on the Supreme Court," Kennedy said in a statement.

Kennedy added that while his family was willing for him to continue to serve, his decision to step aside was based on his deep desire to spend more time with them.

Kennedy, who turns 82 in July, is the court’s longest-serving member and second-oldest justice after its leading liberal, Ruth Bader Ginsburg, who is 85.

Speculation that Kennedy was thinking about retiring started circling last term and gained steam this year. Some Republicans on Capitol Hill even claimed it was a definite, while others urged him to announce as soon as possible to give the GOP time to confirm his replacement before the midterm elections in November.

Nominated by former President Reagan and confirmed in 1988, Kennedy has made a name for himself as a moderate and pivotal swing vote on the court.

During his tenure, he sided with liberals to advance LGBT rights, save ObamaCare and limit the death penalty while voting with the conservative wing to protect religious liberty and limit campaign finance laws.

Democrats and liberals, still angry with Republicans’ refusal to hold a confirmation hearing or vote on Merrick Garland Merrick Brian GarlandPoll: 59 percent think president elected in November should name next Supreme Court justice Mark Kelly: Arizona Senate race winner should be sworn in 'promptly' Chief justice honors Ginsburg: 'When she spoke, people listened' MORE, former President Obama’s nominee to replace the late Justice Antonin Scalia, are sure to put up at fight, but they have little leverage.

Republicans changed Senate rules last year to get Trump’s nominee for Scalia’s seat, Neil Gorsuch, confirmed, lowering the threshold to advance Supreme Court nominations to a simple majority vote.

Trump has already crafted a short list of candidates in the event of an opening, and each prospective nominee would likely shift the ideological balance of the court even further to the right for decades to come.

Supreme Court vacancies have become a key voting issue. In a CNN exit poll, 70 percent of 2016 voters said the Supreme Court was an important factor in their vote — and Trump won 49 percent of those voters.

Trump touted Gorsuch as one of his greatest achievements for months after he was confirmed.

Earlier this month, Demand Justice, a liberal legal group, launched a digital ad campaign attacking Trump's prospective nominees in the event of a vacancy just to get a leg up in the inevitable fight.

The retirement is sad news for liberals, who had hoped that Kennedy would — as Ginsburg has vowed — remain on the job as long as physically possible.

“Personally, as the justice I clerked for, I just can’t imagine the Supreme Court without him,” said Daniel Epps, an associate professor of law at the Washington University School of Law. “But as a citizen with my own views of and preferences for the law, I also want him to stay because I think he’s likely to reach better decisions than whoever will likely replace him.”

Epps doubts the court will see another justice like Kennedy, who routinely votes against his party bloc, now that groups like the conservative Federalist Society are active in the judicial vetting process.

Kennedy’s ascension to the bench was unique.

The Sacramento, Calif., native got the nod after Reagan’s first nominee, Judge Robert Bork, was rejected by the Senate, and his second nominee, Judge Douglas Ginsburg, was pressured to withdraw his name after admitting he had smoked marijuana several times.

Looking for a moderate who could sail through confirmation, Reagan tapped Kennedy, then a judge on the U.S. Court of Appeals for the 9th Circuit.

Epps said it’s unlikely a GOP president would appoint another moderate in the future.

“Even when [Sandra Day] O’Connor was on the court, he was often in the middle,” Epps said. “It’s an enviable position to write the opinions you want to write. People on either side will assign you the decision to retain your vote.”

It was a position that paid off: Kennedy is leaving behind a stack of blockbuster rulings.

Perhaps most notably, in 2015, he cast the deciding vote in a case that legalized same-sex marriage nationwide.

In the majority opinion, Kennedy said same-sex couples respect the idea of marriage so deeply they seek to find its fulfillment for themselves.

“Their hope is not to be condemned to live in loneliness, excluded from one of civilization’s oldest institutions,” he wrote. “They ask for equal dignity in the eyes of the law. The Constitution grants them that right.”

The ruling followed his decision in 2003 to strike down a Texas sodomy law and the decision he authored in 1995, which struck down an amendment to Colorado’s Constitution that prevented state and local governments from protecting LGBT people from discrimination.

Kennedy also joined the liberals in 2008, casting the deciding vote in Boumediene v. Bush, a case that gave prisoners at Guantanamo Bay the right to challenge their detention.

Kennedy is also known for siding with the conservatives in the 2010 landmark ruling in Citizens United v. Federal Election Commission. In a 5-4 split, the court struck down limits on corporate campaign contributions.

And earlier this month, he ruled, albeit narrowly, for a Colorado baker who refused to make a cake for a same-sex wedding. Kennedy said Colorado’s Civil Rights Commission had treated the baker unfairly when it first heard his argument that his cakes are an artistic expression of speech and religion protected by the First Amendment.

Kennedy said these types of disputes “must be resolved with tolerance, without undue disrespect to sincere religious beliefs, and without subjecting gay persons to indignities when they seek goods and services in an open market.”

Despite his impact, Kennedy’s former law clerks note what he’s given up by staying on the court well into his golden years.

According to the court’s public information office, Kennedy missed two decision days this month to give commencement speeches at high school graduations for two of his grandchildren, whom clerks say he adores.

Sam Erman, an associate professor at the University of Southern California Gould School of Law who clerked for Kennedy in the 2010–2011 term, said Kennedy was a wonderful boss who cared passionately about the law and his role within the judiciary.

“As a justice, it was obvious that he wanted to get the case right and wanted to be sure that he'd thought broadly about the material and arguments,” he said.

Jamil Jaffer, a former clerk for Gorsuch who founded the National Security Institute at George Mason University’s Antonin Scalia Law School, said Kennedy is well-respected because he listens to the arguments and tries to think through the case.

“He may come out in a place different than where you thought he might end up as a result, and I think the justices themselves listen to him when he asks questions at oral argument,” he said.

“He’s one of the leading thinkers on the court.”

Updated at 2:56 p.m.