
324 S.W.3d 595 (2010)
The STATE of Texas
v.
William Rodney WILSON a/k/a William Corrick, Appellee.
No. PD-0008-09.
Court of Criminal Appeals of Texas.
November 10, 2010.
*596 Lisa C. McMinn, Asst. State's Attorney, Austin, for Appellant.
Thomas B. Swanson, Houston, Jeffrey L. Van Horn, State's Attorney, Austin, for Appellee.

OPINION
JOHNSON, J., delivered the opinion of the Court, in which KELLER, P.J., PRICE, WOMACK, KEASLER, HERVEY, HOLCOMB, and COCHRAN, JJ., joined.
Appellee, William Rodney Wilson, did not dispute the state's recitation of facts in its brief before the court of appeals. That recitation reflects that, in 1987, appellee plead guilty to an indictment that alleged felony driving while intoxicated (DWI) and true to two allegations of prior DWI convictions, in 1983 and 1986. The trial court found appellee guilty of third-degree-felony DWI,[1] fined him $750.00, and sentenced him to four years' probation.[2]
Within the first year of being placed on probation, the state filed a motion to revoke appellee's probation and issued a capias for appellee's arrest. More than nineteen years after the state filed its revocation motion, appellee was arrested. By that time, appellee had changed his name to William Rodney Corrick and had a different Texas driver's license number. (State's brief before the court of appeals, p. 2.) Appellee then filed an Application for Writ of Habeas Corpus Seeking Release for Lack of Probable Cause. The record reflects that, at the initial revocation hearing, appellee made several arguments, including a claim that the prior DWIs alleged for enhancement were not proven to have been final. The hearing was recessed so that appellee could obtain certified copies of documents to offer into evidence. Thereafter, pursuant to TEX. CODE CRIM. PROC. art. 11.072,[3] appellee filed a First Amended Application for Writ of Habeas Corpus. Appellee challenged the sufficiency of the evidence to support a finding of true to the two previous DWI convictions. The amended writ application alleged that the DWI convictions that were used to enhance the 1987 offense to a felony were not final judgments under Article 42.01 of the Texas Code of Criminal Procedure. Appellee requested that the court issue a writ of habeas corpus vacating his "unlawfully obtained conviction and sentence."
When the hearing reconvened, appellee introduced into evidence certified copies of the orders granting misdemeanor probation *597 for the two previous DWI offenses named in the enhancement paragraphs. Each order stated that
IT IS THEREFORE CONSIDERED, ORDERED AND ADJUDGED that the finding of guilty herein shall not be final, that no judgment be rendered thereon, and that Defendant be, and is hereby placed on probation in this cause. . . .
The order was in error as to the 1986 conviction, as the conviction was final by law, but the order for the 1983 probation showed that that conviction was not final, absent proof of revocation. The trial court granted relief on appellee's application for writ of habeas corpus and ordered that his conviction and sentence be vacated. The state appealed the trial court's decision, arguing that the court abused its discretion by granting relief on appellee's application. The court of appeals affirmed the trial court. State v. Wilson, 288 S.W.3d 13 (Tex.App.-Houston [1st Dist.] 2008).
The state, via the state prosecuting attorney, contends in this Court that evidence that a prior conviction may not have been final is not "newly discovered" evidence in the context of a claim of actual innocence. The state argues that, regardless of whether appellee knew that an unrevoked probation was not considered a final conviction prior to 1984, he knew or should have known that he had been placed on probation. The state asserts that the "concepts of insufficient evidence, actual innocence, and illegal sentence are not interchangeable," and the failure to prove an element of an offense results in an improper conviction, not an illegal sentence. The state further argues that appellee is estopped from challenging the finality of his prior conviction because a plea agreement is a contract between the state and the defendant for a certain punishment that is made in exchange for a guilty plea. Therefore, the state argues that it was entitled to rely on the stipulations of the contract and did not have to prove the finality of the prior convictions.
In response to the state's arguments, appellee contends that the court of appeals correctly held that the trial court did not abuse its discretion in granting habeas corpus relief. Appellee argues that the trial court's decision in a habeas corpus proceeding should not be overturned absent a clear abuse of discretion and that the state's desired result should not be substituted for the requisite standard.[4] We granted three of the grounds in the state's petition for discretionary review.[5]

