Edwin Eriye
Khanakorn Pianchana, a judge in Yala, shot himself in the courtroom after handing down a ruling on Friday.
Judge Khanakorn pulled out a pistol and shot himself in the chest after acquitting five defendants of murder and firearms charges that could have condemned three to death.
He was rushed to hospital where he underwent surgery for injuries said not to be life threatening.
A 25-page statement he posted on Facebook before the ugly incident shows that the case he was hearing concerned national security and was related to secret association, conspiracy and gun-law offences.
In the alleged document, he accused his superiors of trying to force him to change the verdicts to guilty.
Khanakorn contended that the evidence did not support a guilty verdict.