SOUTH BEND, Indiana — Supreme Court Justice Clarence Thomas on Thursday criticized some in the judiciary for veering into the role of legislators and politicians, saying it is not the role of judges to make policy or to base decisions on their personal feelings or religious beliefs.

Speaking at the University of Notre Dame, Thomas said judges “venturing into areas we should not have entered into” is part of why the nomination process, particularly for federal judges with lifetime appointments like himself, is so contentious.

“The court was thought to be the least dangerous branch and we may have become the most dangerous,” Thomas said. “And I think that’s problematic.”

He did not cite any specific examples.

Thomas is the most senior justice on a court that grew more conservative under President Donald Trump, who placed three justices on the court. His speech Thursday is at the alma mater of his newest colleague on the court, Amy Coney Barrett, who graduated from Notre Dame Law School and served on the faculty there.

Thursday’s speech at the Catholic university by Thomas, a Catholic, was delivered two weeks after he was among the majority in the Supreme Court’s 5-4 vote to deny an emergency appeal of a new Texas law banning most abortions. The court suggested it was not their last word on the matter. The law is the biggest restriction of abortion rights since the court’s landmark 1973 Roe v. Wade decision that women have a constitutional right to abortion, and supporters of abortion rights say it’s evidence Roe v. Wade could be threatened.

Thomas has called on the court to overturn the landmark Roe v. Wade decision that extended abortion rights across the country, and he was one of four justices who would have overturned Roe in a 1992 decision, during his first term on the court.

The Catholic church opposes abortion. Asked Thursday if there have been times when he had to resolve legal questions that conflict with his Catholic faith, Thomas said it has not been a problem for him. He said some cases were very hard, particularly early on in his career, but added “that’s not the role of a judge.”

“You do your job and you go cry alone,” he said.

Thomas was accused of sexual harassment by former employee Anita Hill during his own bruising 1991 confirmation hearing — charges he denied.

On Thursday, he said “the craziness” during his confirmation was the result of the politicization of the judiciary, saying “it was absolutely about abortion, a matter I had not thought deeply about at the time.”

At one point during the lecture three protesters stood and yelled “I still believe Anita Hill.” They were escorted out of the auditorium without incident; the crowd then stood and applauded.

Thursday’s lecture was a rare public speech by Thomas, who typically shies away from public speaking. He is known for going years without asking questions during arguments before the Supreme Court, unlike his colleagues, though during the pandemic Thomas has asked questions at every one of the telephone arguments.

Thomas acknowledged his reticence, telling the crowd that years ago the late Justice Antonin Scalia, a fellow conservative, “told me I should get out on the road and fly the flag.”

“He was more of an extrovert than I am,” Thomas said. “I’m quite content not to get out on the road.”