
561 P.2d 1256 (1977)
LES, Petitioner-Appellee, Cross-Appellant,
v.
Charles MEREDITH, as Director of Colorado State Hospital and Raymond Leidig, as Director, Department of Institutions of State of Colorado, Respondents-Appellants, Cross-Appellees.
No. 27217.
Supreme Court of Colorado, En Banc.
March 21, 1977.
As Modified On Denial of Rehearing April 18, 1977.
*1257 Miller & Gray, P.C., William R. Gray, Boulder, for petitioner-appellee, cross-appellant.
Alexander M. Hunter, Dist. Atty., C. Phillip Miller, Chief Deputy Dist. Atty., Peter A. Hofstrom, Deputy Dist. Atty., Boulder, for respondents-appellants, cross-appellees.
GROVES, Justice.
The trial judge made a writ of habeas corpus absolute, declaring that section 16-8-103(2), C.R.S.1973 is unconstitutional. That statute reads as follows:
"If counsel for the defendant believes that a plea of not guilty by reason of insanity should be entered on behalf of the defendant, but the defendant refuses to permit the entry of the plea, counsel may so inform the court. The court shall then conduct such investigation as it deems proper, which may include the appointment of psychiatrists or psychologists to assist a psychiatrist to examine the defendant and advise the court. After its investigation the court shall conduct a hearing to determine whether the plea should be entered. If the court finds that the entry of a plea of not guilty by reason of insanity is necessary for a just determination of the charge against the defendant, it shall enter the plea on behalf of the defendant, and the plea so entered shall have the same effect as though it had been voluntarily entered by the defendant himself."
We reverse.
Les,[1] the petitioner-appellee, was charged in district court with the commission of three felonies and one Class 1 misdemeanor.[2] While represented by a deputy public defender, Les entered a not guilty plea to each count. The district court judge to whom the matter was then assigned had before him a recent medical report relating to Les' mental status. Acting thereon and under the quoted statute, the judge, on behalf of Les, entered a plea *1258 of not guilty by reason of insanity. He further ordered that Les be examined by another psychiatrist. Thereafter Les obtained private counsel, the deputy public defender withdrew, and Les moved to set aside the insanity plea. The court ordered the same two physicians again to examine Les. Later a hearing was held, at the conclusion of which the court found Les competent to stand trial but denied his motion to set aside the insanity plea. The action was then assigned to another judge.
The case was tried to a jury on the sanity issue. The prosecution called as witnesses only the two physicians, both of whom expressed the opinion that Les was legally insane at the time of the alleged commission of the offenses. The prosecution then rested and the court granted Les' motion for a directed verdict of insanity. Without further hearing, Les was ordered committed to the Department of Institutions for confinement at the Colorado State Hospital.
We limit ourselves to the trial judge's declaration of unconstitutionality.
Following hearing on the petition for writ of habeas corpus, the court made the writ absolute on the ground, expressed sua sponte, that section 16-8-103(2), C.R.S.1973 was unconstitutional. The court further ordered that Les be remanded to the custody of the sheriff for further proceedings under the criminal information or for initiation of civil commitment proceedings.
The district attorney appealed the ruling of unconstitutionality of the statute. Les cross-appealed, contending that his commitment and confinement thereunder were in violation of due process and equal protection. He further contended inter alia that, under the doctrine of res judicata, he could not be tried under the criminal charges after having been found not guilty by reason of insanity. The district attorney has argued solely the matter of the constitutionality of the statute; he has not addressed Les' contentions. Les, also paradoxically, has not argued constitutionality of the statute.
The trial court ruled the statute facially unconstitutional under U.S.Const. amends. V, VI and XIV and Colo.Const. Art. II, Secs. 16 and 25. The court concluded that in violation of such provisions, Les had lost: his right to confront witnesses against him; the right to appear and defend against the charges made; the right to assert all available defenses; and the right to a public trial upon the merits of the charges. Also, the court relied heavily upon Boyd v. People, 108 Colo. 289, 116 P.2d 193 (1941).
We do not agree with the trial court's determination that section 103(2) is facially unconstitutional. It can hardly be argued that, if the sanity of a defendant is properly an issue, the issue should not be settled before a trial of the merits of the alleged offenses. Les contends that this should not apply because there is no sanity issue if he does not voluntarily raise it. Thus, while generally the statute in question is for the protection of those who are accused, here the defendant states that he does not want such protection. This brings us to the question of whether there is a right of the state in the protection of the welfare of its citizenry, when sufficient cause appears, to determine the issue of sanity in advance of a trial. There is such a right in the state. See Porter v. Shibe, 158 F.2d 68 (10th Cir. 1946).
Viewing this matter solely in the light of facial constitutionality of the statute (and not considering whether the court applied a constitutional statute in an unconstitutional manner), we find that the statute has passed the constitutional threshold of fundamental fairness. See Tyler v. Vickery, 517 F.2d 1089 (5th Cir. 1975) and Sigma Chi Fraternity v. Regents, 258 F.Supp. 515 (D.Colo.1966). The statute does not offend traditional notions of fair play and substantial justice. Public safety and welfare considerations override the reasons assigned by the trial court for its declaration of unconstitutionality.
The case heavily relied upon by the trial court, Boyd v. People, supra, was decided prior to the enactment of the statute in 1972. There, the defendant stood mute on *1259 arraignment. The prosecutor stated that the defendant's attorney was not then present in court and had requested that a plea of not guilty by reason of insanity be entered. The court entered such a plea. Later defense counsel moved that that plea be withdrawn, which motion the trial court denied. The statute then in effect provided that when a defendant stood mute a plea of not guilty should be entered. C.R.S.1963, 39-7-9. The court there ruled that the statute must be followed and that the trial court had exceeded its authority in entering another plea.
It is true that the language in Boyd might be interpreted as questioning the constitutionality of an act such as was adopted in 1972. It was there said:
"Under no circumstances can the court, on its own motion, enter the plea of not guilty by reason of insanity. Such a plea is in the nature of confession and avoidance.. . . Defendant had an absolute right to be tried on the plea of not guilty to the charge in the information, and he did nothing to waive this right."
We are firm in the belief that the administration of justice is improved if, upon having reason to do so and after holding a hearing, a trial judge can enter a plea of not guilty by reason of insanity on behalf of the defendant, irrespective of the defendant's wishes. Such being our view and in light of our comments already here made, we follow the familiar rule that a statute is presumed to be constitutional until shown otherwise beyond a reasonable doubt. Such a showing has not been made here. Any statement to the contrary in Boyd is dictum, and we do not follow it.
Any possible error in what transpired upon or after the entry of this insanity plea was not a basis for the court's decision of facial unconstitutionality, and we do not reach consideration of any such possible errors. Among such matters there might be: the direction of the verdict (although it is to be noted that that came as a result of the defendant's motion); any right of the defendant to show that he was in fact sane; and the issues of due process and equal protection as applied to both the commitment and the confinement.
The judgment is reversed and the cause remanded with directions to vacate the order making the writ of habeas corpus absolute and to order the return of Les to the Colorado State Hospital, subject of course to the right of the trial court to have him removed to the county jail in Boulder County in connection with any further proceedings under the petition for a writ of habeas corpus.
ERICKSON and CARRIGAN, JJ., concur in the result.
LEE, J., does not participate.
NOTES
[1]  According to the record, on October 3, 1974, he obtained a county court order changing his full name from Bruce Lynn Lester to Les.
[2]  The charges were second degree burglary, felony menacing, attempt to commit rape, and sexual assault.
