Transcript for Justice Anthony Kennedy announces his retirement

And tonight, a monumental moment for the supreme court. Today, we learned justice Anthony Kennedy is retiring from the court. Nominated by president Reagan and serving 30 years on the court, he was often the crucial swing vote. A conservative, but he also sided with the liberal justices at times, on issues including abortion and gay rights. He is now stepping down, and president trump right there in the middle will now get the chance to shake this court for at least a generation. The president offered kind words for Kennedy today, and then said the work to replace him begins immediately. And you're about to hear tonight that moment in the third debate when Donald Trump told voters what he would do with the court. Now he gets his chance. We begin tonight with ABC's Terry Moran at the supreme court. Reporter: Justice Anthony Kennedy, who for decades shaped American law and life by the simple fact that he was so often the man in the middle, left the supreme court he loves with a short letter, one he hand-delivered to the white house and addressed to "My dear Mr. President." In it, justice Kennedy expressed his "Profound gratitude fts for what he called "The privilege to seek in each case how best to know interpret and defend the constitution." He's a man that I have known for a long time, and a man that I've respected for a long time. He's been a great justice of the supreme court. Reporter: President trump also made clear he knows the stakes could not be higher here. He will now reshape the supreme court for decades with his choice of the next justice. It's always been considered a tremendously important thing. Some people think outside of, obviously, war and peace, it's the most important. Reporter: And this supreme court nomination is even more crucial than most because few justices in American history have exercised more power than Anthony Kennedy. He joined the court in 1988, appointed by Ronald Reagan. No conservative firebrand, he frequently agonized over the big decisions, but in landmark case after case, Kennedy's crucial swing vote decided major issues, defining American law and shaping American life. He co-authored the key opinion upholding roe versus wade. He upheld affirmative action for minorities in college admission. And in a remarkable series of cases over the course of almost two decades, he championed the civil rights of gay and lesbian Americans. In his 2015 ruling that legalized gay marriage in America, Kennedy wrote with deep feeling. "They ask for equal dignity in the eyes of the law the constitution grants them that right." All of that now could be up for grabs. The supreme court, a huge issue in the 2016 campaign, and the very first question in that final, consequential debate. The next president will almost certainly have at least one appointment, and likely, or possibly, two or three points, which means that you will, in effect, determine the balance of the court for what could be the next quarter century. Reporter: The candidates were asked where they want the court to take the country. I think when we talk about the supreme court, it really raises the central issue in this election. Namely, what kind of country are we going to be? The supreme court, it's what it's all about. Our country is so, so -- it's just so imperative that we have the right justices. Reporter: As president, trump has already picked one justice, Neil Gorsuch. That's already paid off, Gorsuch casting a key vote this week upholding the trump travel ban. And now, the president will choose the replacement for Gorsuch's mentor, the man in the middle, on whom so much has been riding for so long. Let's get to Terry Moran. And just as president trump gets a chance to reshape the court, really for decades to come, it comes at a time when his own policies will be judged by the court. You and I saw it just this week. Reporter: Absolutely. The travel ban case. President trump is a chief executive who tests the system. He tests the limits of presidential power. The travel ban is just the first, because Democrats are trying to use the courts to block president trump. And so, there's almost no doubt that among the major issues that will come before this court in the coming years, the court that president trump is reshaping, is the trump presidency itself. David? Terry Moran live at the supreme court. Terry, thank you.

This transcript has been automatically generated and may not be 100% accurate.