Analysis
"Actual innocence" originally meant that the accused person did not, in fact, commit the charged offense. See, e.g., Sawyer v. Whitley, 505 U.S. 333, 336, *598 112 S.Ct. 2514, 120 L.Ed.2d 269 (1992) ("actual innocence" does not translate neatly into the capital sentencing context; limited exception [to procedural-default bar] to cases in which the applicant could show "by clear and convincing evidence that, but for constitutional error, no reasonable juror would have found the petitioner eligible for the death penalty under applicable state law"); quoted in Dretke v. Haley, 541 U.S. 386, 393, 124 S.Ct. 1847, 158 L.Ed.2d 659 (2004); Murray v. Carrier, 477 U.S. 478, 106 S.Ct. 2678, 91 L.Ed.2d 397 (1986) (actually innocent of the substantive offense). That meaning began to change when the United States Supreme Court expanded the term from "not guilty of" the charged offense to also mean "ineligible for the punishment assessed." See, e.g., Dretke v. Haley, 541 U.S. 386, 393-94, 124 S.Ct. 1847, 158 L.Ed.2d 659 (2004) ("allegations of actual innocence, whether of the sentence or of the crime charged"). We hold that the term "actual innocence" shall apply, in Texas state cases, only in circumstances in which an accused did not, in fact, commit the charged offense or any of the lesser-included offenses. In cases such as this one, in which the issue is the offense of which he is, in fact, guilty, thus implicating the legality of his sentence, the appropriate terms are "guilty only of" a lesser-included offense and "ineligible for" the sentence assessed. For the purpose of this case, and other pending cases in which the issue is the offense of which the accused is, in fact, guilty, the sentence assessed, or both, we will interpret a claim of "actual innocence" to mean "guilty only of" a lesser-included offense or "ineligible for" the sentence assessed, or both.
The state argues that a "true innocence claim involves newly discovered evidence of innocence, not newly learned law." Although appellee may not have known that the 1983 DWI order that was used to enhance a misdemeanor offense to a third-degree felony was not final, the state contends that his ignorance does not warrant an innocence claim.
The state asserts, "A prototypical example of `actual innocence' in a colloquial sense is the case where the state has convicted the wrong person of the crime." Sawyer v. Whitley, 505 U.S. 333, 340, 112 S.Ct. 2514, 120 L.Ed.2d 269 (1992). However, in Ex parte Sparks, this Court unanimously held that a post-conviction application for a writ of habeas corpus is available when a felony conviction was rendered on a guilty plea when, in fact, the offense was a misdemeanor. Ex parte Sparks, 206 S.W.3d 680 (Tex.Crim.App.2006); see also Ex parte Arnold, 574 S.W.2d 141, 142 (Tex.Crim.App.1978).[6] As in the present case, Sparks was indicted for driving while intoxicated. Sparks, 206 S.W.3d at 680. The indictment included an allegation of two prior DWI convictions, which enhanced the misdemeanor DWI to a third-degree felony. Id. at 681. This Court concluded that the enhancement was improper because one of the prior DWI offenses could not be used as an enhancement.[7]Id. at 682.
Here, use of the 1983 enhancement to elevate appellee's misdemeanor offense to a felony was improper. A prior conviction *599 may not be used as an enhancement if the conviction was not final and, until January 1, 1984, a DWI conviction on which the sentence was probated and the probation was never revoked was not deemed final. Ex parte Serrato, 3 S.W.3d 41 (Tex.Crim. App.1999); Clopton v. State, 408 S.W.2d 112 (Tex.Crim.App.1966). Appellee received probation for the 1983 DWI offense, and the record does not indicate that it was ever revoked.[8] We agree with the court of appeals that, under the law in effect at the time of appellee's 1987 DWI, the 1983 conviction could not be used for enhancement purposes and, without two prior convictions, his 1987 DWI was a Class A misdemeanor, not a felony. State v. Wilson, 288 S.W.3d at 16.
The state asserts that a plea bargain is an example of a contract in which both parties usually benefit from the judgment. The state argues that appellee failed to challenge the validity of the prior DWI convictions before pleading guilty to felony DWI, but received the benefits of the plea agreement. And, the state maintains, appellee could have received a harsher punishment had the case gone to trial.[9] The state concludes that appellee is estopped by contract from questioning the validity of the judgment. In support, the state directs us to Rhodes v. State, 240 S.W.3d 882 (Tex.Crim.App.2007), but it does not support the state's position. In Rhodes, we explained, "A defendant who has enjoyed the benefits of an agreed judgment prescribing a too-lenient punishment should not be allowed to collaterally attack that judgment on a later date on the basis of the illegal leniency." Id. at 892. The plea bargain challenged here involves a too-severe punishment  a felony rather than a misdemeanor.
The court of appeals correctly explained that appellee is not estopped from challenging the evidence pertaining to the prior DWI convictions that were used to enhance the misdemeanor offense to a felony. State v. Wilson, 288 S.W.3d at 17. A plea agreement is generally considered a contractual agreement between the state and a defendant that is presumed to have been knowingly and voluntarily entered into unless the defendant can show otherwise. State v. Moore, 240 S.W.3d 248, 251 (Tex.Crim.App.2007) (citing Ex parte Williams, 637 S.W.2d 943, 947 (Tex.Crim. App.1982)). However, this Court has unanimously held that "post-conviction habeas corpus is available when a felony conviction was rendered on a guilty plea when in fact the offense was a misdemeanor." Ex parte Sparks, 206 S.W.3d at 680.
Regardless of any benefit that may have accrued as a direct result of the plea agreement, when a defendant has been convicted of an offense for which he claims that he is "actually innocent, and he proves it, he will be relieved from the restraint of the conviction even though he may have pleaded guilty and confessed." Id. at 683. Here, appellee contended that he was not guilty of the felony DWI of which he was *600 convicted. Appellee successfully proved to the trial court that he was indeed not guilty of the felony offense; the 1983 court order explicitly stated that the judgment was not final, and the statute under which he was convicted supports that court order. Although appellee may have pled guilty to the felony offense pursuant to the plea agreement, the trial court correctly relieved him from the restraint of the felony conviction.

