San Diego  Along with a black robe, Judge John Einhorn often wore a serious — maybe even stern — expression when he presided over cases in San Diego Superior Court.

It was a look that matched the gravity of many matters handled in his courtroom, from home invasions to murders. And those who know him best said it reflected the focus he brought to each role he’s played in the field of law: prosecutor, defense lawyer, civil attorney, judge.

“I’ve done everything,” Einhorn said last week in his courtroom chambers, where mementos from his long career had been pulled from the shelves and tucked into boxes.

“Doing criminal cases as a judge has been the most fascinating,” he said. “Every time I think I’ve seen everything, I haven’t.”

Einhorn, 70, will retire at the end of this month, after 18 years on the bench and 28 years as a trial lawyer. In that time, he’s handled many high-profile cases, including the death-penalty trial of Brandon Wilson, who killed a 9-year-old boy in an Oceanside restroom, and the Bird Rock Bandits case in which five young men were charged in the beating death of a La Jolla surfer.

But the decision to retire wasn’t an easy one for Einhorn, though it might have been a necessity when earlier this year his work took a toll on his health. While presiding over yet another death penalty case — this one projected to be the longest criminal trial in county history — he unexpectedly stepped aside in March.

“I was encouraged by a number of doctors to stop that case right then because of health reasons,” Einhorn said, declining to get into the specifics. “I usually don’t follow doctors’ advice, but I was outnumbered.”

He was replaced by another judge on that case, which involved two defendants charged with leading a violent drug-trafficking gang called “Los Palillos,” but he continued to handle other matters in his busy courtroom.

“I was exhausted every night,” Einhorn said, who had already presided over two cases related to Los Palillos since early last year. He said the prospect of handling a yearlong trial, followed by two other related death penalty cases, was too much.

“Would I still be a judge but for that case? Probably,” he said. “I thought I’d stay on the bench until I had to be carried out. I couldn’t think of anything I’d rather do.”

Nevertheless, he’s moving on. Einhorn said he’d like to go into teaching or turn his energy toward philanthropy.

A graduate of the University of California Berkeley and Loyola University School of law in Los Angeles, Einhorn was appointed to the bench in 1995 by then-Gov. Pete Wilson. He’s become a well-respected jurist with a reputation for putting long-winded lawyers in check if they try the jury’s patience as well as his own.

“He’s a no-nonsense guy,” said Superior Court Judge Peter Deddeh, who said Einhorn reserves his dry sense of humor for when he’s off the bench. “I think he runs a very tight courtroom. “He wants to give everybody their say, but he wants to move the case along, too.”