The defendant is warden of the State penitentiary at Anamosa. The relator was convicted of murder in the Floyd district court, and committed to the penitentiary at Anamosa under a sentence of sixty years. His case was appealed to this court, and after submission the judgment was reversed and the case remanded for a new trial. Pending the appeal, relator served two years three months and twenty days’ actual time of the sentence imposed on him. On his second trial he was convicted of manslaughter, and was sentenced to serve a term in said penitentiary of five years, eight months and eight days. The statute of this State (Oode, section 5468) provides that “ if a defendant, imprisoned during the pendency of an appeal, upon a new trial ordered by the supreme court is again convicted, the period of his former imprisonment shall be deducted from the'period of imprisonment to be fixed on the last verdict of conviction.” Under the statute prescribing the penalty for the crime of manslaughter the maximum term of imprisonment is fixed at eight years. It will thus be seen that the sentence last imposed, added to the actual time served pending appeal from the former conviction, amounted to the full maximum term for which he could be committed. It is the allegation of the petition for the writ that under his first sentence relator earned the good time, so called, allowed by law, amounting to three months and twenty-five days; that in view *134thereof the sentence last imposed was excessive in that no allowance was made in fixing the same for the good time so previously earned. Having served the full term of eight years, counting good time earned under each sentence as allowed by law, this proceeding was commenced.
It is provided by section 5703 of the Code that each prisoner confined in the penitentiary, who shall comply with rales of the institution as to conduct and the performance of duties assigned him, shall be entitled to a diminution of time from his sentence according to a table included in said section. Thereunder one sentenced for a term of eight years shall be deemed to have completed his full term of service at the end of five years and three months. We have, then, the simple question whether, in the case of one appearing for sentence after retrial of his case following a reversal on appeal to this court, has the right to have the good time earned by him under his former sentence considered in determining what further period may be imposed without exceeding the maximum limit allowed by law. We think the question must be answered in the affirmative. The good-time statute confers a privilege, and the benefits thereof cannot be taken away, except as provided for therein. State v. Hunter, 124 Iowa, 569. Good time having been earned, the case stands as though the prisoner had served a period measured by the time of actual incarceration and the good time earned. It follows that the court, in passing judgment upon the last conviction, exceeded the penalty limitation fixed by the statute for the crime of manslaughter, and its judgment was void for the excess. In re Bonner, 151 U. S. 242 (14 Sup. St. 323, 38 L. Ed. 149) ; In re Taylor, 7 S. D. 382 (64 N. W. 253, 45 L. R. A. 136, 58 Am. St. Rep. 843) ; State v. Klock, 48 La. 67 (18 South. 957, 55 Ám. St. Rep. 259) ; Ex parte Bulger, 60 Cal. Rep. 438; People v. Baker, 89 N. Y. 460.
It follows that the lower court rightly ordered the discharge of the relator, and its judgment is affirmed.