An upstate judge was formally reprimanded for presiding over 2,500 cases involving a bank where his brother was a member of the board, the Commission on Judicial Conduct announced Friday.

Niagara County Judge Thomas DiMillo — a judge in the Lockport City Court and Niagara Family Court — was censured by the commission for not recusing himself from 2,548 cases, from 2005 through 2016, involving Cornerstone Federal Credit Union, where his brother was variously vice president, president, first vice chairman and on the executive committee board, the commission said.

“A judge should not preside in a case where a close relative is on the board of one of the institutional parties,” commission Administrator Robert Tembeckjian said in a statement. “Even if the relative’s role is passive and the matter is uncontested, a judge’s participation, and any rulings favoring the relative’s interests, would inevitably appear to be biased.”

The commission said they didn’t find any preferential treatment given to the bank by DiMillo,  but judges are expected to recuse themselves when there is even “an appearance” of a conflict of interest, according to the commission, which ruled that the judge must recuse himself from all cases involving the bank.

DiMillo — who records show makes $200,400 a year —  claimed he didn’t know about the rule barring him from involvement where he knows someone, within six degrees, who is an officer of one of the companies in a case.

But he admitted that he should have implemented “safeguards” when he started as a judge, and he “regrets his failure to abide by the rules in this matter,” the commission’s determination said.

DiMillo’s lawyer, Joel Daniels, said:  “It was an inadvertent error on his part and he looks forward to continuing to serve the Lockport community.”