Anthony Kennedy has held the key vote on such high-profile issues such as abortion, gay rights, guns, and voting rights.

Supreme Court Justice Anthony Kennedy has announced his retirement after holding his position for more than 30 years.

In a letter addressed to US President Donald Trump, 81-year-old Kennedy said it was “the highest of honours” to serve the Supreme Court.

“Please permit me by this letter to express my profound gratitude for having had the privilege to seek in each case how best to know, interpret, and defend the constitution and the laws that must always conform to its mandates and promises,” he wrote.

Kennedy was appointed by Ronald Reagan, and has held the key vote on such high-profile issues as abortion, affirmative action, gay rights, guns, campaign finance and voting rights.

His retirement, which will take effect at the end of July, allows Trump the chance to cement conservative control of the High Court.

Without him, the court will be split between four liberal justices who were appointed by Democratic presidents and four conservatives who were named by Republicans. Trump’s nominee is likely to give the conservatives a solid majority and will face a Senate process in which Republicans hold the slimmest majority, but Democrats can’t delay confirmation.

Trump already has a list of 25 candidates – 24 judges and Utah Senator Mike Lee – from which the White House has previously said he would choose a nominee.

“It will be somebody from that list,” Trump said, speaking at a press conference with Portuguese President Rebelo de Sousa. “Hopefully, we will pick someone who is just as outstanding.”

Trump called Kennedy “a very spectacular man” and someone who he has respected for a long time.

“He is a man who has displayed tremendous vision and tremendous heart and he will be missed,” Trump said. “He’s been a great justice for the Supreme Court.”

Trump’s first high court nominee, Justice Neil Gorsuch, was confirmed in April 2017.

Republicans currently hold a bare 51-49 majority in the Senate, although that includes the ailing Senator John McCain of Arizona.

Regardless of who replaces him, Kennedy’s departure will be a massive change for the high court, where he has been the crucial swing vote for more than a decade. He has sided with the liberal justices on gay rights and abortion rights, as well as some cases involving race, the death penalty and the rights of people held without charges at the Guantanamo Bay naval base.

He has written all the court’s major gay rights decisions, including the 2015 ruling that declared same-sex marriage is a constitutional right nationwide.

He also has been a key vote when conservatives have won major rulings on the outcome of the 2000 presidential election in favor of George W Bush, gun rights, limiting regulation of campaign money and gutting a key provision of the landmark federal Voting Rights Act.

Kennedy’s last act before announcing his retirement was voting to uphold Trump’s Muslim-majority travel ban.