WASHINGTON — Supreme Court Justice Anthony Kennedy says a willingness to change course on the bench is not an indication of weakness, but rather a sign of “fidelity to your judicial oath.”

Kennedy told a meeting of international lawyers in Washington Friday that judges must be willing to re-examine their premises. His remarks sounded like a partial explanation of his votes in two recent cases involving race, in which he uncharacteristically sided with liberal justices.

Kennedy has rarely voted to uphold racial preferences in more than 28 years on the Supreme Court. Yet he cast the crucial vote and wrote the court’s opinion in June to allow the University of Texas to consider race in admissions. He also was the decisive vote in 2015 to preserve certain kinds of housing discrimination claims.

“To re-examine your premise is not a sign of weakness of your judicial philosophy. It’s a sign of fidelity to your judicial oath,” Kennedy said at the International Bar Association meeting at which he discussed the importance of the rule of law in the United States and abroad.

He spoke with dismay about a decline in the level of civil discourse, which he termed hostile and fractious. “I’m not talking just about the elections. That’s part of it,” he said.

Kennedy is now the longest-serving justice since Antonin Scalia’s death in February.

He often sparred with Scalia over the role of foreign law in Supreme Court decisions. Scalia said it had no place at all.

“Is the Supreme Court being controlled by international institutions, international laws? No,” Kennedy said emphatically. “We’re saying we can look elsewhere to see what works, what’s just and what fits with our Constitution. … The framers wanted us to do that.”