A 57-year-old judge presiding over a case in court had a medical emergency and dies while on the bench.

Putman County Court Judge James Reitz, was in his courtroom Friday morning when he was stricken. Court officers performed CPR and used a defibrillator to try to resuscitate him before he was taken to a hospital, the Associated Press reported.

He died shortly after arriving at the hospital, said Lucian Chalfen, a spokesman for the state court system.

Reitz lived in Mahopac and was a county judge since 2007. He was also an acting justice with the state Supreme Court, the Journal News reported. He previously worked as a lawyer in private practice.

State Sen. Terrence Murphy, who represents Putnam County, called Reitz “a giant” in a Facebook post, and said his legacy will be his Drug Court Program, which “should be a model for New York State.”

“Judge Reitz was the ultimate public servant,” Murphy said.