Image copyright Texas Lawyer Image caption Judge George Gallagher

A Texas appeals court has overturned a man's conviction after finding a judge had inappropriately electrified him in court, US media report.

Terry Lee Morris was convicted of soliciting sexual performance from a child and was sentenced to 60 years.

Judge George Gallagher ordered the bailiff to activate a stun belt sending 50,000 volts through Morris when he allegedly refused to answer questions.

The higher court found that stun belts cannot be used as punishment in court.

Mr Morris appealed his 2014 conviction alleging that his constitutional rights were violated when the judge used the belt as punishment for not answering questions properly.

The belts - used by courtrooms such as the one Tarrant County in Texas - are affixed around the legs or midsection of a suspect in court and are used to deliver a shock to the person should they become violent.

Mr Morris said he was too scared to return to court out of more electrical shocks, the Texas Eighth Court of Appeals in El Paso heard.

The appeals court ruled on 28 February that Mr Morris' shocks and removal from the court was a violation of his constitutional right to be present and confront witnesses during his trial. The decision was first reported by the Texas Lawyer news website on Tuesday.

He has now been ordered to stand for a new trial.

During the case in which Mr Morris was convicted of soliciting sexual acts from a 15-year-old girl, Judge Gallagher asked him to enter his plea of "guilty or not guilty".

When Mr Morris responded by saying he had a lawsuit against Judge Gallagher and his defence lawyer, the judge warned him that he would shock him if he did not "follow the rules", the Washington Post newspaper reported, citing court transcripts.

Mr Morris asked the judge to recuse himself because of the lawsuit when the judge directed the bailiff to shock him.

The judge ordered the defendant to be shocked two more times as Mr Morris told the court he had a history of mental illness and complained that he was being "tortured".

Mr Morris's attorney, Bill Ray, told the Texas Lawyer that he did not object to the use of the stun belt because his client was acting "like a loaded cannon ready to go off", and that he did not really believe that he was being shocked.

The appeals court said the order clarifies that no Texas judges are allowed to shock defendants for refusing to follow the court's rules of decorum.

"Never before have we seen any behaviour like this, nor do we hope to ever see such behaviour again," wrote appeals court Justice Yvonne Rodriguez.

"We must speak out against it, lest we allow practices like these to affront the very dignity of the proceedings we seek to protect and lead our courts to drift from justice into barbarism."

More on stun weapons