Petition for writ of habeas corpus by William Wilson, wherein said petitioner, among other matters, alleges as follows:
“On or about February 21, 1922, petitioner pleaded guilty to an information filed against him in the superior court of Kings county, charging him with violation of section 464 of the Penal Code, namely, burglary with explosives, and that by reason of said imprisonment (plea) he was sentenced on or about February 21, 1922, to be imprisoned in the state prison, and was removed to the state prison and there confined.
“Thereafter, and on or about December 29, 1924, petitioner was discharged from said state prison, where he was confined because of said conviction; that said discharge was ordered by the superior court of Sacramento county in a habeas corpus proceeding pending before said court; that said superior court of Sacramento county ordered petitioner returned to the superior court of Kings county for resentence to the county jail because of said conviction, and in conformity with the decision of the honorable the District Court of Appeal of the State of California, First District, Division Two, in the case of In re Schaffino, 70 Cal. App. 65 [232 Pae. 719], which latter case held that the crime of burglary with explosives was a misdemeanor and not a felony and that accordingly a person convicted of said offense could not be imprisoned in a state prison.
“That thereafter, and on or about December 31, 1924, said superior court of Kings county resentenced petitioner to be imprisoned in the county jail of Kings county for the term of twenty-five years.
“That thereafter the petitioner applied to this honorable court for a writ of habeas corpus, claiming that his imprisonment in the county jail was illegal for various reasons, and that this honorable court, in its decision made on July 29, 1925, reported in 196 Cal. 517 [238 Pae. 359], discharged the writ of habeas corpus and remanded petitioner to the *343custody of the sheriff of Kings county, and ordered the superior court of Kings county to vacate and set aside the judgment of sentence that petitioner be imprisoned in the county jail, and ordered that a new judgment be pronounced and entered against petitioner according to law and the views expressed in its decision, namely, that petitioner be sentenced to be imprisoned in the state prison. That thereafter, to-wit, on or about August 12, 1925, and because of the said decision of this honorable court, the said superior court of Kings county did resentence petitioner to be confined in the state prison by reason of said conviction (of February 21, 1922), and that the petitioner has ever since been confined in the state prison solely by reason of said resentence last mentioned.
“That the petitioner’s confinement in the state prison ever since on or about August 12, 1925, is illegal for the reason that said judgment of resentence pronounced and entered by the superior court of Kings county, on or about August 12, 1925, is void because the said judgment of the superior court of Kings county made and entered on or about February 21, 1922, was at all times and is valid and in full force and effect.”
Upon the presentation and filing of this petition this court ordered that a writ of habeas corpus as prayed for therein be issued. The return of said writ by the warden of the state prison sets forth that he held said William Wilson under two commitments issued out of the superior court of the county of Kings, one upon the judgment of conviction of date February 21, 1922, and the other upon the judgment of conviction of date August 12, 1925.
It is first contended by petitioner that the judgment of conviction entered by said superior court on the twelfth day of August, 1925, is illegal and void for the reason that the law does not compel nor countenance two distinct final judgments covering the same matter. This contention appears to be sustained by the ruling of this court in the case of People v. Mess, 65 Cal. 174. In that action facts quite similar in principle to those in the present proceeding were before the court. It was there held that “the judgment of October 27, 1883, is a valid judgment, and that the defendant is legally in custody under it. It results that the *344proceedings subsequently taken in the superior court, looking to a resentence of the defendant, were void.” Assuming that the judgment of August 12, 1925, is void and the commitment issued thereon of no greater validity, there still remains the prior judgment of date February 21, 1922. The return of the warden in this proceeding shows that petitioner is held under a commitment issued under this judgment as well as upon the one issued upon the latter judgment. That being the case, his imprisonment is legal and he is not entitled to be discharged therefrom. It is true that petitioner claims that the commitment issued upon the second judgment is the “sole warrant” for the present detention, but the return of the warden shows otherwise.
In another portion of petitioner’s brief he states:
“In the instant ease the judgment of February 21, 1922, was the only valid judgment in the ease. If it were void a different situation would be presented. The superior court of Sacramento county, in ordering the petitioner to be taken to Kings county for resentence to the county jail simply interrupted the execution of said judgment of February 21, 1922. It did not vacate, set aside or annul said judgment. Habeas corpus proceedings attack a judgment collaterally only. They simply grant relief against alleged unlawful restraints. Judgments can only be vacated and annulled by direct attack, such as motion to vacate, etc. The judgment of February 21, 1922, still being in full force and effect, petitioner’s present sentence should commence from his original delivery to the state prison under the first judgment and he not be held to have lost nearly three and one-half years’ service credit on his sentence by reason of his present confinement solely under said second void judgment of August 12, 1925. The Supreme Court has heretofore held that the judgment of February 21, 1922, was valid.”
This statement we think in the main fairly sets forth the true status of petitioner’s imprisonment. The judgment of February 21, 1922, is valid. The order of the superior court of Sacramento County did not vacate it or annul it. The commitment issued upon this judgment, and by virtue of which the warden is holding petitioner, is legal and valid and constitutes a legal warrant on the part of the officer *345for the imprisonment of petitioner. His imprisonment would commence to run from the date of his delivery to the prison authorities under this commitment and he is entitled, at least, to credit for the time served thereunder from the date of his first delivery to the prison by virtue of said judgment of February 21, 1922, until the date when he was removed therefrom by order of the superior court of the county of Sacramento. As to the time spent in the county jail of Kings County under the judgment of date December 31, 1924, while he may not be legally entitled to credit therefor upon his imprisonment in the state’s prison, it is a circumstance which the state board of prison directors may well consider when fixing his time of imprisonment.
The writ is denied and the petitioner is remanded to the custody of said warden.
Langdon, J., Shenk, J., Seawell, J., Waste, C. J., and Richards, J., concurred.