
625 P.2d 44 (1981)
The STATE of Montana, Plaintiff and Respondent,
v.
Bryan Lantis MERCER, Defendant and Appellant.
No. 80-48.
Supreme Court of Montana.
Submitted November 10, 1980.
Decided March 4, 1981.
*46 McKinley Anderson argued, Bozeman, for appellant.
Mike Greely, Atty. Gen., Helena, Mark Murphy argued, Asst. Atty. Gen., Helena, Donald E. White argued, County Atty., Bozeman, for respondent.
SHEA, Justice.
Bryan Lantis Mercer appeals his conviction for aggravated assault following a jury trial in the Gallatin County District Court. He was sentenced to 20 years for assault, to be served consecutively with a previous homicide sentence. The court classified him as a dangerous offender and ordered him ineligible for parole. On appeal, defendant raises several issues relating to the validity of his confession, his mental state at the time of the offense, and the nature of his sentence. We affirm.
Kennita Shew, a school teacher from Salt Lake City, arrived in Bozeman on July 15, 1979, to attend a workshop on the Montana State University campus. As she was unloading personal belongings from her car in a university dormitory parking lot, someone approached her from behind, stabbed her in the back, laughed aloud, and ran away. Ms. Shew did not clearly see her assailant. At approximately 9:00 p.m., the Bozeman City Police Department received word of the assault. Upon arriving at the campus, the officers learned that Ms. Shew had suffered a wound in the left side of her back. It appeared that the wound had been caused by a knife.
Bryan Mercer was convicted by a jury in January 1972, of second degree murder in Sanders County and sentenced to 50 years in the state prison. Based on favorable reports from psychologists and prison officials, Mercer was granted a school furlough to attend Montana State University in March 1978. In February 1979, he was granted parole status.
On July 18, 1979, Mercer was arrested on a parole violation warrant for an alleged knife assault on another woman, Elizabeth O'Connell. Sgt. Ron Cutting of the Gallatin County Sheriff's Office was assigned to investigate that case. Cutting and Mercer knew each other previously. Cutting had participated in the homicide investigation that led to Mercer's 1972 conviction for the violent murder of one of the defendant's high school friends.
The investigation of the sheriff's office into the assault on Ms. O'Connell and the investigation of the Bozeman police into the attack on Ms. Shew converged on July 18, 1979. Police Sgt. Connor of Bozeman learned that Sgt. Cutting had scheduled an interview with Mercer. Because of the similarity of the two incidents under investigation, Connor requested to be present. At that time, Connor questioned the defendant about his whereabouts on the day of the attack on Ms. Shew. Mercer maintained that on the day he was at the A & W stand where he was employed and then picked up his wife at Safeway where she worked.
Between July 18 and 29, 1979, Cutting met several times with defendant. For the most part, their conversations were informal and off the record. It was primarily Mercer who initiated these meetings. Apparently because of their past acquaintance, the defendant was comfortable talking to Cutting. On July 23, Mercer requested that Cutting keep him informed regarding the police investigation in the Shew case. Cutting agreed to do so. On the same day, Cutting asked the city police how their investigation was going. Cutting then told Mercer that he was still a suspect and that the police had been unable to verify his alibi. Shortly thereafter, Mercer asked whether he would be able to negotiate directly with someone from the county attorney's office about possible charges if he were to confess to the crime and if he would recover the knife for the authorities. Cutting agreed to contact the county attorney's *47 office. On July 27, defendant stated to Cutting that he knew he had a "problem" and asked whether he could get medical help if he agreed to confess. Cutting told him that was a matter for the county attorney's office. On July 28, Cutting contacted Deputy County Attorney Dunbar, who agreed to talk to the defendant. On July 29, Dunbar, accompanied by Deputy County Attorney Mike Lilly, interviewed Mercer. With Dunbar and Lilly as witnesses, Mercer confessed to the stabbing. Mercer then showed police where he hid the knife with which he assaulted Ms. Shew.
After defendant Mercer was charged, and after hearing a motion to suppress the confession, the District Court ruled that the defendant's confession was voluntary and admissible at trial. At trial, Dunbar assisted the county attorney in the trial of defendant. Deputy County Attorney Lilly was a witness for the prosecution.
Defendant's assignments of error revolve largely around his confession. He contends that the confession should have been suppressed because he was not given the Miranda warnings, because he was not afforded counsel at the time of his initial questioning by Sgt. Cutting, and because the confession was involuntary by reason of defendant's mental illness.
The trial record shows that defendant was read the Miranda warnings on at least two occasions. Both Sgt. Connor and Sgt. Cutting testified that Cutting read defendant the Miranda warnings at the time of the officer's first interrogation of the defendant on July 18. According to the testimony given by Dunbar at the suppression hearing, and by Lilly at trial, Dunbar read the Miranda warnings to defendant on July 29 before the accused made any incriminating statements. Mercer stated that he understood those rights. He then signed a written waiver.
Miranda v. Arizona (1966), 384 U.S. 436, 86 S.Ct. 1602, 16 L.Ed.2d 694, declared inadmissible all incriminating statements made by persons in custody without prior warning and waiver of their right to counsel. The right to counsel and the constitutional right to self-incrimination attach at such time as the police investigation shifts from a general investigation of an unsolved crime to focus on the defendant. State v. Lucero (1968), 151 Mont. 531, 537, 445 P.2d 731, 734.
The State fully concedes that Mercer had a right to counsel at the time of any in-custody interrogation. The real inquiry is whether defendant knowingly and voluntarily waived that right. Miranda, supra, makes clear that the role of counsel during in-custody interrogation is to effectuate the right against self-incrimination. The question of waiver is inextricably interwoven with the question of the voluntariness of the accused's confession. This is especially true where, as here, the accused alleged incapacity due to mental illness. Accordingly, the right to counsel issue and the voluntariness issue will be discussed together.
The defendant contends that he was so mentally ill as to preclude a voluntary and knowing waiver of his constitutional rights and so as to render him incapable of making a voluntary confession. Further, he alleges that Deputy County Attorney Dunbar induced the confession by informing defendant both verbally and in writing that he would do everything possible to insure that the defendant received medical treatment at Warm Springs for his mental illness.
Whether a confession should have been suppressed depends on whether it was voluntary. State v. Lenon (1977), 174 Mont. 264, 570 P.2d 901, 906; Brown v. Illinois (1975), 422 U.S. 590, 604, 95 S.Ct. 2254, 2262, 45 L.Ed.2d 416. Whether a confession was voluntary depends on the "totality of the circumstances" of the particular case. State v. Blakney, (1979), Mont., 605 P.2d 1093, 1096; State v. Grimestad (1979), Mont., 598 P.2d 198, 202; State v. Lenon, supra.
The evidence supports the trial court determination that the defendant's confession was voluntary. There was expert testimony at trial that the defendant's mental *48 disorder was purely episodic and that he acted and thought as a normal person when he was not suffering from an attack of mental illness. There is no evidence that the defendant was suffering from such a bout of mental illness at the time of his confession. The deputy county attorneys who witnessed the confession testified that Mercer was articulate, calm and coherent. The evidence tends to show that the defendant was sane at the time of the confession and therefore, that he was able to waive both his right to counsel and right against self-incrimination.
There is no evidence that the deputy county attorneys downplayed the importance of the Miranda rights, nor that they employed any psychological pressures or inducements in order to induce the confession. Nor did they attempt to convince the defendant that his problem was medical rather than criminal. It was the defendant who, without prompting, claimed that he was in need of psychiatric help. It was defendant who requested to speak to someone from the county attorney's office and who requested psychiatric help. In response to defendant's inquiries, Dunbar agreed to recommend that the defendant be sentenced to a treatment facility only after informing the defendant that he could not make any promises as he could not control the District Court's decision. There is no evidence that Dunbar offered to assist only if the defendant confessed. In summary, the evidence shows that the defendant was sane at the time of making his confession, that Miranda warnings were given to the defendant before the confession, that the defendant was capable of understanding the warnings, that the defendant waived his rights to counsel and against self-incrimination knowingly and voluntarily, and that he was not improperly induced into confession.
Because of both deputy county attorneys involvement in the confession process, the defendant next claims that Deputy County Attorney Lilly was an incompetent trial witness and he claims that Deputy County Attorney Dunbar should not have been allowed to aid in the prosecution of the case at trial.
We do not, however, find any prosecutorial misconduct. It was the defendant who called both Dunbar and Lilly to testify at the suppression hearing on August 20, 1979. Both were endorsed upon the information on the same date following a formal motion supported by an affidavit and hearing at which defendant made no objection. Defendant was on notice that Dunbar would be the chief prosecutor. Dunbar signed both the information and the motion for leave and affidavit of probable cause; he also submitted a brief opposing defendant's consolidated pretrial motions.
There was a separation of the functions of witness and prosecutor. Lilly, the witness at trial, never performed any duty as a prosecutor. Dunbar, the prosecutor, never testified before the jury. Defendant did not object to Dunbar acting as prosecutor until after Lilly had commenced testifying  at a time when Dunbar had already served as prosecutor.
It is well-settled that a prosecutor is competent as witness even though he is prosecuting the case against the defendant. People v. Hauschel (Colo. App. 1975), 550 P.2d 876; State v. Hayes (Mo. 1971), 473 S.W.2d 688, 691; People v. Stokley (1968), 266 Cal. App.2d 930, 72 Cal. Rptr. 513, cert. den. 395 U.S. 914, 89 S.Ct. 1761, 23 L.Ed.2d 227; Rules 601(a), M.R.Evid.; See generally, Annot. "Prosecuting Attorney As a Witness in Criminal Case," 54 A.L.R.3d 100, 110-114 (1973). However, numerous courts have disapproved of the practice. See, e.g., People v. Thomas (1976), 38 Ill. App.3d 685, 348 N.E.2d 282, 284; People v. Guerrero (1975), 47 Cal. App.3d 441, 120 Cal. Rptr. 732; State v. Hayes (Mo. 1971), 473 S.W.2d 688; State v. Griffith (1971), 94 Idaho 76, 481 P.2d 34. For a jury might give far greater weight to the evidence of the prosecuting attorney than to that of the ordinary witness. See, e.g., Robinson v. United States (8th Cir.1928), 32 F.2d 505; see also, Rule 403, M.R.Evid. The credibility of a prosecutor-witness is subject to attack on the ground that he represents the prosecution. *49 People v. Mann (1963), 27 Ill.2d 135, 188 N.E.2d 665, cert. den. 374 U.S. 855, 83 S.Ct. 1923, 10 L.Ed.2d 1075; Chessman v. Teets (9th Cir.1956), 239 F.2d 205, vacated on other grounds, 354 U.S. 156, 77 S.Ct. 1127, 1 L.Ed.2d 1253; People v. White (1911), 251 Ill. 67, 95 N.E. 1036. Here, Lilly did not prosecute the case against the defendant. His role was confined to that of a witness. We see no impropriety. A prosecutor need not disqualify himself as a witness where he does not participate as trial counsel. See, State v. Martinez (1976), 89 N.M. 729, 557 P.2d 578, 580-81, cert. den. 430 U.S. 973, 97 S.Ct. 1663, 52 L.Ed.2d 367.
Ordinarily a prosecutor should withdraw from a case when he testifies for the prosecution. People ex rel. Younger v. Superior Court (1978), 86 Cal. App.3d 180, 150 Cal. Rptr. 156; State v. King (Iowa 1977), 256 N.W.2d 1. But that rule of automatic disqualification does not apply when the defense calls the prosecutor as a witness. People v. Arabadjis (1978), 93 Misc.2d 826, 403 N.Y.S.2d 674; Galarowicz v. Ward (1951), 119 Utah 611, 620, 230 P.2d 576, 580; Chessman v. Teets, supra. Here, it was the defense who called Dunbar to testify at the suppression hearing. Therefore, the rule of automatic disqualification does not apply. Otherwise, a defendant could indiscriminately disqualify any prosecutor he wished by merely calling him as a witness.
Due to the separate functions that Lilly and Dunbar performed at trial, we hold that there was no prosecutorial misconduct. See, Martinez, supra; People v. Hauschel, supra.
The defendant's final two contentions relate to his alleged mental illness. First, he claims essentially that the record contains no substantial evidence that would justify the jury in finding that he was sane when he attacked Kennita Shew. Second, he claims that his sentence to the state prison violates the constitutional ban on cruel and unusual punishment under the federal and the state constitutions.
The defendant spends several pages of his brief discussing whether mental disease is still an affirmative defense in Montana and whether it must be proved by the State or by the accused. But we need not delve into those arguments. For it is clear that the court's instructions to the jury did not prejudice the defendant.
In 1979, the legislature amended section 46-14-101, MCA, by eliminating the definition of mental disease or defect, excluding responsibility. Defendant argues, however, that the question of mental defect was still a pertinent inquiry for the jury because mental illness can preclude a defendant from forming the mental state requisite to the crime charged. At trial, the State and the court agreed that the legislature intended to allow a jury to consider mental disease and defect as it related to mental state. Therefore, the trial court instructed the jury that it could not convict the defendant if the evidence showed him to be suffering from a "substantial impairment" rendering him incapable of recognizing the criminal character of his conduct.
In line with this instruction, the court instructed the jury that the mental state of either "purposely" or "knowingly" is an element of the offense. The court also fully informed the jury of the State's burden of proving every element of the crime beyond a reasonable doubt. The jury was also instructed that, in determining whether the mental state requisite to the commission of the offense had been proved beyond a reasonable doubt, it could consider testimony regarding the presence and the nature of any mental disease or defect from which the defendant claimed to be suffering at the time of the crime. Finally, the trial court instructed the jury to read the instructions as a whole. Therefore, the jury knew that the State had the burden of proving beyond a reasonable doubt that the defendant was sane and capable of acting purposely or knowingly at the time of the crime.
The evidence supports the jury's determination that the defendant was sane at the time he attacked Ms. Shew. Expert testimony established that defendant suffers from an untreatable mental disorder *50 which prevents him from conforming his behavior to social norms. But the same expert testimony claimed that defendant's mental disorder was episodic. When not under the influence of an "attack" or "seizure", defendant was normal. The psychiatric testimony did not establish whether defendant was suffering from an episode of mental illness at the time of his assault on Ms. Shew.
The State never conceded that defendant had a mental disease or defect. Although both Dr. Prunty, a psychiatrist, and Dr. Seitz, a psychologist, testified that the defendant was afflicted with paranoid schizophrenia, the State introduced evidence that the defendant could have gained knowledge of psychological testing during his study at MSU, could lie, and may have been faking the test results. The State also showed defendant had not sought counseling at the MSU campus. Further, the State established that defendant's story about another being taking control of his body, began only when the investigation of this case began to center on him, although his mental disease had purportedly been going on for many years. The prosecution also showed the defendant had the presence of mind to hide the knife used in the assault and attempted to construct an alibi wish of a co-worker, Leila Galinkin. At trial, the defendant testified at length about events surrounding the attack, showing no loss of memory. The record supports a conclusion that substantial evidence supports the jury verdict.
The defendant next contends that sentencing a man suffering from severe mental illness to prison violates the constitutional ban against cruel and unusual punishment as well as section 53-21-101(1), MCA.
Under section 46-14-311, MCA, whenever a defendant is convicted of an offense and claims that at the time of commission he was suffering from a mental disease or defect which rendered him incapable of conforming his conduct to the requirements of law, the sentencing judge is to consider all relevant evidence of the defendant's mental disorder. If the judge finds that the defendant did not suffer from mental illness at the time of the offense, he must sentence the defendant as he would any other convicted person  according to the guidelines set forth in Title 46, Chapter 18. Section 46-14-312, MCA. If the sentencing judge finds that the defendant was suffering from a mental disorder at the time of the crime, he must sentence the defendant to be committed to Warm Springs. Section 46-14-312, MCA.
In his findings of fact and conclusions of law, the sentencing judge found that "the defendant was in full possession of his mental capacity and not suffering from mental disease or defect which would render him incapable of appreciating the criminality of his conduct or the ability to conform his conduct to the requirements of law." The judge concluded that it was necessary for the protection of society that the defendant be sentenced to the Montana State Prison at Deer Lodge for 20 years and that the defendant was a dangerous offender. Neither judge nor jury found the defendant insane or in need of psychiatric treatment. The judge did, however, adopt the conclusions of Drs. Prunty and Seitz who had conducted an extensive psychological and psychiatric examination of the defendant. In their opinion, the defendant was not susceptible to any kind of psychological or psychiatric treatment and was likely to commit other violent crimes in the future.
The statutory scheme of Title 46, Chapter 14, dealing with the mental competency of criminal defendants, does not prescribe special rules for sentencing a defendant who was sane at the time of his crime, but who may be insane at other times. Nevertheless, the defendant's suggestion that he is to be dealt under the provisions of Title 53, Chapter 21, MCA, dealing with the treatment of the seriously ill, is misplaced. Title 53, Chapter 21, MCA, deals only with civil commitment of the mentally ill. The legislature has enacted separate laws to deal with mental illness in the criminal context. See generally, Title 46, Chapter 14.
*51 Defendant cites no authority and we find none, holding that imprisonment rather than medical treatment of a person such as the defendant who claims to be insane, but has not been so adjudicated, constitutes cruel and unusual punishment. The defendant was sentenced and classified as a dangerous offender based only on his past criminal behavior and his propensity for antisocial conduct. If, however, the court had determined that the defendant were mentally deranged but sentenced him nevertheless to a penal institution without providing for adequate treatment, the defendant may have had grounds to argue that the sentence violated constitutional prohibitions against cruel and unusual punishment. See, People v. Feagley (1975), 14 Cal.3d 338, 121 Cal. Rptr. 509, 535 P.2d 373.
Under the circumstances, the defendant has not shown any statutory or constitutional violation.
The judgment of the District Court is affirmed.
HASWELL, C.J., and DALY, HARRISON and SHEEHY, JJ., concur.
