
233 Cal.App.2d 79 (1965)
In re ALLEN LEE FERGUSON on Habeas Corpus.
Crim. No. 10579. 
California Court of Appeals. Second Dist., Div. Four.  
Mar. 17, 1965.
 Sam Houston Allen for Petitioner.
 Thomas C. Lynch, Attorney General, and Bradley A. Stoutt, Deputy Attorney General, for Respondent.
 FRAMPTON, J. pro tem.  [fn. *]
 Petitioner, Allen Lee Ferguson, originally filed his petition in propria persona, entitled "Petition for Writ of Error Corum Nobis." On January 26, 1965, this court issued an order to show cause why a writ of habeas corpus should not issue, and set the hearing thereon for March 2, 1965. At such hearing, petitioner appeared through, and has subsequently been represented by Attorney Sam Houston Allen. Petitioner claims that in 1956 he was tried and convicted of a misdemeanor. A new trial was granted and upon the second trial in 1957 he was convicted of a felony and sentenced to state prison where he is now being held.
 Because of the meager content of the petition, this court felt it necessary to, and did, examine the superior court file of the proceedings. This file disclosed that, on March 2, 1956, petitioner was charged by information filed by the District Attorney of Los Angeles County, with the crime of rape in violation of section 261, subdivision 1, of the Penal Code. The cause was brought to trial before a jury and on May 23, 1956, the jury returned its verdict finding petitioner guilty as charged with the recommendation in its verdict that punishment be by imprisonment in the county jail. A motion for a new trial was granted and on the second trial upon the same charge, the jury on January 8, 1957, returned its verdict finding the petitioner guilty with the recommendation that punishment be by imprisonment in the state prison. *81 A motion for new trial, and probation, was denied, and on February 5, 1957, petitioner was sentenced to state prison for the term prescribed by law.
 Although the petition is entitled "Petition for Writ of Error Corum Nobis," the substance of it shows that relief may be granted under habeas corpus, and we treat it as an application for relief under the latter.
 [1] Section 264 of the Penal Code provides "Rape is punishable by imprisonment in the state prison not less than three years, except where the offense is under subdivision 1 of Section 261 of the Penal Code, in which case the punishment shall be either by imprisonment in the county jail for not more than one year or in the state prison for not more than 50 years, and in such case the jury shall recommend by their verdict whether the punishment shall be by imprisonment in the county jail or in the state prison; provided, that when the defendant pleads guilty of an offense under subdivision 1 of Section 261 of the Penal Code the punishment shall be in the discretion of the trial court, either by imprisonment in the county jail for not more than one year or in the state prison for not more than 50 years." (Italics added.)
 The recommendation of the jury that the defendant shall be punished by imprisonment in the county jail is binding upon the court and it may not, in disregard thereof, impose a sentence of imprisonment in the state prison. (People v. Rambaud, 78 Cal.App. 685, 699 [248 P. 954]; People v. Pantages, 212 Cal. 237, 270 [297 P. 890]; People v. Beck, 95 Cal.App. 257 [272 P. 797].)
 In People v. Henderson, 60 Cal.2d 482 [35 Cal.Rptr. 77, 386 P.2d 677], the defendant was convicted of murder and sentenced to life imprisonment. This judgment was reversed on appeal and defendant was retried. The second trial resulted in a death sentence. The Supreme Court reversed upon the ground, among others, that the constitutional prohibition against double jeopardy prevented the imposition of a more severe sentence on retrial. The court said: "A defendant's right of appeal from an erroneous judgment is unreasonably impaired when he is required to risk his life to invoke that right. Since the state has no interest in preserving erroneous judgments, it has no interest in foreclosing appeals therefrom by imposing unreasonable conditions on the right to appeal." (60 Cal.2d at p. 497.)
 Although there are some factual and procedural differences between the Henderson case and the case at bench, we *82 think the reasoning of the Henderson opinion compels the application of the same rule here.
 [2] In our case petitioner obtained a retrial as a result of a motion in the trial court rather than by appeal. It was his right to make that motion, and under the Henderson doctrine he should not be required to take the risk of a long prison term (1 to 50 years under Pen. Code,  264) in order to exercise that right.
 The Attorney General points out that petitioner failed to raise the issue of double jeopardy in the trial court. This is not a case where a plea of "once in jeopardy" is required to bring before the court events occurring in another court or even in another case in the same court. The fact which precluded the court from sentencing petitioner to prison was a part of the record of the court in this very case. The prior verdict was not a bar to further prosecution. It was a limitation upon the punishment which could be imposed--and this for the reason that to hold otherwise would have the effect of discouraging motions for new trial. Our conclusion is that this particular kind of jeopardy, being merely a limitation upon punishment, and based entirely upon the court's own records in the same case, is one which was not required to be pleaded specially under Penal Code sections 1016 and 1017.
 [3] The present case differs from Henderson in that petitioner failed to appeal from the judgment. Nevertheless, habeas corpus is appropriate where it appears on the face of the record that the trial court has sentenced a defendant to a term in excess of the maximum provided by law. (Neal v. State of California, 55 Cal.2d 11, 16 [9 Cal.Rptr. 607, 357 P.2d 839].)
 Inasmuch as petitioner has already been confined for a longer period than the law requires in his case, he need serve no more time for this conviction.
 The writ of habeas corpus is granted, the return to the order to show cause shall stand as the return to the writ, and the petitioner is discharged from custody under the judgment pronounced on February 5, 1957.
 Said judgment is modified to show the sentence to be imprisonment in the County Jail of the County of Los Angeles instead of imprisonment in state prison.
 Files, P. J., and Jefferson, J., concurred.
NOTES
[fn. *]  *. Assigned by the Chairman of the Judicial Council.
