
62 Cal.2d 538 (1965)
THE PEOPLE, Plaintiff and Respondent,
v.
N. K. FIELDS, Defendant and Appellant.
Crim. No. 8526. 
Supreme Court of California. In Bank.  
Mar. 5, 1965.
 N. K. Fields, in pro. per., and Morris Lavine, under appointment by the Supreme Court, for Defendant and Appellant.
 Stanley Mosk and Thomas C. Lynch, Attorneys General, Albert W. Harris, Jr., and Robert R. Granucci, Deputy Attorneys General, for Plaintiff and Respondent.
 PEEK, J.
 The People move to dismiss defendant's appeal from an order adjudging him insane within the meaning of section 1368 of the Penal Code and committing him to the Atascadero State Hospital until he is pronounced sane. It is urged that the order is not appealable.
 Defendant was charged with the crime of receiving stolen property in violation of section 496 of the Penal Code.prior to the date set for trial the court, on the motion of defendant's attorney, suspended the criminal proceedings and appointed two psychiatrists to examine defendant. Acting in his own behalf defendant then moved to set aside the order suspending criminal proceedings. When his motion was denied he discharged his court-appointed counsel and insisted on representing himself in the trial of the issue of sanity. At the conclusion of the six-day trial, the jury found him insane, and the court ordered him committed to Atascadero State Hospital for care and treatment until pronounced sane. This appeal followed.
 Section 1368 of the Penal Code provides that, if at any time during the pendency of an action and prior to judgment a *540 doubt arises as to the sanity of a defendant, the court must suspend all proceedings in the criminal prosecution and determine the question of the defendant's sanity. If he is found insane, the trial or judgment must be suspended until he is restored to sanity. Furthermore the court must order him committed by the sheriff to a state hospital for the care and treatment of the insane. (Pen. Code,  1370.) If defendant returns to sanity, the superintendent shall certify that fact to the sheriff and district attorney, and the sheriff shall place defendant in custody subject to the criminal proceedings or until he is legally discharged. (Pen. Code,  1372.) It does not expressly appear from any of these sections whether or not an order of commitment is appealable.
 [1] In a proceeding under section 1368 a defendant is not charged with a criminal act and is not subject to criminal proceedings or punishment if he is found insane. It is a special proceeding rather than a criminal action. (People v. Lawson, 178 Cal. 722, 728 [174 P. 885]; In re Shaw, 115 Cal.App.2d 753, 756 [252 P.2d 970]; People v. Loomis, 27 Cal.App.2d 236, 239-240 [80 P.2d 1012].) Accordingly the right to appeal is governed by subdivision 1 of section 963 of the Code of Civil Procedure, which provides that an appeal may be taken from a final judgment entered in a special proceeding.
 [2] An order determining that a defendant is insane and directing that he be committed is a final determination of his mental condition at that time, and such an order could result in a confinement for life. Thus in Higgins v. United States, 205 F.2d 650, 652, the court, in holding appealable an order committing a defendant charged with crime for treatment until restored to mental competency, stated that inasmuch "as the defendant's mental disturbance may be of long duration, perhaps for life, and his trial may therefore be delayed over a very long time, and perhaps forever, the order adjudging him incompetent for trial has a phase of finality in it."
 Furthermore in analogous situations involving orders of commitment of mentally disordered sex offenders and narcotics addicts, it has been held that such orders of commitment are appealable as final orders in special proceedings. (In re De La O, 59 Cal.2d 128, 156 [28 Cal.Rptr. 489, 378 P.2d 793]; People v. Gross, 44 Cal.2d 859, 860 [285 P.2d 630].) The fact that the commitments in these cases were made after rather than before conviction does not serve to distinguish them in any material sense from the present case insofar as the instant issues are concerned. In the situation in those cases, as here, *541 the basis of appealability is that the proceedings are special proceedings, and the detention of the defendant follows from the order of the court in such special proceedings.
 [3] Although the superintendent of the state hospital to which defendant is committed may subsequently determine that he is restored to sanity and can be returned for further proceedings in the criminal action, this does not mean that the order of commitment is interlocutory. [4] The superintendent's determination in such a case is based upon circumstances relative to defendant's condition existing at the time of the superintendent's examination and constitutes neither a review of the original order of commitment nor a determination that it was erroneous.
 [5] The language in People v. Superior Court, 4 Cal.2d 136, 146 [47 P.2d 724], to the effect that the superintendent's determination is the final determination and that the proceeding before the judge is analogous to a preliminary examination must be read in the context used. In that case the defendant had been committed to a hospital and then returned to the superior court where he subsequently entered a plea of guilty at which time the question of his sanity again arose. In such situation the crucial question was not whether the original commitment was valid but whether the superintendent properly returned the defendant to the custody of the sheriff and whether the defendant was sane at the time of his plea. The language of the court was directed to the conclusiveness of the original adjudication of insanity in proceedings subsequent thereto rather than to whether the adjudication was final for purposes of appeal, and any implications to the contrary in that case are disapproved.
 Unless a defendant may appeal from an adjudication that he is insane within the meaning of section 1368, the proceedings leading to the adjudication may never be reviewed. Such a result would follow, for example, where the criminal proceedings are dismissed while he is committed to the state hospital or where he is not subsequently declared sane and returned to face the criminal charge. It should be noted that this situation does not exist where the trial of the issue of the defendant's sanity results in a determination that he is sane. In such circumstances the court will proceed with the trial of the criminal charge (Pen Code,  1370), and the determination of the issue of sanity may be reviewed on appeal from a judgment of conviction as in the case of any other intermediate order. (People v. Lawson, supra, 178 Cal. 722, 725 et seq.). *542 Accordingly a determination of sanity is in the nature of an interlocutory order, and it has been held that the order is not appealable. (People v. Lawson, supra, 178 Cal. at p. 723.)
 In view of the important consequences of a determination that a defendant is insane within the meaning of section 1368, we are satisfied that an order adjudicating the defendant to be insane and committing him to a state hospital until pronounced sane is appealable as a final judgment in a special proceeding and that the motion to dismiss the appeal should be denied.
 Defendant has requested that counsel be appointed to represent him on appeal and in support of his request has filed an affidavit of indigency. His right to counsel is not directly before us on this motion to dismiss the appeal but, because a constitutional right may be involved, we have found it appropriate to consider the question here.
 As we have seen, a proceeding under section 1368 is a special proceeding. [6] However, the right of an accused to counsel is not limited to proceedings which are labeled criminal but additionally extends to proceedings, whatever the label, which " 'must be regarded as part of the proceedings in the criminal case.' " (People v. Shipman, ante, pp. 226, 231 [42 Cal.Rptr. 1, 397 P.2d 993] [coram nobis].) With regard to proceedings under section 1368, we recently reiterated that persons charged with crime who become insane belong to a class distinct and different from insane persons who are not so charged; that the party, though insane, is detained under the law to answer for his crime when he is restored to sanity; that if not under the restraint of governmental authority he might not have been sent to an asylum but might have remained in the care of friends or relatives, or be sent to a private institution; and that his commitment to the state hospital so that he could be held in custody in anticipation of trial " 'is a part and parcel of the administration of the criminal law.' " (Department of Mental Hygiene v. Hawley, 59 Cal.2d 247, 251 [28 Cal.Rptr. 718, 379 P.2d 22], quoting from Napa State Hospital v. County of Yuba, 138 Cal. 378, 381-382 [71 P. 450].)
 In Douglas v. California, 372 U.S. 353, 357 [83 S.Ct. 814, 9 L.Ed.2d 811], the United States Supreme Court held that, where on a first appeal granted as a matter of right from a felony conviction an indigent defendant is denied the assistance of counsel, an unconstitutional line is drawn between rich and poor. It is also settled that on an appeal from a misdemeanor *543 conviction involving serious consequences an indigent defendant has a right to have an attorney assigned to represent him on appeal. (In re Henderson, 61 Cal.2d 541, 543 [39 Cal.Rptr. 373, 393 P.2d 685].)
 [7] The order from which defendant appeals involves an indefinite and for that reason possibly a final deprivation of liberty. The proceeding in which the order was rendered is a part of the administration of the criminal law, and an assignment of counsel will promote effective appellate court administration and minimize the hazards of affirming an erroneous judgment. (See People v. Brown, 55 Cal.2d 64, 71 et seq. [9 Cal.Rptr. 816, 357 P.2d 1072] [Traynor, J., concurring].) For the above reasons defendant is entitled to have counsel appointed to represent him on his appeal.
 The motion to dismiss the appeal is denied.
 Traynor, C. J., McComb, J., Peters, J., Tobriner, J., and Schauer, J.,  [fn. *] concurred.
NOTES
[fn. *]  *. Retired Associate Justice of the Supreme Court sitting under assignment by the Chairman of the Judicial Council.
