
503 P.2d 1029 (1972)
Richard L. PARKS, Petitioner,
v.
The DENVER DISTRICT COURT, SECOND JUDICIAL DISTRICT, et al., Respondents.
No. 25541.
Supreme Court of Colorado, En Banc.
December 4, 1972.
*1030 Thompson & Hostetter, Donald P. Hostetter, Denver, for petitioner.
Jarvis W. Seccombe, Dist. Atty., Leonard M. Chestler, Deputy Dist. Atty., Denver, for respondents.
*1031 ERICKSON, Justice.
This original proceeding seeks to prohibit determination of the petitioner's competency to stand trial until after a jury resolves the issue raised by the petitioner's plea of not guilty by reason of insanity. Petitioner was charged in the Denver district court with robbery and conspiracy to commit robbery. Thereafter, he entered pleas of not guilty and not guilty by reason of insanity at the time of the alleged commission of the offense. After the insanity issue was raised, the court, at the instance of the district attorney, ordered that a trial be held to determine whether the defendant was competent to stand trial and vacated the date set for the trial of the insanity issue. We issued a rule to show cause after a petition for a writ of prohibition was filed. We now discharge the rule.
The facts pointedly indicate why the trial judge ordered that a trial should first be held to determine whether the petitioner was competent to stand trial for robbery and conspiracy. At the time the offenses were perpetrated, the petitioner was an escapee from the Colorado State Hospital at Pueblo. He had been committed to the Colorado State Hospital under two separate orders. One commitment was based upon a finding of not guilty by reason of insanity in the district court of the first judicial district. The other commitment was based upon a finding of the district court of the second judicial district which declared that the petitioner was incompetent to stand trial. Since the time when petitioner was committed, he has not been found to be sane, competent, or restored to reason under either of the committing orders. The psychiatrists who examined the petitioner in connection with this proceeding have again evaluated the defendant's mental condition. Three of the examining physicians voiced the opinion that he was insane at the time the criminal offenses were committed. Two psychiatrists gave no opinion. Three psychiatrists are of the opinion that he is incompetent to stand trial at the present time, while one refused to express an opinion on his competence to stand trial, and one opines that he is competent to stand trial.
The petitioner, in his original proceeding, attacks the constitutionality of our statutes which deal with the mentally deranged person who is accused of a crime. He also claims that his counsel is the sole person who can raise the issue of his competence to stand trial.
The only constitutional question which we must resolve in this case concerns the statutory method used at the time of the hearing in this case to determine the petitioner's competence to stand trial.[1] If the petitioner, or any other defendant, is found to be incompetent to stand trial, he must be committed to the department of institutions, "there to be treated and confined to the extent necessary for the protection of society until it has been duly determined that he is no longer insane. . . ." 1969 Perm.Supp., C.R.S.1963, 39-8-6(2). If a defendant who is incompetent to stand trial later regains his sanity, he must face trial on the merits. Our statutory procedures do not have the infirmities which caused the Supreme Court to condemn the practice followed in Indiana. In Jackson v. Indiana, 406 U.S. 715, 92 S.Ct. 1845, 32 L.Ed.2d 435 (1972), the Court said:
"[A] person charged by a State with a criminal offense who is committed solely on account of his incapacity to proceed to trial cannot be held more than the reasonable period of time necessary to determine whether there is a substantial probability that he will attain that capacity in the foreseeable future. If it is determined that this is not the case, then *1032 the State must either institute the customary civil commitment proceeding that would be required to commit indefinitely any other citizen, or release the defendant.. . ."
The constitutional weakness in the Indiana statutory procedures was that the accused, who was found to be incompetent, was committed until he regained his competence. Where there is little likelihood that the accused will ever become competent, the Indiana procedure amounts to a sentence of life imprisonment. At the time of the Supreme Court decision, Jackson had already been confined for three and one-half years. The Jackson opinion points out that there had never been a finding that Jackson was dangerous or that further commitment would help him become competent.
In contrast, the Colorado statute provides that the incompetent accused is to be treated and confined only to the extent necessary for the protection of society, which is based partly upon the dangerous propensities of the accused. In Colorado, if a person is found to be incompetent to stand trial, he is committed to the custody of the executive director of the department of institutions, where he remains until he is able to stand trial. He is also to be afforded treatment in an institution for the mentally ill or retarded. The director has the power to establish procedures for periodic evaluation and should provide for review of each case at appropriate intervals if the statutory procedure is to stand constitutional muster. Since the criminal proceeding that brings competency into issue is merely abated, the court which commits the accused retains jurisdiction to oversee his commitment and to protect his constitutional rights and should do so. In fact, it is the trial judge's duty to make periodic checks to determine the status and condition of an incompetent who has criminal charges pending against him under any valid statute. If it becomes apparent that the defendant is unlikely to ever regain competency to stand trial, then civil commitment proceedings should be instituted. Furthermore, custody may be reviewed at the instance of the accused by a writ of habeas corpus.
Colorado procedure contains an additional safeguard. Jackson v. Indiana, supra, held that a determination of competence to stand trial could not be substituted for the civil commitment procedures which are ordinarily required for the indefinite commitment of a person who has not been convicted of a crime. In Colorado, the crucial criterion for a normal civil commitment proceeding is identical to that which is used in the competency commitment proceeding in a criminal case. The accused who is found to be incompetent is treated and confined only to the extent necessary for the protection of society. 1969 Perm. Supp., C.R.S.1963, 39-8-6(2). Substantially equivalent provisions for confinement are set forth in our civil commitment procedure. C.R.S.1963, 71-1-7(2)(b) and (e). The Colorado statutory scheme authorizes a reasonable period of observation and testing to determine whether the accused will ever become competent, but the overriding consideration is the same as that in a civil commitmentthat he be treated and confined only to the extent necessary for the protection of society. Therefore, the Colorado statute considers the interests of both society and the individual accused and strikes a fair balance. See Kaufman, Evaluating Competency: Are Constitutional Deprivations Necessary?, 10 Am.Crim. L.Rev. 465 (1972).
We disagree with the assertion that petitioner's counsel is the only person that should be allowed to raise the issue of competency to stand trial. It is clear to us that it is not only the duty of defense counsel and the prosecution, but also the obligation of the court, to raise the issue of the competency of the accused to stand trial when facts dictate that such a hearing should be held. See Pate v. Robinson, 383 U.S. 375, 86 S.Ct. 836, 15 L.Ed.2d 815 (1966). C.R.S.1963, 39-8-6(3) grants the *1033 power to the trial judge.[2] Generally, it is not to the advantage of the accused to raise the issue of competence to stand trial. A finding of incompetence to stand trial only results in an abatement of the criminal proceedings. See Cernoff and Schaffer, Defending the Mentally Ill: Ethical Quicksand, 10 Am.Crim.L.Rev. 505 (1972). However, a just and fair determination of whether an accused is, in fact, the wrongdoer cannot be made if the accused does not understand the nature of the proceedings against him and cannot rationally participate with counsel in his defense. The competency of an accused to stand trial is measured by a jury in Colorado, in accordance with this standard:
"39-8-6. Insanity after crime or judgment....
"(8) (a) In case of any of the hearings hereinbefore mentioned, when the issue is whether the defendant has become insane since the commission of the offense and before trial, the following shall be the applicable test, and the jury shall be so instructed: `The defendant is not to be considered as insane if he has sufficient intelligence to understand the nature and object of the proceeding against him and to rightly comprehend his own condition with reference to such proceeding, and has sufficient mind to conduct his defense in a rational and reasonable manner, although on some other subjects his mind may be deranged or unsound.'" C.R.S.1963, 39-8-6(8)(a).[3]
Pate v. Robinson, supra, has declared that a criminal defendant who raises the sanity issue is constitutionally entitled to a separate hearing to determine his competence to stand trial. One reason for the separate hearings is that a different standard determines competence to stand trial from that which determines the validity of a defense of not guilty by reason of insanity. Compare C.R.S.1963, 39-8-1 with 39-8-6(8) (a).[4] Note, Incompetency to Stand Trial, 81 Harv.L.Rev. 454 (1967).
Under Colorado law, the plea of not guilty by reason of insanity is a plea on the merits. It attacks the mental element of the offense alleged which is an essential element of guilt. People ex rel. Juhan v. District Court, 165 Colo. 253, 439 P.2d 741 (1968). Thus, in Colorado, the sanity trial stands on the same footing with the trial on the other elements of the crime. Insanity at the time of the commission of the offense is not a mitigating factor that relieves the accused of punishment, but is a complete defense to the criminal charge. Therefore, determination of sanity at the time of the offense requires a full hearing, and the accused must be able to understand and assist his counsel in his defense. See Schwader v. District Court, 172 Colo. 474, 474 P.2d 607 (1970).
The primary purpose of the hearing to determine the competency of an accused to stand trial is to ascertain whether he has sufficient mental capacity to know the nature of the charge and to cooperate with his counsel in his defense. Such a determination must be made before the issues raised by the insanity plea are tried.
On remand, the proceedings will, of course, be governed by the applicable provisions of Article 8 of the Colorado Code of Criminal Procedure. C.R.S.1963, ch. 39, art. 1 through 13 (Colo.Sess.Laws 1972, ch. 44, § 1).
Accordingly, we discharge the rule to show cause.
DAY, J., not participating.
NOTES
[1]  Our statutes have been changed since the time of this proceeding. Articles 1 through 13 of Chapter 39 of C.R.S.1963 have been revised in the Colorado Code of Criminal Procedure (Colo.Sess.Laws 1972, ch. 44, § 1, eff. July 1, 1972). This decision necessarily deals with the statutes in effect at the time of this proceeding.
[2]  C.R.S.1963, 39-8-110(2) (Colo.Sess.Laws 1972, ch. 44, § 1), sets forth the obligations of the court and counsel to raise the issue under the Code of Criminal Procedure.
[3]  The criterion for competency to stand trial is substantially unchanged. C.R.S. 1963, 39-8-102(1) (Colo.Sess.Laws 1972, ch. 44, § 1).
[4]  In the new Colorado Code of Criminal Procedure, the criteria are found at 39-8-101 (Insanity) and 39-8-102(1) (Incompetent to proceed).
