OPINION OF THE COURT BY
PETERS, C. J.On March 14, 1922, a writ of habeas corpus ivas issued herein returnable March 21, 1922, before the chief justice. After return the -case was- adjourned into the court.
It appears from the pleadings that the petitioner was convicted' on March 3, 1922, in the circuit court of the first circuit of the crime of rape, pursuant to which on the 6th day of March following judgment was entered on *364the verdict and be was sentenced by tbe court to “imprisonment for a term of not less than ten years or more than bis life-time, and to pay a fine of one hundred dollars, remitting costs, wbicb fine shall be worked out at tbe rate of one dollar a day in case default is made in payment.” On tbe same day a mittimus issued accordingly. After tbe issuance of tbe writ, but before its return, tbe circuit court twice, upon motion of tbe deputy city and county attorney and over the objection of tbe defendant, recalled the defendant, vacated tbe pre-existing sentence and resen-tenced him anew. It is upon tbe last sentence imposed on March 20, 1922, and tbe mittimus of tbe same day, issued pursuant to that sentence, that tbe respondent justifies tbe detention of tbe petitioner. By tbe sentence of March 20, 1922, tbe defendant was ordered to “be imprisoned at bard labor for a term of not less than five years nor more than fifteen years and to pay a fine of one hundred dollars ($100) ; and that in default of tbe payment of said fine, or any part thereof, be be imprisoned for one day in respect to each dollar of such fine so unpaid.”
Tbe petitioner contends that tbe sentence of March 6, 1922, is void upon tbe ground that tbe minimum (10 years) is in excess of tbe minimum permitted by section 3843 R. Jj. 1915, and that this court cannot look to tbe sentence of March 20, 1922, because upon tbe issuance of tbe writ by this court the circuit court lost jurisdiction of tbe defendant and of tbe subject-matter and could not amend nor correct tbe sentence theretofore entered; and even if it could amend or correct tbe sentence of March 6, 1922, tbe sentence of March 20, 1922, was a second sentence for tbe same offense, put tbe petitioner twice in jeopardy for tbe same offense and invaded bis constitutional rights.
Section 3894 R. L. 1915, under wbicb the defendant *365was convicted, prescribes a punishment of “a fine not exceeding one thousand dollars and imprisonment at hard labor for life or any number of years.”
Section 3843 E. L. 1915, in its application to the crime defined and the punishment that may be imposed under the provisions of section 3894, provides: “Whenever any person is convicted of a felony ⅞ ⅝ ⅜ the court in imposing sentence shall not fix the limit or duration of sentence but the term of imprisonment of any person so convicted shall not exceed the maximum nor be less than the minimum term prescribed by law for the crime for which the person was convicted and sentenced; provided, that in all cases in which the maximum sentence in the discretion of the court may be life or any number of years, the court imposing the sentence shall fix the maximum sentence; provided, further, that in all cases in which no minimum sentence is prescribed by law the court imposing sentence shall fix such minimum sentence, which minimum shall not be more than five years, the release of such person to be determined as hereinafter provided.” •
It will thus be seen that it was incumbent upon the trial court to fix the minimum sentence, the maximum-minimum, however, to be not more than five years. The court mistakenly fixed the minimum' at ten years. Were we concerned alone Avith the excess in the minimum sentence—were the judgment in all other respects valid— the petitioner could have no cause for complaint. Section 3843 E. L. 1915 fixes the maximum-minimum sentence at five years and fintil the expiration of the period the judgment would be sufficient in law to justify his detention. Where a court has jurisdiction of the person and of the offense the imposition of a sentence in excess of what the law permits does not render the legal or authorized portion of the sentence void but only leaves such portion of the sentence as may be in excess open to *366question and attack. A sentence is legal so far as it is within the provisions of law and the jurisdiction of the court over the person and the offense and only void as to the excess when such excess is separable and may be dealt with without disturbing the valid portion of the sentence. In other words, the sentence is erroneous and voidable, but not void, and is subject to review upon exceptions or writ of error but not upon habeas corpus. (United States v. Pridgeon, 153 U. S. 49, 62, and cases cited; In re Graham, 138 U. S. 461, 463; In re Taylor, 7 S. D. 382, 45 L. R. A. 136, 58 Am. St. Rep. 843; Ex parte Mooney, 26 W. Va. 36, 53 Am. Rep. 59; Ex parte Blystone, 134 Pac. (Wash.) 827; United States v. Harman, 68 Fed. 472; De Bara v. United States, 99 Fed. 942; Bailey on Habeas Corpus, Sec. 53, p. 178; Re Silva, 23 Haw. 766.)
There is, however, a fatal defect in the sentence of March 6, 1922, in the omission therefrom of the ingredient of “hard labor” prescribed by the statute, which renders the sentence void. (United States v. Harman, 50 Fed. 921, 922; Ex parte Karstendick, 93 U. S. 396, 399; In re Johnson, 46 Fed. 477, 481.)
Nothing else appearing the petitioner would be entitled to his discharge without prejudice to the right of the Territory to take any lawful measures to have the petitioner sentenced in accordance with law upon the verdict against him. (Re Bonner, 151 U. S. 242, 262.) But the Territory has already done this and the trial court on March 20, 1922, resentenced the petitioner in accordance with the laAV and the verdict against him of March 3, 1922. The sentence of March 20 is in all respects valid and this Ye cannot disregard.
This court has recognized the power of the circuit courts to vacate their void judgments (Gouveia v. Nakamura, 13 Haw. 450; Aki v. Aki, 20 Haw. 623) even at a subsequent term (Baker v. Brown, 18 Haw. 22).
*367Where a valid sentence has been rendered in a criminal case tlie court of course cannot resentence the defendant. Tliis would put tlie defendant twice in jeopardy for the same offense and violate the protection afforded Mm by the Constitution. But here the sentence of March 6 was void. Where the sentence is void, not only has the court the power but it is its duty to enter a valid sentence. (McCormick v. The State, 99 N. W. (Neb.) 237; People v. Farrell, 109 N. W. (Mich.) 440; United States v. Harman, supra; 16 C. J. (Criminal Law), Sec. 3098, p. 1315; note 11 Am. & Eng. Ann. Cas. 298; 8 R. C. L. (Criminal Law), Secs. 238, 248; Territory v. Savidge, 14 Haw. 286, 289; Territory v. Armstrong, 22 Haw. 526, 536.)
' “That the petitioner submitted himself to the first judgment is immaterial and the sentence of the court under which the defendant went to prison was void. It was the same in legal effect as if it had been rendered by a justice of the peace or a United States commissioner. ■ Such a judgment would be coram non judice and in contemplation of law Avould be the same as if never rendered; and the defendant would stand as if he had gone voluntarily and surrendered himself to the warden of the prison” (United States v. Harman, supra).
Nor did the issuance of the writ deprive the circuit court of the power to resentence the defendant. The writ was returnable March 21, 1922. The petitioner was last resentenced March 20, 1922. While the question in the first instance Avas the legality of the detention of the petitioner at the time of the issuance of the Avrit and no element could be interjected to oust the court issuing the AArrit of its jurisdiction (In re Doo Woon, 18 Fed. 898), it was not until return to the Avrit that the custody of the petitioner under the original commitment Avas changed. (State v. Sparks, 27 Tex. 705, 709; In re Grant, 67 Pac. (Wash.) 73, 74; Ex parte Thompson, 96 Atl. (N. J.) *368102, 121; In re Kaine, 14 How. (U. S.) 103, 121.) Until the return to the writ the powers of the circuit court in respect to the petitioner remained unabated.
II. T. Mills for petitioner. II. K. Ashforcl, Third Deputy City and County Attorney, for respondent.In the case of Ex parte Gilmore, 12 Pac. (Cal.) 800, the petitioner was legally convicted of an assault and sentenced to fine and imprisonment. The petitioner applied for a writ of habeas corpus and after he was heard thereon the court which pronounced the illegal sentence' vacated it and imposed imprisonment only. The first sentence was pronounced on October 23, 1886, the petitioner was heard on the 28th and the court imposed the second sentence on the 29th of the same month. The second judgment was brought to the attention of the court by a supplementary return and the court said: “We are of the opinion that the first sentence or judgment was illegal and perhaps void. As it was illegal the court which rendered the judgment had power during the term at which the judgment was rendered to call the prisoner, before it, vacate the illegal sentence and impose one in accordance with law. * ⅞ * The petitioner being thus under the control of the Superior Court we should have remanded the petitioner to give an opportunity to the court to do what it has done—have the party brought before it, vacate its illegal sentence and render a legal one. This being done it remains only to say that the petitioner was legally held and he must be remanded to the custody of the sheriff.”
The sentence of March 20, 1922, being in all respects valid the petitioner is not entitled to his discharge and should be remanded to the custody of the respondent and. it is so ordered.