The superior court, in this habeas corpus proceeding, determined that petitioner was unlawfully confined in the state prison at Folsom and ordered that he be discharged. The People appeal. The question is whether the writ of habeas corpus is available, after final judgment of conviction and sentence, to review the trial court’s erroneous refusal to certify petitioner to the Youth Authority. We have concluded that the writ cannot be used for this purpose. Petitioner is confined under a judgment of conviction of first degree robbery. At the time of his apprehension for the offense petitioner was 18 years of age. When he came before the trial court for sentence in May, 1943, that court denied petitioner’s request to be referred to the Youth Authority and sentenced him to state prison for the term prescribed by law.
The Youth Authority Act as it read at the time petitioner committed the crime and at the time he was sentenced provided, “a court shall commit to the Authority any person convicted of a public offense whom the Authority believes can be materially benefited by the procedure herein provided for, and for whose care and maintenance there exists, in the opinion of the Authority, proper and adequate facilities, and who (a) Is found to be less than 23 years of age at the time of *878apprehension (b) Is not sentenced to death, imprisonment for life, imprisonment for not more than 90 days, or the payment of a fine.” (Welf. & Inst. Code, § 1731.5; Stats. 1941, p. 2526.) 't was mandatory that the trial court certify youthful offenders who came within the terms of subdivisions (a) and (b) of section 1731.5 to the Authority for its determination whether it would accept commitment of such offenders. Refusal to certify such offenders could be corrected by appeal. (People v. Ralph (1944), 24 Cal.2d 575, 583 [150 P.2d 401],)1
Pursuant to the decision in People v. Ralph, the trial court certified Ralph to the Youth Authority. That body refused to accept him, and the trial court then ordered that he ‘ remain in the custody of the warden of San Quentin State Prison.” Ralph was not present when the quoted order was made. Apparently misapprehending the effect of our decision and the trial court’s orders, Ralph sought habeas corpus; he complained that the trial court was without authority to make the quoted order in his absence. We pointed out (In re Ralph (1946), 27 Cal.2d 866, 867 [168 P.2d 1]) that Ralph’s “whole contention on the appeal related not to the legality of the judgment of conviction or to the sentence of imprisonment as such but only to the identity of the penal authority into whose custody he should be committed,” and we held (p. 870) : “ [I]t is the judgment of conviction and sentence which constitute the basis for commitment either to prison (formerly in the custody of the warden, now in the custody of the Director of Corrections (Pen. Code, § 1202(a) ; Stats 1945, eh. 91, § 1)) or to the Youth Authority (Welf. & Inst. Code, § 1731.5) . . . [C] ommitment to the Youth Authority can be only tentative, discretion to accept or reject a defendant being vested in the Authority. The effect of our decision upon the appeal was merely to tentatively suspend commitment of the defendant to the state prison dependent upon action by the Youth Authority. Following rejection of defendant by such Authority, the original sentences could properly be carried out, and the trial court’s orders . . . [resentencing defendant] are to be regarded as merely commitments to prison made pursuant *879to the previously pronounced sentences. Such commitments do not constitute new or different judgments or sentences against defendant and consequently his presence was not required at the time they were made.”
Petitioner relies upon In re Rugland (1947), 80 Cal.App.2d 316, 317 [181 P.2d 923]. There, as here, a trial court had erroneously refused to certify a youth to the Authority at a time when section 1731.5 of the Welfare and Institutions Code required it to do so. Without mentioning the problem of whether the remedy of habeas corpus was available, the District Court of Appeal ordered that “The causes are . . . remanded to the [trial court] . . . with directions to commit petitioner to the Youth Authority.”2 As petitioner points out, Rugland was less than 25 years of age at the time of the decision on habeas corpus, and was, therefore, a person who was still a possible subject for restraint by the Youth Authority. But when a youth whose custody the Authority has accepted becomes 25, the Authority must either discharge him or, if it believes him dangerous and the maximum term prescribed by law for his offense has not expired, it may ask the committing court to put him on probation or send him to state prison. (Welf. & Inst. Code, §§ 1771, 1780-1782.) Petitioner here is more than 25 years of age. Therefore, he says, he can no longer be subject to any action of the Youth Authority and he must be discharged. The question as to possible merit or lack of merit of this argument, in its latter aspect, we do not reach because, for reasons hereinafter stated, we cannot agree with the Rugland assumption that habeas corpus is available to review the erroneous failure to certify to the Youth Authority.
Petitioner characterizes the failure to certify him to the Youth Authority as “jurisdictional.” It is true that the trial court was authorized by law to do only one thing when petitioner asked to be referred to the Youth Authority and that thing was to grant his request. In such a situation unauthorized action may be “jurisdictional” in the sense that, if the circumstances are otherwise. appropriate, the writ of prohibition may issue to prevent it, or the writ of certiorari to annul it. (Abelleira v. District Court of Appeal (1941), 17 Cal.2d 280, 291 [109 P.2d 942, 132 A.L.R. 715].) But not *880every failure to proceed in the manner required by law is ‘ ‘ jurisdictional’ ’ even in the broad sense in which the word is used when the availability of prohibition or certiorari is under consideration. (See Redlands H. Sch. Dist. v. Superior Court (1942), 20 Cal.2d 348, 360 [125 P.2d 490].) And the development of habeas corpus has been independent of that of certiorari and prohibition. The broadened uses of habeas corpus have been rationalized by expressly expanding the situations in which it is available to review matters over which the trial court had “jurisdiction,” rather than by expanding the concept of “jurisdiction.” (See In re Bell (1942), 19 Cal.2d 488, 493-494 [122 P.2d 22]; In re McVickers (1946), 29 Cal.2d 264, 273 [176 P.2d 40]; In re Seeley (1946), 29 Cal.2d 294, 296 [176 P.2d 24].) Therefore, no useful purpose would be served by discussion of whether the error here was “jurisdictional” or “mere.”
"Where, as here, the petitioner is held under a judgment which has become final, and there is no lack of jurisdietion in the strict sense and no constitutional question, the following considerations are pertinent to the determination whether relief by habeas corpus is available: If the question sought to be presented could have been and was not presented by appeal, ordinarily habeas corpus should not lie. (See In re Connor (1940), 16 Cal.2d 701, 706 [108 P.2d 10].) Without this usual limitation of the use of the writ, judgments of conviction of crime would have only a semblance of finality. But there are some situations where habeas corpus can be used to give the relief sought without going behind the judgment of conviction and without opening up questions of fact which are difficult of solution. For example, relief can be given to a person held under sentence to an institution or custodian other than the one authorized by law (In re Wilson (1925), 196 Cal. 515, 525 [238 P. 359]; Pen. Code, §§ 1486, 1487, subd. (5), 1493, 1501), to one upon whom the wrong type of sentence has been imposed (In re Lee (1918), 177 Cal. 690, 696 [171 P. 958] [indeterminate sentence imposed when petitioner should have been sentenced to a fixed term; petitioner remanded for sentence]), and to one whose commitment for punishment as an habitual criminal has been founded upon facts which as a matter of law do not admit of such punishment (In re McVickers (1946) supra, 29 Cal.2d 264, 274; In re Seeley (1946), supra, 29 Cal.2d 294, 303). Also, and similarly, the writ may be used to discharge one whose sentence for a term of years is longer than that authorized by *881law, where the valid portion of the sentence has expired (see In re Morck, (1919), 180 Cal. 384 [181 P. 657]).
In each of these instances determinations which were unauthorized by law and which affected punishment were eorrected by habeas corpus, but each instance was one where the determination could be corrected by this court (or the trial court at its direction) to accord with the only other possible determination in the circumstances. In the present ease the unauthorized determination (that petitioner should not be referred to the Youth Authority) was one which might or might not have affected punishment. At this late date we cannot presume (as discharging petitioner would, in effect, require us to presume) that had petitioner been referred to the Youth Authority that body would have found that he was a proper subject for its control and that it had facilities to accept him, and that the Authority would have discharged him when or before he reached the age of 25 years. Nor do we think it proper to require that petitioner be retroactively certified to tie Authority for that body’s speculative determination as to what it would have done had petitioner been referred to it at the proper time. To reopen to speculative review the cases of prisoners who were not referred to the Authority during the period when such referral was both mandatory and possible, whether or not those prisoners are now of such age that they could be subject to control of the Authority, would not accord with the general principle of finality of judgments. For the reasons above stated, In re Rugland (1947),supra, 80 Cal.App.2d 316, 317, is disapproved. In accord '.with our position here is the position taken in the following eases which considered the effect of the trial court’s failure to' comply with the requirement of the Juvenile Court Law that ‘"Mendants under a certain age be certified to the juvenile <■« urt for its determination whether they should be proceeded oga/mst as juveniles or tried as adults: In re Tom (1911), 171 Cal.App. 678, 680 [121 P. 294]; People v. Oxnam (1915), 170 Cal. 211, 217-218 [149 P. 165]; In re Northon (1917), 35 Cal.App. 369, 371 [169 P. 1051]; In re Wolff (1920), 183 Cal. 602 [192 P. 33]; People v. Barbera (1926), 78 Cal.App. 277, 279 [248 P. 304]; In re Downs (1928), 95 Cal.App. 571, 573 [273 P. 143]; People v. Luzovich (1932), 127] Cal.App. 465, 468 [16 P.2d 144]; People v. Sanchez (1942), 21 Cal.2d 466, 471 [132 P.2d 810]. The cases of In re Tassey (1927), 81 Cal.App. 287, 293 [253 P. 948]; In re Bastiani 1(1927), 81 Cal.App. 294 [253 P. 951]; and *882In re Gutierrez (1934), 1 Cal.App.2d 281, 287 [36 P.2d 712], indicate that habeas corpus may be used, after final judgment of conviction, to correct an erroneous refusal to certify to the juvenile court. To the extent that they so indicate, such cases are inconsistent with the group of cases last hereinabove cited and, in view of the conclusion we have reached, they are disapproved.
For the reasons above stated, the order that the writ be granted and petitioner discharged is reversed, and the cause is remanded with directions to the superior court to enter its order discharging the writ and remanding petitioner to custody.
Gibson, C. J., Shenk, J., Edmonds, J., and Traynor, J., concurred.
Spence, J., concurred in the judgment.
Certification to the Authority is not mandatory at the present time. Since 1945 section 1731.5 has provided that the court “may refer” certain youthful offenders to the Authority; the Authority, if it decides to accept them, “shall so certify” to the court; and the court “shall thereupon commit said person to the Authority.” Abuse of the trial court’s discretion, as shown by its use of the wrong criteria in determining whether a .defendant should be referred to the Authority, can be reviewed on appeal. (People v. Walker (1947), 82 Cal.App.2d 196, 202 [185 P.2d 842].)
This “commitment” would be tentative, in the sense that the Authority did not have to accept Bugland. (People v. Ralph (1944), supra; In re Ralph (1946), supra.)