The defendant, Ritchie Lathrop, appeals from his conviction and sentence for third-degree sexual abuse. His appeal was transferred to the court of appeals, where his conviction was affirmed and several claims for postconviction relief were preserved. We granted the defendant’s application for further review to consider two issues: (1) whether his sentence to lifetime parole under Iowa Code section 903B.1 (2007) violated the constitutional prohibition against ex post facto laws, and (2) whether the sentencing court abused its discretion by ordering him to have no contact with anyone under the age of eighteen without the permission of his probation officer. Upon consideration of the record and controlling authorities, we vacate that part of the defendant’s sentence placing him on lifetime parole, as well as the condition of probation prohibiting all contact with anyone under the age of eighteen. We remand to the trial court for the opportunity to impose a less restrictive condition on the defendant’s probation.
I. Background Facts and Proceedings.
The evidence at trial would support a finding that the defendant had sexual relations with Jane Doe at various times during 2005. The defendant was twenty-seven when the relationship began; the victim was fifteen until her birthday in October 2005.
In December 2006, the State charged Lathrop with third-degree sexual abuse. See Iowa Code § 709.4(2)(c )(4) (prohibiting sex act between persons not husband and wife if one person is fourteen or fifteen and other person is four or more years older). A jury convicted Lathrop of this charge, and the court sentenced him to an indeterminate sentence not to exceed ten years. The court suspended the sentence and placed the defendant on probation for three years. In addition to other conditions of his probation, he was ordered to “have no contact with anyone under the age of 18 without the permission of his supervising officer.” Finally, the court determined the lifetime-parole sentence under section 908B.1 1 was applicable and therefore “committed [the defendant] to the custody of the director of the Iowa Department of Corrections for the rest of [his life] ... with eligibility for parole as provided in chapter 906.”
The defendant appealed, and we transferred the case to the court of appeals. That court affirmed his conviction and sentence, and preserved several claims for postconviction relief. We granted further review to address the defendant’s challenge to his sentencing under section 908B.1 and to the no-contáct condition of his probation: 2 The State claims error was not preserved on either claim because the *292 defendant did not object in the district court to the portions of his sentence that he now challenges on appeal. We address the error-preservation issue first.
II. Error Preservation.
A. General Principles. Iowa Rule of Criminal Procedure 2.24(1) states: “Permissible motions after trial include motions for new trial, motions in arrest of judgment, and motions to correct a sentence.” Iowa R.Crim. P. 2.24(1). 3 Only subpart (5) of rule 2.24 addresses motions to correct a sentence, and it simply provides that “[t]he court may correct an illegal sentence at any time.” Iowa R.Crim. P. 2.24(5)(a). We have narrowly interpreted this rule, as a brief historical review illustrates.
In
State v. Wilson,
In the case at hand, there is no procedure under our existing rules for a defendant to raise the issue at the trial court level. He may not be held to have waived his objection by failing to raise it at the sentencing because he had no way to know then that the judge would leave it out of the subsequent judgment. He has no way to raise the defect after judgment because, as we have discussed, a motion to “correct” an illegal sentence under rule 23(5)(a) is the only rule which could be a basis for relief in the trial court, and it is inapplicable here. A defendant without a procedure for raising an’ issue in the trial court obviously cannot be held to have waived his right to appeal.
Id.
at 826 (citation omitted);
accord State v. Marti,
Since our decision in
Wilson,
Iowa appellate courts have held in a variety of circumstances that errors in sentencing need not be first challenged in the district court.
See, e.g., State v. Ayers,
Error-preservation principles applicable to illegal sentences are even broader. As rule 2.24(5)(a) provides, illegal sentences may be corrected at any time. Iowa R.Crim. P. 2.24(5)(a) (“The court may correct an illegal sentence at any time.”);
see also Young,
In summary, errors in sentencing may be challenged on direct appeal even in the absence of an objection in the district court. Illegal sentences may be challenged at any time, notwithstanding that the illegality was not raised in the trial court or on appeal.
B. Preservation of Ex Post Facto Claim. We first consider whether the defendant’s argument that imposition of lifetime parole violates the ex post facto clause is a claim that the sentence is illegal. A challenge to an illegal sentence “includes claims that the court lacked the power to impose the sentence or that the sentence itself is somehow inherently legally flawed, including claims that the sentence is outside the statutory bounds or that the sentence itself is unconstitutional.”
Bruegger,
Here, the defendant contends application of section 903B.1 to conduct that occurred before the statute’s effective date would violate the ex post facto clause. For this reason, he argües it cannot be' constitutionally applied to him. We think this claim, like the one in Bruegger, is a claim that the sentence is inherently illegal. Therefore, the defendant’s claim may be urged on appeal notwithstanding trial counsel’s failure to object to'imposition of the sentence of lifetime parole. Accordingly, we will consider the defendant’s ex post facto challenge to' this aspect of his sentence directly and not under an ineffective-assistance-of-eounsel framework.
C. Preservation of Challenge to Condition of Probation. The defendant does not challenge the sentencing court’s authority to impose conditions on his probation. Rather, he claims the condition of his probation ordering him to have no contact with anyone under the age of eighteen without the permission of his probation officer is unreasonable because its scope is excessive. We think this claim is indistinguishable from the claim made in Bruegger.
“The legislature has given the courts broad, but not unlimited, authority in establishing the conditions of probation.”
State v. Jorgensen,
Probationers are subject to the conditions established by the judicial district department of correctional services subject to the approval of the court, and any additional reasonable conditions which the court or district department may impose to promote rehabilitation of the defendant or protection of the community.
Iowa Code § 907.6 (emphasis added). Although the sentencing judge has discretion with respect to the conditions of probation, that discretion must be exercised “within legal parameters.”
State v. Formara,
This case is distinguishable from cases that concern sentences that are within the court’s statutory and constitutional authority but were proeedurally flawed or imposed in an illegal manner.
See, e.g., Ayers,
Because the defendant’s challenge to the no-contact condition of his probation goes to the court’s authority to impose this condition in this case, his claim is for the correction of an illegal sentence. Therefore, we will consider the defendant’s challenge to this probation condition as a direct challenge and not as a claim of ineffective assistance of counsel.
III. Sentence Under Section 903B.1.
The defendant claims the application of section 903B.1 to him violated the constitutional prohibition against ex post facto laws.
4
See
Iowa Const, art. 1, § 21 (“No ... ex post facto law ... shall ever be passed.”). An ex post facto law includes “one that makes the punishment for
*295
a crime more burdensome after its commitment.”
State v. Iowa Dist. Ct.,
A. Is Section 903B.1 a Criminal or Penal Law? The State suggests section 903B.1 does not impose “punishment.” This issue is a question of legislative intent.
See State v. Pickens,
In examining pertinent indicators of legislative intent, we conclude the statute imposing lifetime parole was intended to be punitive in nature. The bill in which this statute was enacted is entitled “Criminal Justice — DNA Sampling, Sex Offenders and Offenses, and Victim Rights.” 2005 Iowa Acts ch. 158. This bill includes the following summary of its content:
AN ACT relating to criminal sentencing, victim notification, and the sex offender registry, by establishing a special sentence for certain offenders, requiring DNA testing of certain offenders and lengthening the time an information or indictment may be found in certain-offenses where DNA evidence is available, requiring sex offender treatment in order to accumulate earned time, restricting certain persons from residing with sex offenders, establishing a sex offender treatment and supervision task force, providing penalties, and providing effective dates.
Id. (emphasis added). The specific section that imposes lifetime parole on offenders such as the defendant appears in division III of the act, entitled “Enhanced Criminal Penalties and Statute of Limitations.” Id. ch. 158, §§ 35-43. The lifetime-parole provision was codified in Iowa Code chapter 903B, entitled “Special Sentencing and Hormonal Intervention Therapy for Sex Offenders.” Iowa Code ch. 903B. Section 903B.1 is labeled “Special sentence — class ‘B’ or class ‘C’ felonies,” and the statute itself refers to lifetime parole as a “special sentence.” Id. § '903B.1. A “sentence” is generally understood to be “the punishment imposed on a criminal wrongdoer.” Black’s Law Dictionary 1393 (8th ed. 2004). Moreover, the legislature’s use of “parole” as the framework for this special sentence is also significant, as we have held that “[p]arole is a lenient form of punishment that monitors a person’s activities to ensure the person is complying with the law.” State v. Tripp, 776 N.W.2d 855, 858 (Iowa 2010) (emphasis added). We think the legislative history of this *296 statutory provision, as well as the language of the statute, provide clear evidence of legislative intent that lifetime parole is an additional punishment imposed on certain sex offenders.
Courts from other states have similarly concluded that the imposition of lifetime parole on criminal offenders is punishment.
5
See State v. Payan,
In
Payan,
the Nebraska court concluded the legislature’s intent that lifetime supervision be penal in- nature was shown, in part, by the fact that supervision was provided by the parole office of the department of correctional services.-
The same factors found persuasive by the Nebraska Supreme Court exist here with respect to section 903B.1. A defendant subject to a sentence of lifetime parole is committed to “the custody of the director of the Iowa department of corrections for the rest of the person’s life.” Iowa Code § 903B.1. “[T]he person shall begin the sentence under supervision as if on parole,” and is subject to the same procedures and rules adopted “for persons on parole.” Id. (emphasis added). As in Nebraska, this special sentence commences upon completion of the sentence imposed for the underlying criminal offense without any showing that the offend *297 er poses a safety risk. Id. Based on these factors, we are convinced that the imposition of lifetime parole was intended by the legislature to be additional punishment for certain sex offenders. Therefore, this statute is subject to the restrictions imposed by the constitutional prohibition against ex post facto laws.
B. Was Section 903B.1 Applied Retrospectively? In determining whether a new law is retrospectively applied, we ask “ ‘whether the law changes the legal consequences of acts completed before its effective date.’ ”
Iowa Dist. Ct.,
Section 903B.1 became effective on July 1, 2005. See Iowa Code § 3.7(1); 2005 Iowa Acts ch. 158, § 39. The amended trial information in this case alleged the defendant committed the prohibited sex acts with the victim between June 2005 and September 2005. Evidence admitted at trial1 included testimony by the victim that she had sex with the defendant soon after they began dating in March 2005. In addition, two witnesses testified to a specific sexual act occurring between the defendant and the victim in June 2005.
The jury was instructed that, to establish the defendant committed sexual abuse in the third degree, it must find, among other facts, that, “[d]uring the months of June through September 2005, the defendant performed a sex act with [the victim].” The jury returned a general verdict finding the defendant “guilty of the crime of Sexual Abuse in the Third Degree as charged in the Trial Information.” The general verdict form used by the jury did not require it to make a determination of or specify the dates on which the illegal sex acts occurred.
When circumstances make it impossible for the court to determiné whether a verdict rests on a valid legal basis or on an alternative invalid basis, we give the defendant the benefit of the doubt and assume the verdict is based on the invalid ground.
See, e.g., State v. Heemstra,
We recently considered the application of this rule in
State v. Cowles,
We have such a case of uncertainty here. There is no way to determine whether the jury based its verdict on conduct that occurred before or after the effective date, of the law imposing a sentence of lifetime parole. Therefore, we must presume the verdict rests on conduct that occurred before the enactment of the lifetime-parole law. Consequently, section 903B.1 has been applied retrospectively in this case.
C. Has the Retroactive Application of Section 903B.1 Increased Defendant’s Punishment? The second element of the ex post facto analysis is whether the statutory change “alters the definition of criminal conduct or increases the penalty by which a crime is punishable.”
Morales,
We think it clearly does. As we have discussed above, lifetime parole is a form of punishment; it is an additional sentence on the specified sex offenders. As such, it increases the penalty for the defendant’s crime. Accordingly, the inclusion of lifetime parole in the defendant’s sentence for conduct occurring prior to the effective date of section 903B.1 violates the ex post facto clause of the Iowa Constitution.
See State v. Simnick,
IV. Condition of Probation.
The defendant contends the district court abused its discretion in ordering him to have no contact with any person under eighteen years of age as a condition of his probation. The State asserts this condition is reasonable in view of the defendant’s offense. We will interfere with the trial court’s terms of probation only upon a finding of abuse of discretion.
See State v. Valin,
As noted above, “[t]he legislature has given the courts broad, but not unlimited, authority in establishing the
*299
conditions of probation.”
Jorgensen,
Additionally, “[a] condition [of probation] is not reasonable if it is found to be ‘unnecessarily harsh or excessive in achieving [the] goals’ ” of rehabilitation and community protection.
United States v. Friedberg,
[A] reasonable nexus must exist between any special condition of probation and the crime for which it is imposed. A condition of probation which requires or forbids conduct which is not itself criminal is valid [only] if that conduct is reasonably related to the crime of which defendant was convicted or to future criminality.
21A Am.Jur.2d
Criminal Law
§ 846, at 33-34 (footnotes omitted);
accord Jorgensen,
The defendant points to several perceived flaws in the no-contact probation condition, asserting this restriction is too broad, rendering it unreasonable and an abuse of discretion. We agree that the no-contact condition of the defendant’s probation is unnecessarily excessive. Certainly, given the circumstances of the defendant’s offense, it is reasonable for the court to restrict the defendant’s interaction with minors.
6
But the condition imposed here literally prohibits any and all contact with any person under the age of eighteen regardless of how unintended, incidental, or innocuous such contact might be unless the defendant has obtained permission from
*300
his supervising officer.
Cf. State v. Hall,
The Vermont Supreme Court refused to enforce an almost identical probation restriction in
State v. Rivers,
[T]his common probation condition could extend to any number of other public places where children are regularly present such as grocery stores, movie theatres, libraries, fast-food restaurants, *301 parks, or even downtown streets all across Vermont where children often congregate in large numbers after school and during the summer months. When removed from the context of victim-contact or private locations where different considerations apply, such a broad rule severely restricts a probationer’s liberty while doing little to rehabilitate the offender or prevent the behavior that led to the no-contact condition in the first place.
Id. at 1075. The court concluded this “blanket no-contact condition” was “over-broad and unduly restrictive of probationer’s freedom and autonomy” and lacked “sufficient precision.” Id. at 1074, 1076.
For the same reasons, we conclude the challenged probation condition here is unreasonable, and the district court abused its discretion in imposing it.
See Hall,
V. Conclusion and Disposition.
That part of the defendant’s sentence imposing lifetime parole under section 903B.1 violates the ex post facto clause of the Iowa Constitution. In addition, the condition placed on the defendant’s probation prohibiting contact with any person under the age of eighteen without approval of his supervising probation officer is an abuse of discretion. Therefore, we vacate those parts of the defendant’s sentence subjecting him to lifetime parole and imposing the blanket no-contact condition on his probation. To the extent the court of appeals reached contrary conclusions, we vacate the court of appeals’ decision. This case is remanded to the district court for resentencing as directed in this opinion.
DECISION OF COURT OF APPEALS VACATED IN PART; SENTENCE VACATED IN PART AND CASE REMANDED FOR RESEN-TENCING.
Notes
. Iowa Code section 903B.1 provides in pertinent part:
A person convicted of a class "C” felony or greater offense under chapter 709 ... shall also be sentenced, in addition to any other punishment provided by law, to a special sentence committing the person into the custody of the director of the Iowa department of corrections for the rest of the person's life, with eligibility for parole as provided in chapter 906 [parole and work release]. The special sentence imposed under this section shall commence upon completion of the sentence imposed under any applicable criminal sentencing provisions for the underlying criminal offense and the person shall begin the sentence under supervision as if on parole.
Iowa Code § 903B.1.
. The court of appeals' disposition of the issues raised by the defendant and not addressed in this opinion stands as the final decision in this appeal.
. Rule 2.24 was originally found in Iowa Code section 813.2 (1979). With respect to motions to correct a sentence, the rule is substantially the same now as it was in 1979. Compare Iowa Code § 813.2 (1979), with Iowa R.Crim. P. 2.24(1).
. Although the defendant has alleged a violation of both the federal and state constitutions, we find it unnecessary to address the federal constitutional claim, as we find the state constitutional claim dispositive.
. The statutory schemes in Nebraska, Nevada, and New Jersey are substantially similar to Iowa's section 903B.1. See Neb.Rev.Stat. § 83-174.03 (2007) (requiring that certain sex offenders, upon completion of their term of commitment, "be supervised in the community, by the Office of Parole Administration for the remainder of his or her life”); Nev.Rev. Stat. § 176.0931 (2009) (providing for "special sentence of lifetime supervision” for specified sex offenders, to commence after any term of imprisonment or period of parole is served); N.J. Stat. § 2C:43-6.4 (2005) (imposing "a special sentence of parole supervision for life” on persons convicted of certain sexual offenses, such sentence to "commence immediately upon the defendant's release from incarceration”).
. The court separately prohibited contact between the defendant and the victim and her family.
. In addition to the Vermont Supreme Court, intermediate courts of appeal in two states held in unpublished opinions that similar blanket no-contact conditions on probation were unduly restrictive.
See State v. Lacey,
No. 23261,
