
137 N.W.2d 688 (1965)
STATE of Iowa, Appellee,
v.
Alvie TAYLOR, Appellant.
No. 51780.
Supreme Court of Iowa.
October 19, 1965.
Joseph J. DeRaad, Sioux City, for appellant.
Lawrence F. Scalise, Atty. Gen., Don R. Bennett, Asst. Atty. Gen., and Edward F. Samore, County Atty., for appellee.
STUART, Justice.
The sole question presented here is whether a trial judge has the power to set aside a sentence which is not in accordance with the statutory sentence and impose a proper sentence after defendant has entered upon the execution of the sentence when the statutory sentence results in an increased punishment. We hold the trial judge does have such power.
On October 2, 1964 defendant entered a plea of guilty to the crime of attempt to break and enter as defined by Section 708.10, Code of Iowa, which provides: a person who commits such crime "shall be imprisoned in the penitentiary not more than five years, or fined not exceeding three hundred dollars and imprisoned in the county jail not more than one year". (Emphasis supplied.)
The first sentence imposed was imprisonment in the county jail for 12 months. Credit of two months was allowed for time spent in jail between the arrest and the sentencing. There was no provision for any fine. Apparently this defect in the sentence came to the court's attention when defendant, by letter, sought a resentencing because no presentence investigation had been made. The trial court on December 10, 1962 set aside the first sentence and entered a new judgment and sentence increasing the penalty to include a $300 fine.
It is conceded the first sentence imposed by the court was less than the statutory minimum. Defendant argues the sentence however is merely erroneous and not void. Several early Nebraska cases and a few others from foreign jurisdictions are cited which appear to support this position. However this is not the majority rule nor the rule in Iowa.
*689 "Where the sentence imposed is illegal and void, the court may set it aside and pronounce a valid sentence, even though the execution of it has commenced, and without regard to the time when, or term at which it is done. In such a case the new sentence may increase the punishment. * * *
"In the application of the foregoing rules some doubt may arise as to when a sentence is void, and a sentence not permitted by statute or at variance with statutory requirements may be considered void. * * *" 24 C.J.S. Criminal Law § 1589b, p. 604.
"Where a court has imposed a sentence which is void either because of lack of jurisdiction, or because it was not warranted by statute for the particular offense, this can be set aside and a valid sentence substituted." Note: 44 A.L.R. 1212.
We recently answered defendant's argument in State v. Shilinsky, 248 Iowa 596, 602, 81 N.W.2d 444, 448. There defendant was first sentenced to a term in the county jail and required to pay a fine. The statute did not provide for anything but a penitentiary sentence. Two days later the prisoner was recalled and sentenced in accordance with the statute and the indeterminate sentence law. We said:
"But a sentence of the kind pronounced against defendant on April 11 would have had no validity and would not have prevented a later proper sentence, even though it had been properly recorded in the judgment docket. This is for the reason that it did not accord with the sentence provided by the Iowa statute for the offense of which the defendant was convicted. * * *
"The defendant urges that he had begun to serve the first sentence before the second one was imposed, and that the court had lost jurisdiction. This would not be true if no judgment of the court had been rendered, because the supposed sentence had not been spread upon the official judgment record. Nor would it be correct for another vital reason apparent here. The first sentence was void at all times because not permitted by the statutes."
For other Iowa cases holding that the sentence is determined by statute see: Adams v. Barr, 154 Iowa 83, 134 N.W. 564; Cave, Keener v. Haynes, Warden, 221 Iowa 1207, 268 N.W. 39; State v. Boyd, 195 Iowa 1091, 191 N.W. 84.
The only Iowa case cited by defendant is Smith v. District Court, 132 Iowa 603, 109 N.W. 1085. In this case the penalty for manslaughter included both a fine and imprisonment. The first sentence imposed only a prison sentence. Six years after defendant had completed the prison sentence, the county attorney sought a nunc pro tunc order imposing a $500 fine. There we said: "But the ends of justice will not be served by permitting the state to open the judgment record in a criminal case long after the sentence of the law has been discharged for any purpose, and least of all to insert an additional penalty. To permit this to be done would be like punishing the delinquent the second time for the same offense which is denounced by all the courts."
That case differs from the instant case in two important respects. First, there the order was sought on the theory that the fine was part of the first sentence but was omitted from the records by oversight of the clerk. The validity of a sentence contrary to the statute was not discussed. Second, the sentence had been fully executed. We make no determination at this time on the power of the court to correct an invalid sentence after it has been fully executed.
All Iowa cases except the Smith case were decided under the indeterminate sentence law, which is not involved here. However, we do not believe this distinction calls for a different result. The first sentence did not comply with the statute because it did not impose a fine along with the jail sentence. A fine was compulsory, but the amount is discretionary *690 with the trial court. The trial court acted within its discretion and in compliance with the statute when it imposed the maximum fine of $300.
For the reasons hereinabove set out the case is affirmed.
Affirmed.
All justices concur except RAWLINGS, J., who takes no part.
