(CNN) As he announced a major Supreme Court ruling recently, Anthony Kennedy spoke so fervently about free speech and the power of the Internet, he seemed ready to spring from his black leather chair on the justices' elevated bench.

It was a fleeting but quintessential Kennedy moment as the court was finishing its annual session, a term defined to a large extent by Kennedy's key vote, along with attention to whether he might retire.

The case demonstrated Kennedy's crucial role, as he won a majority for a June 19 decision heralding the Internet's "vast potential to alter how we think, express ourselves, and define who we want to be." It also revealed perhaps why the 80-year-old, longest-serving sitting justice has not given up his black robe.

He lives for this.

Kennedy was in the majority on closely decided cases more than any other justice this term. In several opinions, he wrote passionately, invoking such favored terms as democracy and destiny.

If nothing causes him to reverse course and step down, he could play an influential role in the resolution of a challenge to President Donald Trump's travel ban involving six predominantly Muslim countries. He could cast the deciding vote in two other high-profile disputes on the upcoming calendar: one testing whether the Wisconsin state legislature unconstitutionally gerrymandered voting districts to favor Republicans, the other whether the Christian owner of a Colorado bakery may refuse to make a wedding cake for a gay couple.

Kennedy has authored the Court's major gay rights cases dating to 1996. Two years ago, he cast the decisive vote and wrote the opinion declaring a right to same-sex marriage.

First Amendment cases particularly inspire Kennedy. His majority opinion striking down a North Carolina law that prohibited registered sex offenders' access to the Web was so expansive that three justices who agreed with his bottom-line judgment declined to sign his opinion.

Justice Samuel Alito, joined by Chief Justice John Roberts and Justice Clarence Thomas, deemed Kennedy's rhetoric "undisciplined" and "unnecessary." They criticized him for being "unable to resist musings" that likened the Internet to streets and other public places and that could prevent states from restricting sexual predators from any Internet sites.

Photos: Supreme Court Justice Anthony Kennedy Anthony Kennedy, the longest-serving member of the current Supreme Court, has announced that he will be retiring at the end of July. Kennedy, 81, was appointed by President Ronald Reagan in 1988. He is a conservative justice but has provided crucial swing votes in many cases. Hide Caption 1 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy was born in Sacramento, California, on July 23, 1936. In this photo, circa 1939, he sits between his mother, Gladys, and his sister, Nancy. Hide Caption 2 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy wears his Cub Scout uniform as he poses with his brother, Tim, circa 1946. Hide Caption 3 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy, third from right in the front row, stands with other Cub Scouts in the 1940s. Hide Caption 4 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy, right, spent time with the California Army National Guard after finishing law school in 1961. The man on the left, John J. Hamlyn Jr., also became a lawyer like Kennedy. Hide Caption 5 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy, right, and Hamlyn pose for a photo after basic training. Hide Caption 6 of 38 Photos: Supreme Court Justice Anthony Kennedy After more than a decade as a lawyer, Kennedy became a judge on the US Court of Appeals in 1975. He was nominated by President Gerald Ford on the recommendation of California Gov. Ronald Reagan. Hide Caption 7 of 38 Photos: Supreme Court Justice Anthony Kennedy This courtroom photo of Kennedy was taken in 1976. Hide Caption 8 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy has breakfast with his wife, Mary, and his son Gregory in 1984. Hide Caption 9 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy and his wife walk together in Sacramento, California, in 1987. Hide Caption 10 of 38 Photos: Supreme Court Justice Anthony Kennedy From 1965 to 1988, Kennedy was also a professor of constitutional law at the University of the Pacific's McGeorge School of Law. Hide Caption 11 of 38 Photos: Supreme Court Justice Anthony Kennedy In 1987, Kennedy was nominated by President Reagan to fill the Supreme Court seat vacated by Lewis Powell's retirement. The nomination came after the confirmation failures of nominees Robert Bork and Douglas Ginsburg. Hide Caption 12 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy, center, talks with US Sens. Ted Kennedy, left, and Joe Biden before a confirmation hearing in Washington. The two Kennedys are not related. Hide Caption 13 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy meets with President Reagan in the Oval Office. Hide Caption 14 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy is joined by his wife as he is sworn in by Chief Justice William Rehnquist on February 18, 1988. Reagan is on the right. Hide Caption 15 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy, top right, appears in a formal Supreme Court portrait in April 1988. In the front row, from left, are Thurgood Marshall, William Brennan Jr., Chief Justice William Rehnquist, Byron White and and Harry Blackmun. In the back row, from left, are Antonin Scalia, John Paul Stevens, Sandra Day O'Connor and Kennedy. Hide Caption 16 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy speaks at the McGeorge School of Law in 1991. He delivered the inaugural address in a lecture series named for the late Archie Hefner, whose portrait is behind Kennedy. Hefner was a prominent Sacramento attorney active in numerous civic and charitable groups. He died in 1988. Hide Caption 17 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy is on the far right in this Supreme Court portrait from 1998. In the front row, from left, are Antonin Scalia, John Paul Stevens, Chief Justice William Rehnquist, Sandra Day O'Connor and Kennedy. In the back row, from left, are Ruth Bader Ginsburg, David Souter, Clarence Thomas and Stephen Breyer. Hide Caption 18 of 38 Photos: Supreme Court Justice Anthony Kennedy In 2004, Kennedy speaks to high school students at the Ronald Reagan Presidential Library in Simi Valley, California. Hide Caption 19 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy speaks during a Senate subcommittee hearing in 2002. Hide Caption 20 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy discusses the court's budget requests with a House committee in April 2005. Hide Caption 21 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy participates in a panel discussion in Washington in November 2005. Hide Caption 22 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy receives an honorary degree at New York University in May 2006. Hide Caption 23 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy delivers the commencement address at New York University. Hide Caption 24 of 38 Photos: Supreme Court Justice Anthony Kennedy In February 2007, Kennedy testifies at a Senate committee hearing on judicial security and independence. Hide Caption 25 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy testifies before a House subcommittee in March 2007. He and fellow Justice Clarence Thomas spoke about concerns with the ongoing remodeling of the court building, the reduction of paperwork due to electronic media, and the disparity of pay between federal judges and lawyers working in the private sector. Hide Caption 26 of 38 Photos: Supreme Court Justice Anthony Kennedy The Supreme Court meets with President Barack Obama and Vice President Joe Biden in September 2009. From left are Samuel Alito, Ruth Bader Ginsburg, Kennedy, John Paul Stevens, Chief Justice John Roberts, Obama, Sonia Sotomayor, Biden, Antonin Scalia, Clarence Thomas, Stephen Breyer and retired Justice David Souter. Hide Caption 27 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy leaves after a Catholic Mass in Washington in October 2009. Hide Caption 28 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy joins the President and other officials at a memorial for the victims of a shooting in Tucson, Arizona, in 2011. Hide Caption 29 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy smiles as he is introduced to faculty members at the University of Pennsylvania Law School in October 2013. Kennedy was teaching there for a week. Hide Caption 30 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy is saluted by sailors as he tours the USS John C. Stennis in 2015. Hide Caption 31 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy testifies about a Supreme Court budget request during a House subcommittee meeting in 2015. Hide Caption 32 of 38 Photos: Supreme Court Justice Anthony Kennedy President Obama greets Kennedy and other Supreme Court justices before his final State of the Union address in January 2016. Hide Caption 33 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy, second from left, joins other Supreme Court justices in February 2017 during President Donald Trump's first address to a joint session of Congress. Hide Caption 34 of 38 Photos: Supreme Court Justice Anthony Kennedy As President Trump looks on, Kennedy administers the judicial oath to new Justice Neil Gorsuch in April 2017. Hide Caption 35 of 38 Photos: Supreme Court Justice Anthony Kennedy Kennedy and Trump walk together after Gorsuch's swearing-in ceremony. Hide Caption 36 of 38 Photos: Supreme Court Justice Anthony Kennedy Trump stands with the Supreme Court at Gorsuch's formal investiture ceremony in June 2017. From left are Elena Kagan, Samuel Alito, Ruth Bader Ginsburg, Kennedy, Chief Justice John Roberts, Trump, Gorsuch, Clarence Thomas, Stephen Breyer and Sonia Sotomayor. Hide Caption 37 of 38 Photos: Supreme Court Justice Anthony Kennedy Several members of the Supreme Court pose for a portrait before taking part in a procession to mark Harvard Law School's bicentennial in October 2017. On the top row, from left, are Kennedy, Roberts, Breyer and Gorsuch. In front of them are Kagan and retired Supreme Court Justice David Souter. Hide Caption 38 of 38

