A Thai judge shot himself in the chest in a court in an apparent suicide attempt following complaints about interference in a case he was presiding over.

Khanakorn Pianchana used a pistol to shoot himself in a provincial court in the city of Yala, in southern Thailand, after acquitting five men of murder and firearms charges due to lack of evidence. He underwent surgery following the incident. The Bangkok Post reported his injuries were not life-threatening.

Before the shooting a statement attributed to Khanakorn, widely distributed on social media, claimed that senior judges told him to change his verdicts in the case to guilty. This would have meant sentencing three defendants to death and two to jail.

“At this moment, other fellow judges in Courts of First Instance across the country are being treated the same way as I was. [If] I cannot keep my oath of office, I’d rather die than live without honour,” the statement said.

Khanakorn’s statement sparked concerns that senior judges in Thailand’s justice system were abusing power to get guilty verdicts delivered to suit political goals.

A spokesperson for Thailand’s Office of the Judiciary told the Bangkok Post that Khanakorn apparently shot himself because he had personal issues and was under stress.

However Piyabutr Saengkanokkul, secretary-general of the country’s Future Forward Party, said that Khanakorn had been trying to make claims about the court system public since early September.

On Saturday Workpoint News reported that Khanakorn was still being cared for in an intensive care unit in a Yala hospital.

• International suicide prevention helplines can be found at www.befrienders.org. In the UK and Ireland, Samaritans can be contacted on 116 123 or email jo@samaritans.org or jo@samaritans.ie. In the US, the National Suicide Prevention Lifeline is 1-800-273-8255. In Australia, the crisis support service Lifeline is 13 11 14.

• This article was amended on 7 October 2019 to remove an inappropriate photo.