Sher(ry McWilliams was convicted of a misdemeanor, and sentenced to hard labor for the county for 10 days as a punishment for the offense, and '■for a term of 60 days (not to exceed 10 months at the rate of 40 cents per day) to satisfy the costs of this prosecution, amounting to $23.75, and said hard labor to commence on the 8th day of May, 1911, and terminate on the 20th day of July, 1911.” The petition for the writ of habeas corpus in behalf of the convict was sued out on the 12th day of July, 1911, before the date named in the judgment for the expiration of the sentence to hard labor for the costs. On the hearing of the application, no question was raised as to the validity of that part of the judgment of conviction constituting the punishment of the offense charged. The bill of exceptions recites: “It was agreed upon the part of the petitioner and on the part of the state that, if allowed for and estimated at the rate of 75 cents per day, the costs in the case, wherein the said Sherry McWilliams was sentenced, had, before the presentation of this petition, been fully paid and satisfied by his hiring, if such hiring be estimated and allowed for at the rate of 75 cents per day; bnt that such costs had not been paid, if such hiring be estimated at the rate of 40 cents per day.” It is plain that the attack on the judgment of conviction under which the convict was detained was directed against the part of it imposing hard labor for the payment of the court costs, the judgment on its face disclosing that the court, as to that feature of its sentence, followed the provision of an act of the Legislature, approved November 30, 1907 (General Laws [Sp. Sess.] *5311907), undertaking to prescribe a rate of 40 cents per day, to be allowed convicts in working out the costs which act was subsequently, in the the case of Dowling v. City of Troy, 172, Ala., 56 South. 118, decided to be unconstitutional, when it should have followed, as to this feature of its judgment, the provision of section 7635 of the Code, prescribing a rate of 75 cents per day.
It appearing that the court rendering the judgment of conviction had jurisdiction of the person and of the offense, and that a separable part of its judgment — the part imposing punishment for the offense charged— was authorized by law, it seems plain that the defendant in the judgment was not entitled to be discharged on the habeas corpus, under the rule, recognized by a line of authorities.in this state, that such is the result when the judgment as an entirety, under which the defendant is detained, is a nullity.—Ex parte McKivett, 55 Ala. 236; Ex parte State, In re Long, 87 Ala. 48, 6 South. 328; Ex parte Pearce, 111 Ala. 99, 20 South. 343; Ex parte Mayor and City Council of Anniston, In re Ballew, 84 Ala. 21, 3 South. 910; Ex parte City Council of Montgomery, 70 Ala. 275; Ex parte Brown, 102 Ala. 179, 15 South. 602. In the opinion rendered in the case of Ex parte State, In re Long, supra, it was recognized that the rule applied in that case would not have been applicable if a. separable part of the judgment had been such as was authorized by law; the court saying that, “had the justice sentenced the petitioner to 10 days hard labor for- the costs, we should have regarded the latter part of the sentence only as void, and the petitioner would have been required to work out the 10 days before being entitled to a discharge.”
In another series of cases in this state, it is recognized that a petitioner in habeas corpus is not entitled to *532treat his detention as unauthorized fijom the beginning, so as to entitle him to a discharge, when, he is held under a judgment which is not void throughout, but is merely infected by errors or irregularities, for the correction of which a remedy is afforded by appeal from the judgment.—Ex parte Simmons, 62 Ala. 416; Ex parte Hardy, 68 Ala. 315; Herrington v. State, 87 Ala. 3, 5 South. 831; Ex parte Bizzell, 112 Ala. 210, 21 South. 371; Ex parte Roberson, 123 Ala. 103, 26 South. 645, 82 Am. St. Rep. 107.
So far as we have been able to discover, there has not heretofore been occasion in this state to pass upon the question of the right of a petitioner in habeas corpus to be discharged, when it is made to appear that at the time his application was made he had already served the separable part of his sentence which was authorized by law; his complaint being based, not on the untenable ground that the judgment of conviction, considered as a whole, was void and not merely erroneous, but that he was being detained beyond the period of sentence which the court was authorized by law to impose. Un-' der, the rulings last above cited, such a judgment, under which the petitioner is being detained at the time his application is made, may not be treated as a nullity, as being, to that extent, in excess of the power and jurisdiction of the court. The expression above quoted from the opinion of the court in the case of Ex parte Btate, In re Long, supra, at least indicates that, if a separable part of the petitioner’s sentence had been within the jurisdiction of the court, and another, part of it in excess of such jurisdiction, the petitioner would not have been discharged, if it had not been made to appear that he was, at the time of his application, being detained under the invalid portion of the sentence.
*533The question suggested has received abundant consideration in other jurisdictions. It is believed that the following statement, deduced from the rulings of the Supreme Court of the United States on this subject, correctly summar,izes the rules sustained by the great weight of authority: “Where a court has jurisdiction of the person and of the offense, the imposition of a judgment or sentence in excess of what the law permits, is an irregularity merely, and does not render the legal or authorized portion of the judgment or sentence void, but leaves that portion only Avhich is excessive open to question and attack on habeas corpus, and after the prisoner has fulfilled the authorized portion thereof. The prisoner will not be discharged on habeas corpus, until he has performed, or offered to perforan, so much of the order as is within the power of the court to impose, when the excessive portion of such judgment or sentence is separable, and may be relieved against without disturbing the valid portion. The excessive portion of a judgment or sentence is separable when it exceeds in its extent the duration of time prescribed by law. * * * Where the excessive and authorized portions of the judgment or sentences are incapable of being separated, so that the latter may be performed despite a discharge from the former, the whole must be treated as. a nullity, subject to be released from on habeas corpus.”—6 Enc. of U. S. Sup. Ct. Rep. 651, 652; In re Swan,, 150 U. S. 637, 14 Sup. Ct. 225, 37 L. Ed. 1207; U. S. v. Pridgeon, 153 U. S. 48, 14 Sup. Ct. 746, 38 L. Ed. 631; In re Bowner, 151 U. S. 242, 14 Sup. Ct. 323, 38 L. Ed. 149; Ex parte Lange, 18 Wall. 163, 21 L. Ed. 872; Harris v. Lang, 7 A. & E. Ann. Cas. 141-144, and authorities cited in note; In re Taylor, 7 S. D. 382, 64 N. W. 253, 45 L. R. A. 136, 58 Am. St. Rep. 843; U. S. v. Peake, 153 Fed. 166, 82 C. C. A. 340, 12 L. R. A. (N. *534S.) 314; Ex parte Taylor, 64 N. W. 253, 45 L. R. A. 136, 58 Am. St. Rep. 843; In re Tam, 29 Nev. 385, 91 Pac. 137, 13 L. R. A. (N. S.) 518, 12 Cyc. 782; Church on Habeas Corpus (2d. Ed.) § 373.
In view of the elaborate consideration of the subject in some of the authorities above referred to, it is not believed that any useful purpose would be served by an attempt to restate the reasons which have led to the conclusions above summarized. It is enough to say that an examination of the authorities and of the reasoning upon which they are based has led the court to the conclusion that when it is made to appear in habeas corpus proceedings that the petitioner, at the time his application was made, was being detained under a separable part of the judgment and sentence against him, which is void as being in excess of the power of the court to impose, he is entitled to his discharge, though the judgment under which his detention commenced was, as an entirety, not void, but merely irregular and erroneous.
In the present case, as the length of time to which the defendant was legally subject to sentence to hard labor for the costs of the suit was determined by merely ascertaining how long it would require the defendant to pay the ascertained amount of costs by his service at the rate of 75 cents a day, it is plain that so much of the sentence as extends beyond the period so ascertained was in excess of the authority conferred on the court by law. It having been made to appear that the defendant had served at hard labor for the period of time to which he was sentenced as a punishment for the offense, and also for the period for( which he could have been legally sentenced for the costs, the order for his discharge was proper.
Affirmed.