Conclusion
The judgment of the court of appeals is affirmed.
MEYERS, J., dissented.
NOTES
[1]  TEX.REV.CIV. STAT. art. 6701l-1(e).
[2]  In 1993, during the 73rd Legislative Session, the statutory term for probation was changed to "community supervision." Both terms refer to the same process and will be used interchangeably in this opinion. Ivey v. State, 277 S.W.3d 43, 52 n. 48 (Tex.Crim.App. 2009).
[3]  "This article establishes the procedures for an application for a writ of habeas corpus in a felony or misdemeanor case in which the applicant seeks relief from an order or a judgment of conviction ordering community supervision." TEX.CODE CRIM. PROC. art. 11.072, § 1.
[4]  Appellee cites Downer v. Aquamarine Operators, Inc., in which the Supreme Court explained that "[t]he test for abuse of discretion is not whether, in the opinion of the reviewing court, the facts present an appropriate case for the trial court's action. Rather, it is a question of whether the court acted without reference to any guiding rules and principles. Another way of stating the test is whether the act was arbitrary or unreasonable." Downer v. Aquamarine Operators, Inc., 701 S.W.2d 238, 241-42 (Tex.1985), cert. denied, 476 U.S. 1159, 106 S.Ct. 2279, 90 L.Ed.2d 721 (1986) (citations omitted).
[5]  A defendant is not "actually innocent" of felony DWI when one of the prior DWI convictions alleged to elevate the primary offense to a felony is invalid.
2. An invalid prior conviction used to elevate the primary offense to a felony does not render the resulting sentence illegal.
3. A defendant who pleads guilty, pursuant to a plea bargain, to felony DWI and admits to the jurisdictional prior convictions is estopped from claiming that his sentence is illegal because the prior convictions are invalid.
[6]  See also Gilbert v. United States, 609 F.3d 1159, 1166 (11th Cir.2010) (petitioner "is innocent of the statutory `offense' of being a career offender (having two prior violent felonies) and was sentenced, in part, for a non-existent offense  being a career offender with only one prior violent felony.")
[7]  The challenged prior conviction occurred more than ten years before the charged offense. See former PENAL CODE § 49.09(e)(2003).
[8]  Appellee also received probation for the conviction of the 1986 DWI offense, but it was a final conviction that was properly used as an enhancement because the offense occurred after January 1, 1984. TEX.REV.CIV. STAT. 6701l-1(h).
[9]  At the time of the offense, if it was shown at trial that the defendant had previously been convicted two or more times of driving while intoxicated, the offense was punishable by:

(1) a fine of not less than $500 or more than $2,000; and
(2) confinement in jail for a term of not less than 30 days or more than two years or imprisonment in the state penitentiary for a term of not less than 60 days or more than five years.
Article 6701l-1(e).
