
149 Ill. App.3d 327 (1986)
500 N.E.2d 602
THE PEOPLE OF THE STATE OF ILLINOIS, Plaintiff-Appellee,
v.
RAYMOND D. RAINEY, Defendant-Appellant.
No. 4-86-0018.
Illinois Appellate Court  Fourth District.
Opinion filed October 31, 1986.
Daniel D. Yuhas and John J. Hanlon, both of State Appellate Defender's Office, of Springfield, for appellant.
Tim P. Olson, State's Attorney, of Jacksonville (Kenneth R. Boyle, Robert J. Biderman, and Gwendolyn Klingler, all of State's Attorneys Appellate Prosecutor's Office, of counsel), for the People.
Reversed and remanded.
*328 JUSTICE WEBBER delivered the opinion of the court:
Defendant was found guilty at a bench trial in the circuit court of Morgan County of the offense of aggravated criminal sexual assault in violation of section 12-14(b)(1) of the Criminal Code of 1961 (Ill. Rev. Stat. 1985, ch. 38 par. 12-14(b)(1)). He was sentenced to 30 years' imprisonment.
Defendant has raised a variety of issues on appeal. However, since we have concluded that he was denied the effective assistance of counsel and is thus entitled to a new trial, we need not deal with many of them. Likewise, we need not enter into a prolonged explication of the facts.
Briefly stated, the evidence at trial showed that defendant lived in a trailer at Jacksonville with Patricia Shubert and her three children, one of whom was the victim and was age 12 years at the time of the offense. Shubert left the trailer to visit a friend on July 24, 1985, at about 3:30 p.m. Defendant and the three children remained in the trailer. About 20 minutes later defendant and two of the children came to the place where Shubert was visiting and defendant stated to her that something was wrong with the victim, who had fled the trailer in a state of tears.
Shubert sought out the victim, who told her that defendant had raped her. At trial the victim described the acts performed by defendant which included throwing her against a wall and then onto a bed and placing something inside her vagina. An emergency-room physician who examined the victim at about 4:30 p.m. on the same date testified that in his opinion the victim recently had had "forceful vaginal intercourse." Police officers testified as to conversations with the victim and defendant.
Testimony for defendant came from an Illinois State Police forensic scientist. Her evidence was that, based upon various tests which were made, defendant was probably not the perpetrator.
Our examination of the record leads us to the same conclusion as that made by the trial court, that is, defendant was the perpetrator of the offense. However, of much greater significance is the mental capacity of defendant. Therefore, a resume of the evidence and the procedures employed on this matter are in order.
Prior to trial defense counsel moved for a mental examination of defendant. The motion alleged counsel's belief, based upon several interviews with his client, that defendant was not fit to stand trial and that he was legally insane, or at least mentally ill, at the time of the offense. The trial court allowed the motion and a clinical psychologist was appointed to examine defendant.
*329 Her report stated her belief that defendant, while possessing intellectual shortcomings, was fit to stand trial. The report further indicated that he was not legally insane at the time of the offense but was "mentally ill" at that time. She confirmed her report at a fitness hearing held immediately prior to the bench trial.
The trial was then held with the evidence as outlined above. No evidence concerning defendant's mental condition was introduced at the trial. At the conclusion of the bench trial the court found defendant guilty but noted that "at this time the court is not making any ruling or making any consideration concerning the affirmative defense of insanity or any alternative finding of guilty but mentally ill."
A sentencing hearing was conducted on January 7, 1986. In mitigation defendant tendered the testimony of the same psychologist who had testified at the fitness hearing. According to her defendant suffered from "substantial disorder of thought, mood or behavior which impaired his judgment" both at the time of the offense and when she interviewed him. Her conclusion was that he was mentally ill at those times.
Based on this testimony, defense counsel asked the court to amend its finding to guilty but mentally ill in accordance with section 115-3(c) of the Code of Criminal Procedure of 1963 (Ill. Rev. Stat. 1985, ch. 38, par. 115-3(c)). In argument defense counsel stated:
"Your Honor, as I understand this kind of evidence, for Mr. Rainey to have offered this during the course of the trial it would have been an admission that he had committed the acts but was mentally ill at the time that they occurred. Mr. Rainey has denied that the acts occurred, and continues to do so, not able to offer that evidence at the time of trial, and the only time it can be brought before the Court is now. I, I don't think that there's any signifiant difference, Your Honor, other than in the sentencing disposition as to whether the Defendant is found guilty or guilty but mentally ill. My feeling is  and I think based on Doctor Moriearty's testimony that the Defendant was then and is now mentally ill, and that it would be appropriate for the Court to make such a finding that he is guilty but mentally ill of the offense of which he is charged."
The court declined to alter its finding, stating:
"The Court is going to rule at this time, be the Court right or wrong, that the question of guilty but mentally ill or that sort of a finding or judgment is not now available to the Court. Just so the record will be complete for appeal, I think that the testimony of Doctor Moriearty, both today for the purposes of *330 the sentencing hearing, and at the fitness hearing prior to trial, assuming that that would have been the evidence at trial, that the Court could and perhaps almost would have to find that the Defendant was guilty but mentally ill based upon that testimony, assuming that the Defendant was also found guilty. In other words, if the matter, the defense of insanity had been raised, and that kind of evidence had been presented at trial, the Court would have found the Defendant was not insane at the time of the crime, that the State had proved that the Defendant was guilty beyond all reasonable doubt, and that the Defendant was, at the time of the crime, mentally ill. And, therefore, the Court making all those assumptions would have found the Defendant guilty but mentally ill."
 1 We agree with the trial court that there was no basis upon which he could legally change his finding. The statute's opening words contain a clear predicate: "When the defendant has asserted a defense of insanity, the court may find the defendant guilty but mentally ill if, * * *." (Ill. Rev. Stat. 1985, ch. 38, par. 115-3(c).) The defense of insanity was not asserted at trial in the instant case. It was claimed as a condition precedent to a fitness hearing and as a matter in mitigation at the sentencing hearing, but these proceedings are not a "trial" within the ambit of the statute.
 2 We turn next to the critical issue in this case, that is, whether defendant was denied the effective assistance of counsel. In our judgment defense counsel was ineffective to the extent that the result would have been otherwise, had he rendered effective assistance.
