The Maine supreme court overturned a murder sentence because a judge spoke about whether the defendant's decision to go to trial reflected on whether he held remorse.

The judge’s comments about the sentencing "conundrum" presented a problem because defendants are not supposed to be punished for exercising their constitutional right to a trial, the supreme court said.

ILLINOIS COURT ORDERS RETRIAL FOR CONVICTED CHILD MURDERER TORTURED INTO CONFESSION

The judge in 2021 imposed a sentence of 32 years — beyond the basic sentence of 25 years — based on aggravating factors, including lack of remorse.

Maine Fox News graphic

The Maine supreme court overturned a man's murder conviction amid allegations that a judge factored his decision to stand trial into his sentencing

The defendant in the case, Rayshaun Moore, was convicted of fatally stabbing a man outside a nightclub in Bangor in 2020.

SUPREME COURT REJECTS ANDRE THOMAS' CLAIMS THAT RACIST JURY LED TO UNFAIR TRIAL

The judge said he intended to be conservative about remorse as a factor, but "this is of no import because any increase in Moore's sentence for that reason is improper," Justice Catherine Connors wrote in the unanimous decision released last week.

"A fair reading of these remarks suggests that the sentencing court was — or might have been — influenced by Moore’s decision to stand trial," she wrote.

CLICK HERE TO GET THE FOX NEWS APP

Moore's conviction remains in place, and he will remain in prison while awaiting a new sentence hearing.