If a defense of insanity or mental illness has been presented during a trial, the court shall provide the jury with a special verdict form of "guilty but mentally ill" for each offense. The court shall instruct the jury that a special verdict of "guilty but mentally ill" may be returned instead of a general verdict. The court shall also instruct the jury that the special verdict requires a finding beyond a reasonable doubt by the jury that the defendant committed the offense but that he was mentally ill at the time he committed the offense.
SDCL 23A-25-13