As has been indicated, counsel was of the notion that by injecting the defense of insanity he would have been admitting the commission of the acts. This is not the law. In People v. Ford (1968), 39 Ill.2d 318, 321, 235 N.E.2d 576, 578, the supreme court said, "There is no reason why defendant may not deny commission of the crime and also raise the affirmative defense of insanity." Counsel's error becomes even more egregious when the language of the statute is considered:
"[M]ental illness is not an affirmative defense, but an alternative plea or finding that may be accepted, under appropriate evidence, when the affirmative defense of insanity is raised or the plea of guilty but mentally ill is made." Ill. Rev. Stat. 1985, ch. 38, par. 6-4.
The standard for judging counsel's performance was enunciated in Strickland v. Washington (1984), 466 U.S. 668, 80 L.Ed.2d 674, 104 S.Ct. 2052, and adopted by our supreme court in People v. Barnard (1984), 104 Ill.2d 218, 470 N.E.2d 1005. In general terms, the standard *331 is one of reasonableness. An error by counsel, even a professionally unreasonable one, does not warrant setting aside the judgment in a criminal case if the error had no effect on the judgment. Any deficiency in counsel's performance must be prejudicial to the defense in order to constitute ineffective assistance.
In the instant case, it is clear that the error did affect the judgment and was prejudicial. The trial judge stated that if the proper evidence had been placed before him at trial, he would have found defendant guilty but mentally ill. Moreover, the evidence was readily available to the defense. It had been produced at the fitness hearing and was reiterated at the sentencing hearing. This is not a case of newly discovered evidence.
Nor can it be said that this is a case of trial tactics as was seen in People v. Testa (1983), 114 Ill. App.3d 695, 449 N.E.2d 164. In that case counsel argued at the sentencing hearing that he had not introduced insanity during the trial as a matter of trial strategy, but the appellate court found no basis upon which to allow an alteration of the prior finding of guilty to guilty but mentally ill. A similar result ensued in another case involving the same defendant but after a jury trial. People v. Testa (1984), 125 Ill. App.3d 1039, 466 N.E.2d 1126.
Rather, in this case, we have the frank admission of defense counsel that he had misconstrued the law. This might not have led to a reduced sentence for defendant, but at a minimum it deprived him of the treatment provided in section 5-2-6 of the Unified Code of Corrections (Ill. Rev. Stat. 1985, ch. 38, par. 1005-2-6).
 3 In closing we note one error which is unlikely to occur at retrial. At sentencing the trial court received a victim-impact statement (Ill. Rev. Stat. 1985, ch. 38, par. 1401 et seq.) which was prepared by Bonnie Shubert, the victim's mother. It also allowed testimony from Shubert. The victim gave competent and coherent testimony at trial. There is nothing to indicate that her condition deteriorated so drastically in the 29-day interval between trial and sentencing that she was unable to prepare the statement and testify. It was error to permit the mother to prepare the statement and testify as "the * * * parent * * * of any person granted rights under this Act who is physically or mentally incapable of exercising such rights." Ill. Rev. Stat. 1985, ch. 38, par. 1403(a)(3).
Reversed and remanded for new trial.
MORTHLAND and SPITZ, JJ., concur.