Overall, in the full run of cases, not just the handful that come down to 5-4 votes, the Sacramento native appointed by President Ronald Reagan in 1988 votes more on the right than left.

Yet, in the more contentious, ideologically charged social dilemmas, his vote can be unpredictable, and therefore up for grabs during negotiations with colleagues. He's usually the linchpin when the left side of the bench -- Justices Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor, Elena Kagan -- wins out.

That was demonstrated when he cast the key vote in a March case that would allow judges to delve into the usually secretive deliberations of a jury to safeguard against racial bias. Kennedy opened his opinion in Pena-Rodriguez v. Colorado with lofty language about the twelve men and women drawn from a community to decide a defendant's guilt or innocence: "The jury is a central foundation of our justice system and our democracy ... a tangible implementation of the principle that the law comes from the people."

Keeping everyone guessing

At the columned Supreme Court building, Justice Kennedy works in a tidy, well-organized office with a view of the Capitol across the street. On his desk is a Black's law dictionary and little else. The artwork recalls his California roots: a bronze horse sculpture by Thomas Holland and a California grapes painting by Edwin Deakin.

When it comes to decisions, whether on cases or his future plans, he is more complicated.

Kennedy has navigated a narrow ideological path at the center of the court. He has shifted to the left more in recent years, such as to support abortion rights and racial affirmative action on campus. He still keeps his colleagues and outside legal analysts guessing where he might come down in a dispute.

It was that way in recent months on the retirement watch.

Kennedy, who will turn 81 in July, had told friends and family he was weighing when to step down. Trump administration lawyers, eager for another chance to shape the court, following the April appointment of Justice Neil Gorsuch, were ready to seize another vacancy.

A Kennedy retirement would let Trump appoint a more rigid conservative justice and change the court's makeup for a generation or more. The chances for liberal justices to prevail in close cases -- as they did several times this session -- would plunge.

Kennedy kept his thoughts private. Even as recently as last weekend, some of his former law clerks who attended a reunion with him said a slight chance seemed to exist that he would leave this June rather than next.

That speculation ended as the term closed this week with no retirement statement.

Kennedy's flair for the dramatic suggests that when he does step down, perhaps next year, he would want to make an announcement while the justices are sitting and the court in session.

Kennedy did not respond to an interview request for this story.

Behind the scenes, Kennedy is a go-to justice not only regarding the substance of rulings. He is often at the center of efforts to work out compromises in thorny cases and lower tensions among colleagues.

And in another sign of his standing, justices say that after the nine have met privately and voted on cases, and Roberts has begun the delicate matter of who will author which decision, the chief confers first with one justice: Kennedy.