CADY, Chief Justice.
A criminal defendant was convicted of two counts of sexual abuse in the third degree. Although one count constituted a forcible felony, the district court suspended the defendant’s prison sentence and instead ordered a five-year term of probation. After the defendant served four years, four months, and four days of probation, the district .court vacated the suspended sentence for illegality and resen-tenced the defendant to two concurrent ten-year terms of incarceration. The court declined to credit the time spent on probation against the new term of imprisonment.
On our review of a decision by the court of appeals, we find the failure to award credit for time spent on probation pursuant to the initial sentence violates the Double Jeopardy Clause of the Fifth Amendment to the United States Constitution. Double jeopardy prohibits imposing multiple punishments for’ the same offense. When an initial sentence is voided for illegality, any punishments already endured must be credited against the corrected sentence. We hold that all time spent on probation pursuant to a voided sentence must be fully credited against a corrected sentence of incarceration.
I. Factual Background and Proceedings.
On August 24, 2011, following a jury trial, Christopher Jepsen was convicted of one count of sexual abuse in the third degree, in violation of Iowa Code section 709.4(2)(c) (2009), and one count of sexual abuse in the third degree, in violation of Iowa Code section 709.4(2)(6). The victim of the crime described in the second count was thirteen years old, which made the crime a forcible felony under section 702.11. On September 23, 2011, the district court sentenced Jepsen to two ten-year periods of incarceration, but suspended the sentences and placed him on probation for five years. The conditions of probation included completing a cognitive empathy course, maintaining consistent employment, and participating in any rehabilitative programs that his probation officer deemed necessary, such as placement in a residential treatment facility.
On October 28, 2014, the State applied to revoke Jepsen’s probation. It argued Jepsen violated the terms and conditions of his probation, based on his admission to his probation officer that he had been viewing pornographic images of children. Yet, the application to revoke Jepsen’s probation never came before the court for a hearing. Instead, further investigation into Jepsen’s probation violation revealed a potential illegality in his initial suspended sentence.
On December 21, 2015, the State filed a motion to correct Jepsen’s illegal sentence pursuant to Iowa Court Rule 2.24(5). The State argued Jepsen was convicted of a forcible felony and was therefore ineligible for a suspended sentence under Iowa Code section 907.3. Jepsen’s counsel raised a number of arguments, including that if the court imposed a new sentence, Jepsen should be awarded “credit for his time served on probation from 9/26/11 through the present.”
On January 29, 2016, the district court concluded it had lacked authority to suspend Jepsen’s prison sentence in 2011. Accordingly, it found the sentence was illegal and vacated it. The court then conducted a new sentencing hearing and sentenced Jepsen to two concurrent ten-year periods of incarceration. The district court did not suspend either sentence and only awarded credit for time served in the county jail pursuant to Iowa Code section 903A.5. The court determined credit for probation was not applicable to a new sentence of incarceration. As of the date of resentencing, Jepsen had served four years, four months, and four days of his five-year probation sentence.
Jepsen appealed the new sentence. He claimed his counsel was ineffective for failing to argue that the Double Jeopardy Clause of the Fifth Amendment to the United States Constitution required the time Jepsen spent on probation be credited against his corrected sentence. We transferred the case to the court of appeals.
The court of the appeals addressed the issue by considering whether the total punishment imposed exceeded the punishment intended by the legislature. It found the legislature only intended to award credit for days on probation spent in an alternate jail or community correctional residential treatment facility. Consequently, the court remanded the case to the district court to determine whether Jepsen spent any time in an alternate jail or residential treatment facility and, if so, instructed the district court to credit such days against his new prison sentence. Jep-sen sought, and we granted, further review.
II. Standard of Review.
Jepsen raises a double jeopardy challenge to his corrected sentence through an ineffective-assistanee-of-coun-sel claim. We review double jeopardy claims de novo. State v. Stewart, 858 N.W.2d 17, 19 (Iowa 2015). An illegal sentence may be corrected at any time. Iowa R. Crim. P. 2.24(5)(a). Therefore, if Jep-sen’s corrected sentence violates double jeopardy, we will not review counsel’s effectiveness.
III. Analysis.
A. Double Jeopardy Prohibits Multiple Punishments. The Fifth Amendment to the United States Constitution guarantees no person shall “be twice put in jeopardy of life or limb” for the same offense. U.S. Const, amend. V. The principle is enforceable against the states through the Fourteenth Amendment. Benton v. Maryland, 395 U.S. 784, 794, 89 S.Ct. 2056, 2062, 23 L.Ed.2d 707 (1969).
Double jeopardy’s protections have ancient roots. During the sixth century, the Digest of Justinian instructed that “the governor should not permit the same person to be again accused of a crime of which he had been acquitted.” Jay A. Sigler, A History of Double Jeopardy, 7 Am. J. Legal Hist. 283, 283 (1963) (quoting Digest of Justinian, Book 48, Title 2, Note 7, as translated in Scott, The Civil Law (1932), XVII). William Blackstone wrote in his seminal Commentaries that
the plea of auterfoits acquit, or a former acquittal, is grounded on this universal maxim of the common law of England, that no man is to be brought into jeopardy of his life, more than once, for the same offence.
4 William Blackstone, Commentaries on the Laws of England 329 (Legal Classics Library ed. 1983). Indeed, in 1641, the Massachusetts Body of Liberties—the first legal code in the New World—ensured, “No man shall be twise sentenced by Civill Justice for one and the same Crime, of-fence, or Trespasse.” The Body of Liberties of 164-1 ¶ 42, in A Bibliographical Sketch of the Laws of the Massachusetts Colony from 1630 to 1686 (William H. Whitmore ed. 1890).
Double jeopardy, as developed by the United States Supreme Court, encompasses three primary guarantees: “It protects against a second prosecution for the same offense after acquittal. It protects against a second prosecution for the same offense after conviction. And it protects against multiple punishments for the same offense.” North Carolina v. Pearce, 395 U.S. 711, 717, 89 S.Ct. 2072, 2076, 23 L.Ed.2d 656 (1969) (footnotes omitted), overruled on other grounds by Alabama v. Smith, 490 U.S. 794, 798, 109 S.Ct. 2201, 2204, 104 L.Ed.2d 865 (1989). Double jeopardy, therefore, restrains prosecutors from continuously trying defendants until the right theory or jury produces a conviction, as well as restrains the judiciary from exceeding the bounds of its authority and imposing greater punishments than intended by the legislature.
The Supreme Court in Ex Parte Lange first recognized that double jeopardy prohibits courts from imposing a second punishment “in the same court, on the same facts, for the same statutory offence.” 85 U.S. (18 Wall.) 163, 168, 21 L.Ed. 872 (1873). In Lange, the defendant was convicted of stealing government mailbags, an offense punishable by one year in prison or a $200 fine. Id. at 164. However, the trial court erroneously sentenced the defendant to one year in prison and a $200 fine. Id. After the defendant had paid the fine in full and served five days in prison, the court recognized its error and vacated the original sentence. Id. At resentencing, it ordered the defendant to serve one year in prison. Id. The Supreme Court reversed, finding the corrected sentence violated double jeopardy. Id. at 175.
In deciding the case, the Court observed the constitutional principle of double jeopardy “was designed as much to prevent the criminal from being twice punished for the same offence as from being twice tried for it.” Id. at 173. “For of what avail is the constitutional protection against more than one trial if there can be any number of sentences pronounced on the same verdict?” Id. Thus, once the fíne was paid as required under the first sentence, the defendant had served one of the two permissible statutory sentencing options. As a result, the second sentence would serve to punish him twice if imposed. The Court emphasized that the Double Jeopardy Clause was not animated by the threat of being twice found guilty, but rather the threat of being twice punished for the same act. Id. Furthermore, double jeopardy’s protections were not curtailed in any way by the intention of the sentencing court in both sentences to impose the statutory alternative of imprisonment.
In Pea/rce, the Court again examined the boundaries of imposing multiple punishments for the same underlying criminal act. The Court reviewed the sentence of William Rice, who was convicted of burglary and served two and a half years in prison before his conviction was overturned. 895 U.S. at 714, 89 S.Ct. at 2075. Rice was retried, convicted again, and re-sentenced to twenty-five years in prison with no credit for the two and a half years he served under the initial sentence. Id. The Court reversed the new sentence, holding the Fifth Amendment “absolutely requires that punishment already exacted must be fully ‘credited’ in imposing sentence upon a new conviction for the same offense.” Id. at 718-19, 89 S.Ct. at 2077 (footnote omitted). The Court aptly noted that
[i]f, upon a new trial, the defendant is acquitted, there is no way the years he spent in prison can be returned to him. But if he is reconvicted, those years can and must be returned—by subtracting them from whatever new sentence is imposed.
Id. at 719, 89 S. Ct. at 2077. Thus, the Double Jeopardy Clause was applied, as in Lange, to give the defendant credit for the sentence served against the new sentence imposed.
Although Pearce dealt with a defendant who was retried and reconvicted after his initial sentence was deemed unconstitutional, we believe the mandate is not limited to its facts. Indeed, the Court explained when an initial conviction has been overturned, the defendant’s sentence has “been wholly nullified and the slate, wiped clean.” Id. at 721, 89 S.Ct. at 2078. However, the Court took care to acknowledge that this “premise” is an “unmitigated fiction” with respect to “whatever punishment has actually been suffered under the first conviction.” Id. Consequently, if a defendant’s initial conviction is overturned because the defendant was deprived of a constitutionally required procedure or if a defendant’s initial sentence is voided for illegality, it remains an “unmitigated fiction” to find that the punishment endured has been “wiped clean.” Therefore, we conclude that when a defendant’s original sentence is voided for illegality and the defendant is subsequently resentenced without being again convicted, Pearce requires courts to fully credit any punishment already endured against the new sentence.
Awarding credit for punishments already endured is in line with double jeopardy’s guarantee that a defendant’s “total punishment [does] not exceed that authorized by the legislature.” United States v. Halper, 490 U.S. 435, 450, 109 S.Ct. 1892, 1903, 104 L.Ed.2d 487 (1989), abrogated on other grounds by Hudson v. United States, 522 U.S. 93, 95, 118 S.Ct. 488, 491, 139 L.Ed.2d 450 (1997). Because of this protection, a court must first determine whether the legislature intended a criminal act to be cumulatively punished before sentencing a defendant under multiple statutory provisions for a single criminal transaction. See Blockburger v. United States, 284 U.S. 299, 803-04, 52 S.Ct. 180, 182, 76 L.Ed. 306 (1932). Such an inquiry guarantees “sentencing courts do not exceed, by the device of multiple punishments, the limits prescribed by the legislative branch of government, in which lies the substantive power to define crimes and prescribe punishments.” Jones v. Thomas, 491 U.S. 376, 381, 109 S.Ct. 2522, 2525-26, 105 L.Ed.2d 322 (1989).
The Supreme Court in Ohio v. Johnson clarified the distinction between the two multiple-punishment inquiries. 467 U.S. 493, 104 S.Ct. 2536, 81 L.Ed.2d 425 (1984).
In contrast to the double jeopardy protection against multiple trials, the final component of double jeopardy—protection against cumulative punishments—is designed to ensure that the sentencing discretion of courts is confined to the limits established by the legislature. Because the substantive power to prescribe crimes and determine punishments is vested with the legislature, the question under the Double Jeopardy Clause whether punishments are “multiple” is essentially one of legislative intent. But where a defendant is retried following conviction, the Clause’s third protection ensures that after a subsequent conviction a defendant receives credit for time already served.
Id. at 499, 104 S. Ct. at 2540-41 (footnote omitted) (citations omitted).
In sum, the legislature has the substantive power to define criminal activity and its attendant punishment. If the legislature directs, a defendant may be sentenced pursuant to multiple criminal statutes. However, when a defendant has been convicted and is subsequently resen-tenced, the Constitution requires the defendant be awarded credit for punishments already endured under the original sentence. The legislature’s substantive powers do not override a defendant’s constitutional guarantee against being twice punished for the same conviction. As such, we do not look to whether the legislature intended a defendant to receive credit for his time served. Rather, we look to whether the defendant has in fact been punished and, if so, what credit the defendant should receive against the new sentence. Thus, in this case, we must look to see if Jepsen was punished when he was placed on probation and, if so, what credit he should receive for serving that sentence.
B. Probation Is Punishment. It is well-settled that probation is a form of punishment. “[A] probation order is ‘an authorized mode of mild and ambulatory punishment’ ” and is “ ‘intended as a reforming discipline.’ ” Korematsu v. United States, 319 U.S. 432, 435, 63 S.Ct. 1124, 1126, 87 L.Ed. 1497 (1943) (quoting Cooper v. United States, 91 F.2d 195, 199 (5th Cir. 1937)). “The probationer is not a free man, but is subject to surveillance, and to such restrictions as the court may impose.” Cooper, 91 F.2d at 199. We have previously held “lifetime parole is a form of punishment,” as “it increases the penalty for the defendant’s crime.” State v. Lathrop, 781 N.W.2d 288, 298 (Iowa 2010).
Other courts that have addressed this issue have easily concluded that probation is punishment for double jeopardy purposes. In United States v. Martin, the United States Court of Appeals for the First Circuit readily found that double jeopardy’s crediting principle “applies to sentences of probation which, although not as harsh as imprisonment, are nonetheless ‘punishments’ imposed for the offenses of conviction.” 363 F.3d 25, 37 (1st Cir. 2004). Similarly, in United States v. McMillen, the Third Circuit vacated a defendant’s partially served three-year probation sentence and instructed that the Pearce credit requirement was “equally applicable” to the defendant’s resentencing. 917 F.2d 773, 774, 776 (3d Cir. 1990). Finally, in Kennick v. Superior Court of California, the Ninth Circuit concluded double jeopardy’s protections contemplate probation, as probation imposes “a moderately intrusive regime of government supervision and regulation.” 736 F.2d 1277, 1282 (9th Cir. 1984). The court further stated,
In this case, as in Pearce, the defendant was subjected to punishment as the result of a mistake to which the government was a party. In Pearce, the offending governmental entity was the court; here, it is the Probation Department. In both cases, the government has been permitted to correct its mistake and proceed. But, in both instances, the Constitution requires that the defendant not be made to suffer as a result of a mistake in which the government participated. Consequently, appellant, like the defendant in Pearce, must be credited for time already served.
Id. at 1283.
Probation is a set of conditions exacted by a court of law as a consequence for the defendant’s criminal conduct. Even though it is not the most restrictive means of punishment, the liberty of a probationer is nevertheless affirmatively restrained throughout the term of probation. Jepsen, for example, was ordered to complete a cognitive empathy course and “maintain gainful and full-time employment at a lawful occupation unless excused by [a] probation officer for schooling, training, or other acceptable reasons.” If Jepsen’s probation officer deemed it necessary, Jepsen would be required to enter a “Residential Treatment Facility (and follow all rules of said facility and successfully complete the program).” Jepsen was also ordered to register as a sex offender, obtain a sex offender evaluation, and comply with “any and all sex offender treatment.” The requirements associated with the sex offender registry are substantial. Finally, Jepsen was ordered to “participate in any other programs deemed necessary for his rehabilitation by his probation officer.” On top of these specific mandates, Jepsen was required to abide by all of the general probation requirements, including regular meetings with his probation officer.
A probationer restrained by these terms unquestionably experiences “mild and ambulatory punishment.” Korematsu, 319 U.S. at 436, 63 S.Ct. at 1126 (quoting Cooper, 91 F.2d at 199). As such, the rationale of Pearce is fully applicable. The time spent on probation, either within a residential treatment facility or otherwise subject to the conditions and surveillance of the judicial district department of correctional services, cannot be returned to a probationer. Of course, if a probationer fails to abide by the conditions of probation, the State is free to seek revocation. Because Jepsen spent four years, four months, and four days on probation prior to resentencing, we must now determine how to credit this restraint under the principle of double jeopardy against his new sentence of incarceration.
C. Credit for Time Spent on Probation. The State argues Jepsen should not receive a credit against a new sentence of incarceration for the time he was on probation because the nature of probation is dissimilar from incarceration, and such a credit would permit defendants like Jepsen to “escape any real punishment.” While the argument seeks to draw the ultimate punishment in line with the punishment intended under the statute, the question is whether this approach conforms to the constitutional construct at issue.
Some courts have attempted to craft standards to calculate the appropriate credit owed to a defendant who has served time on probation prior to being resen-tenced to a term of incarceration. In Martin, the First Circuit concluded “the proper means for crediting probation, including home detention, against imprisonment is a downward departure by the district court upon remand.” 363 F.3d at 39. The court instructed that “[t]he amount of any departure should depend on the specific conditions of Martin’s probation and the effect of a sentence reduction on the underlying purposes of the” federal sentencing guidelines. Id. However, the court cautioned against awarding day-for-day credit, as such a sentence “would be too lenient to represent the punishment that Congress intended.” Id. at 39-40. Moreover, the court instructed that any period a defendant spent “on probation after his period of home detention should reduce any new sentence of imprisonment to an even lesser degree, reflecting its less restrictive conditions.” Id. at 40.
In United States v. Derbes, the United States District Court for the District of Massachusetts declined to create a uniform formula for calculating credit and, instead, found the question should be resolved by considering “all of the circumstances of the case, including those that are personal to the defendant.” No. CR NO. 02-10391-RGS, 2004 WL 2203478, at *2 (D. Mass. Oct. 1, 2004). In applying this standard, the court weighed
the conditions of the sentence itself, ... Derbes’ remorse, his mental fragility, his evident anguish at the prospect of having to twice face the prospect of imprisonment, his charitable works in the Quincy community, and his role in reviving a business on which some thirty people depend for their livelihoods.
Id. The court concluded the defendant’s new term of imprisonment should be reduced by six months to account for the prior nine months of home detention and seventeen months of probation. Id.
We acknowledge that many reasons can be articulated to support a rule that would recognize less than full credit, or no credit, for time served on probation. Yet, none of these reasons overcome the fundamental flaw of either approach, which is the failure to accept that probation is a form of punishment of constitutional dimension. Instead, the approaches accept the flaw as a means to protect against a sentencing outcome less severe to the defendant than the statute intended. The no-credit approach simply ignores probation’s constitutional station and the less-than-full-credit approach uses a loose and arbitrary analysis to give the constitutional command lip service.
Both approaches implicitly guard against any benefit to the defendant from the application of the constitutional principles at stake. This is not, however, the approach of our constitutional analysis. Our Constitution is applied to protect the values and principles it gives to people, despite the cost to the state or a windfall to the defendant. Cf. Mapp v. Ohio, 367 U.S. 643, 659, 81 S.Ct. 1684, 1693-94, 6 L.Ed.2d 1081 (1961) (“There are those who say ... that under our constitutional exclusionary doctrine, ‘[t]he criminal is to go free because the constable has blundered.’ In some cases this will undoubtedly be the result. But ... ‘there is another consideration—the imperative of judicial integrity.’ The criminal goes free, if he must, but it is the law that sets him free.” (footnote omitted) (citations omitted) (first quoting People v. Defore, 242 N.Y. 13, 150 N.E. 585, 587 (1926); then quoting Elkins v. United States, 364 U.S. 206, 222, 80 S.Ct. 1437, 1447, 4 L.Ed.2d 1669 (1960))); Weeks v. United States, 232 U.S. 383, 393, 34 S.Ct. 341, 344, 58 L.Ed. 652 (1914) (“The efforts of the courts and their officials to bring the guilty to punishment, praiseworthy as they are, are not to be aided by the sacrifice of those great principles established [by] years of endeavor and suffering which have resulted in their embodiment in the fundamental law of the land.”); State v. Cline, 617 N.W.2d 277, 292 (Iowa 2000) (“The inevitable result of the Constitution’s prohibition against unreasonable searches and seizures ... is that police officers who obey its strictures will catch fewer criminals.... [That] is the price the framers anticipated and were willing to pay to ensure the sanctity of the person, home and property against unrestrained governmental power.”) (alteration in original) (quoting Potter Stewart, The Road to Mapp v. Ohio and Beyond: The Origins, Development and Future of the Exclusionary Rule in Search-and-Seizure Cases, 83 Colum. L. Rev. 1365, 1393 (1983)), abrogated on other grounds by State v. Turner, 650 N.W.2d 601, 606 n.2 (Iowa 2002).
The guarantee under the Double Jeopardy Clause relevant to this case protects against the imposition of punishment greater than that intended by the legislature. Thus, the requirement of a credit under Pearce served to guard against the imposition of greater punishment. This constitutional mandate of a credit was not concerned with the risk that it might result in a lesser sentence, but served to guarantee against the risk of a greater sentence. Therefore, this guarantee necessarily accepts the risk of a lesser sentence to ensure the guarantee of no greater sentence. Justice can often be served by a context-specific inquiry, but such an inquiry still needs a meaningful standard that ensures no constitutional violation occurs. A credit that is inherently imprecise and arbitrary can risk both greater and lesser punishment, but the Double Jeopardy Clause does not. It demands a bright-line day-for-day credit that eliminates all risk of greater punishment. Any standard that does less must measure and quantify time by something other than time.
We therefore hold that when a defendant has been sentenced to a term of probation and is subsequently resentenced to a term of incarceration for the same offense, the Double Jeopardy Clause requires the defendant’s new prison term be reduced by one day for each day spent on probation. Accordingly, in this case, the ten-year period of incarceration under the new sentence must be reduced by the four years, four months, and four days Jepsen served on probation prior to the imposition of the new sentence. The credit should have been given at the time the sentence was imposed.
IV. Conclusion.
We vacate the decision of the court of appeals, reverse the sentence of the district court, and remand the case to the district court to give credit as directed in this opinion. On remand, each day Jepsen spent on probation under his initial sentence shall be fully credited against the corrected ten-year sentence of incarceration.
DECISION OF COURT OF APPEALS VACATED; DISTRICT COURT ORDER REVERSED AND CASE REMANDED WITH INSTRUCTIONS.
All justices concur except Mansfield and Waterman, JJ., who concur in part and dissent in part, and Zager, J., who dissents.
. See, e.g., Iowa Code § 692A.104 (2011) (offender must notify sheriff of any information or residence changes); id. § 692A.111 (offender commits an aggravated misdemeanor for the first registry violation and class "D” felony for any subsequent offense); id. § 692A.113 (offender is subject to a number of exclusion zones and employment restrictions); id. § 692A.114 (offender is subject to residency restrictions); id. § 692A.121 (offenders personal information is published on sex offender website).