YALA, Thailand — The Thai judge’s verdict was not guilty, five men spared the death penalty or life imprisonment. Then the judge reached into his robes, pulled out a gun and shot himself in the courtroom.

In a 25-page manifesto that he read aloud to the courtroom on Oct. 4, Kanakorn Pianchana, a chief judge of the Yala trial court, laid out the existential dilemma that would lead him to aim a pistol at his chest and fire.

There was not enough evidence for murder convictions for the five Muslim defendants from Thailand’s insurgency-plagued deep south, he said, but his superiors were pressuring him to impose capital punishment anyway.

“My words might be as light as a bird’s feather but my heart is as heavy as a mountain,” he said as the defendants and their families looked on. “Return the verdicts to the judges. Return the justice to the people.”