
239 Cal.App.2d 466 (1966)
In re LORENZO O. PEREZ on Habeas Corpus.
Crim. No. 3932. 
California Court of Appeals. Third Dist.  
Jan. 19, 1966.
 Tony Stathos, under appointment by the District Court of Appeal, for Petitioner.
 Thomas C. Lynch, Attorney General, Doris H. Maier, Assistant Attorney General, Edward Haws and Harold F. Bradford, Deputy Attorneys General, for Respondent.
 WARNE, J. pro tem.  [fn. *]
 Petitioner herein filed a petition for a writ of habeas corpus. He seeks to have certain judgments and commitments under which he is confined to the state prison declared void and the sentences set aside. Since the facts as alleged in the verified petition disclosed that petitioner was improperly charged with and sentenced for the crime of escape while serving a sentence for a felony rather than escape while serving a sentence for a misdemeanor in the jail of Fresno County, this court issued an order to show cause and respondent made return.
 All of the relevant facts relating to this matter appear in exhibits attached to the return to the order to show cause.
 [1] Concerning the escape conviction, it appears that at the time of petitioner's preliminary hearing in the Municipal Court of the Fresno Judicial District petitioner was fully informed by the magistrate of his constitutional right to be represented by an attorney at all stages of the proceedings and also of his right to refuse to take the witness stand or incriminate himself. The petitioner nevertheless waived his right to be represented by counsel, stating: "Well, I'm going to plead guilty so I don't think I need a lawyer for that." Petitioner then took the witness stand and testified that he was in the custody of the Sheriff of Fresno County on January *468 15, 1962, serving a 90-day sentence for petty theft; that he was assigned to a work detail at the Fresno Juvenile Hall; and that he "just walked away." He was arrested in Monterey about two months later. Petitioner was held to answer to the Superior Court of Fresno County on the charge of escape.
 An information was filed in the Superior Court of Fresno County erroneously charging petitioner with a violation of subdivision (b) of section 4532 of the Penal Code (an escape of a prisoner convicted of a felony). The proper charge should have been escape under subdivision (a) of said section, i.e., escape of a prisoner convicted of a misdemeanor. Under subdivision (a) if the escape was not by force or violence the penalty is imprisonment in the state prison for not less than six months nor more than five years, regardless of any prior convictions, or in the county jail not exceeding one year; while under subdivision (b) the convicted person is punishable by imprisonment in the state prison not exceeding 10 years, or in the county jail not exceeding one year. A prior felony based on a Youth Authority commitment for burglary was also charged in the information.
 Upon his arraignment in the superior court petitioner waived counsel, entered a plea of guilty to the charge as filed and was sentenced to state prison for the term prescribed by law.
 The Department of Corrections reported the error in the judgment and sentence to the judge of the Superior Court of Fresno County, who pronounced the judgment and sentence, but no steps were ever taken to correct the error, notwithstanding the fact that he acknowledged the error. Petitioner then filed a motion to have the judgment and sentence vacated and set aside. The motion was denied. An appeal from the order denying the motion was then attempted but the time for filing notice of appeal had lapsed.
 Subsequent to his incarceration in the state prison and while serving time under the erroneous judgment and sentence, petitioner pleaded guilty in the Superior Court of Marin County to the crime of possession of a deadly weapon by a prisoner committed to state prison (Pen. Code,  4502) and also the crime of assault on the person of another with a deadly weapon by a person undergoing sentence for less than life (Pen. Code,  4501). He was sentenced to state prison in each of these cases for the term prescribed by law. In each case he was represented by counsel. *469
 Petitioner contends that the judgment of the Superior Court of Fresno County was invalid because he was not represented by counsel and that the court accepted his plea of guilty without explaining the nature of the charge to him and without determining whether he had intelligently waived counsel.
 Petitioner also contends that the judgment of the Superior Court of Fresno County was invalid and his imprisonment thereunder unlawful for the reason that he was convicted and sentenced for a violation of a subsection of the Penal Code which charged an offense he did not commit. The Attorney General concedes that petitioner was improperly charged and sentenced for a crime he did not in fact commit. However, he contends that since the petitioner was charged properly with the substance of the offense, i.e., escape, it is difficult to see how petitioner by the error was prejudiced since the transcript of the proceedings on preliminary examination, the report of the probation officer, the statement of the district attorney, and the correspondence between the Department of Corrections and the trial court all show that the petitioner was at the time of his escape a misdemeanor prisoner. The answer to this is that petitioner stands convicted of and is incarcerated for a crime he did not commit. The fact that petitioner pleaded guilty to the more serious crime is beside the question. Obviously, he did not know that the information which was filed in the superior court was erroneous. It is reasonable to conclude that he thought that he was pleading guilty to a charge of escape by one convicted of a misdemeanor--not a felony.
 In In re Zerbe, 60 Cal.2d 666, the court said at pages 667-668 [36 Cal.Rptr. 286, 388 P.2d 182]: "Habeas Corpus is available in cases where the court has acted in excess of its jurisdiction (Pen. Code,  1487, subd. 1; Neal v. State of California, 55 Cal.2d 11, 16 [9 Cal.Rptr. 607, 357 P.2d 839].) For the purposes of this writ as well as prohibition or certiorari, the term 'jurisdiction' is not limited to its fundamental meaning, and in such proceedings judicial acts may be restrained or annulled if determined to be in excess of the court's powers as defined by the constitutional provision, statute, or rules developed by courts. (Neal v. State of California, supra, 55 Cal.2d 11, 16 [habeas corpus]; Auto Equity Sales, Inc. v. Superior Court, 57 Cal.2d 450, 454-455 [20 Cal.Rptr. 321, 369 P.2d 937] [certiorari]; Abelleira v. District Court of Appeal, 17 Cal.2d 280, 287 et seq. [109 P.2d 942, *470 132 A.L.R. 715] [prohibition].) [2] In accordance with these principles a defendant is entitled to habeas corpus if there is no material dispute as to the facts relating to his conviction and if it appears that the statute under which he was convicted did not prohibit his conduct. (Cf. In re Allen, 59 Cal.2d 5, 6 [27 Cal.Rptr. 168, 377 P.2d 280]; Neal v. State of California, supra, 55 Cal.2d 11, 16; In re McVickers, 29 Cal.2d 264, 279 [176 P.2d 40]; Ex parte Greenall, 153 Cal. 767, 770 [96 P. 804]; Ex parte Mirande, 73 Cal. 365, 371 [14 P. 888].)"
 There being no material dispute as to the facts relating to petitioner's conviction, it follows that In re Zerbe, supra, and the cases cited in the above quote are controlling in the instant case and that the error in the judgment and sentence must be corrected. Therefore we have determined that a writ of habeas corpus should be granted.
 The petition for a writ of habeas corpus is granted and the judgment and sentence for felony escape is vacated and set aside. Nothing herein shall be considered as interfering with petitioner's convictions and commitments to the state prison for a violation of section 4502 of the Penal Code or his conviction and commitment to the state prison for a violation of section 4501 of the Penal Code hereinabove referred to.
 Pierce, P. J., and Friedman, J., concurred.
NOTES
[fn. *]  *. Retired judge of the superior court sitting under assignment by the Chairman of the Judicial Council.
