Affirmative action lives. That’s the emphatic message of the Supreme Court’s decision today in Fisher v. University of Texas at Austin, which found that an affirmative-action plan that considers race, among other factors, in college admissions is constitutional.

The four-to-three ruling is both surprising and important. (Justice Elena Kagan recused herself from the case.) Justice Anthony Kennedy wrote the opinion, even though he has been consistently skeptical of affirmative action during his long tenure on the Court. In the Court’s last major encounter with affirmative action, Gutter v. Bollinger, in 2003, which dealt with the admissions policy of the University of Michigan Law School, Kennedy dissented from Justice Sandra Day O’Connor’s cautious embrace of diversity as a legitimate factor for universities to consider. O’Connor was so conflicted about her own decision that she included, in effect, an expiration date of twenty-five years for any racial considerations.

Kennedy’s decision today went further than O’Connor’s, and he recognized that the benefits of diversity have no expiration date. As Kennedy wrote, “enrolling a diverse student body promotes cross-racial understanding, helps to break down racial stereotypes, and enables students to better understand persons of different races.” That will be true indefinitely. In a scathing dissenting opinion, Justice Samuel Alito made a convincing case that Kennedy had gone back on his previous views. The appropriate answer to this criticism is: So what? The Justices have often quoted a famous observation by Justice Felix Frankfurter: “Wisdom too often never comes, and so one ought not to reject it merely because it comes late.”

In this case, Kennedy’s wisdom came right on time. The practical significance of the Court’s decision is difficult to overstate. The Fisher case has been pending for eight years and was argued twice before the Court. Through all this time, the future of affirmative action has been an open and unresolved question. Kennedy has now put the issue to rest for the foreseeable future. This is a great gift to university-admissions officers, who can act with some confidence that they may consider race as one among many factors, but, more importantly, it’s a gift to their institutions. American universities, and the country, will be better off for today’s decision.

Kennedy values his place as the swing Justice on the Court, and it’s possible to see in his opinion a recognition of which way the Court is heading. The Justices are divided in much the same way the country is: four Democratic appointees, and four Republican ones. President Obama has nominated Merrick Garland to fill the vacancy left by Antonin Scalia’s death, but the Republicans in the Senate have refused even to hold hearings for him, let alone a vote. This defiance of congressional and constitutional norms is outrageous, and it’s also revealing. Mitch McConnell, the Senate Majority Leader, and his fellow-Republicans see a Presidential election slipping away from their party, and they have made the reasonable calculation that some Democrat—Obama or Hillary Clinton—will fill Scalia’s seat. So the Republicans are postponing a five-to-four Democratic majority on the Supreme Court for as long as they can. But that doesn’t make that majority any less inevitable.

Kennedy must see this, too. The four Democratic appointees have consistently embraced the notion that all institutions are strengthened, not weakened, by diverse membership (as have, for the most part, the American people). That view will surely be in ascendance in any Democrat-dominated Supreme Court. Kennedy could fight that coming wave or try to stay ahead of it. He did the latter, which both honors him and ennobles the country.

Of course, Kennedy and the rest of the Justices are human, and their views sometimes veer in unpredictable and unfortunate directions. Sadly, Kennedy also joined his fellow Republican Justices in blocking the President’s immigration plan, which would have allowed some five million undocumented immigrants who are the parents of citizens or permanent residents to apply for work permits in the United States. But the direction of the Court is clear, and on affirmative action, at least, Kennedy chose to lead the way rather than fight a losing battle from behind.