
288 S.W.3d 13 (2008)
The STATE of Texas, Appellant,
v.
William Rodney WILSON a/k/a William Corrick, Appellee.
No. 01-08-00078-CR.
Court of Appeals of Texas, Houston (1st Dist.).
December 4, 2008.
Discretionary Review Granted July 1, 2009.
*14 Thomas Blair Swanson, Houston, TX, for Appellant.
Renee Ann Mueller, District Attorney, Brenham, TX, Stephen Christopher Taylor, Conroe, TX, for Appellee.
Panel consists of Justices TAFT, KEYES, and ALCALA.

OPINION
ALCALA, Justice.
The State appeals from a trial court order granting William Rodney Wilson's application for writ of habeas corpus. See TEX.CODE CRIM. PROC. ANN. art. 11.072 (Vernon 2005). In its sole issue, the State asserts that the trial court abused its discretion in granting Wilson's application. We conclude the trial court did not abuse its discretion by vacating Wilson's probated sentence for felony DWI. We affirm.

Background
On August 18, 1987, Wilson entered a plea of guilty to the offense of felony DWI. *15 Wilson also entered pleas of true to two paragraphs alleging previous DWI convictions:
Paragraph # 2and it is further presented in and to said Court, that prior to the commission of the aforesaid offense by the said WILLIAM RODNEY WILSON, on the 5th day of November, 1986, in the County Court of Colorado County, Texas, in cause number 9796, the said WILLIAM RODNEY WILSON was convicted of the offense of driving and operating a motor vehicle in a public place, while intoxicated, a misdemeanor, and said conviction became final prior to the commission of the aforesaid offense.
Paragraph # 3and it is further presented in and to said Court, that prior to the commission of the aforesaid offense by the said WILLIAM RODNEY WILSON, on the 29th day of November 1983, in the County Court of Washington County, Texas, in cause number 11254, the said WILLIAM RODNEY WILSON was convicted of the offense of driving and operating a motor vehicle upon a public road and highway, while intoxicated, a misdemeanor, and said conviction became final prior to the commission of each of the aforesaid offenses.
In accordance with the plea bargain agreement, the trial court found true the two paragraphs that asserted Wilson was twice previously convicted of DWI, and found him guilty of the third-degree felony offense of DWI. Wilson was sentenced to four years in prison, probated for four years, and a $750 fine.
Within one year of being placed on probation, the State filed a motion to revoke probation and issued a capias for Wilson's arrest. Nineteen years later, Wilson was arrested. Wilson then filed an application for writ of habeas corpus. Wilson's amended application challenged the finality of the DWI convictions used to enhance the offense to a felony, asserting that the previous convictions were not "reflected in final judgments." See TEX.CODE CRIM. PROC. ANN. art. 42.01 (Vernon 2006). In the prayer for relief, Wilson asked the court to "[i]ssue a writ of habeas corpus vacating his unlawfully obtained conviction and sentence." The State responded to Wilson's application by contending that his plea of true to the prior convictions established those convictions and that he may not challenge the convictions because he benefitted by receiving probation for the felony DWI.
At the hearing for the writ of habeas corpus, Wilson presented the orders for the two previous DWI offenses named in the jurisdictional enhancement paragraphs. The orders both state that "the finding of guilty herein shall not be final, that no judgment be rendered thereon, and that the defendant be, and is hereby placed on probation in this cause." The trial court granted Wilson's application for writ of habeas corpus and vacated Wilson's probated sentence for felony DWI.

Habeas Corpus
The State contends that the trial court abused its discretion by granting Wilson's application because (1) the trial court acted without knowledge of the law in effect at the time of the commission of the underlying offense and without knowing whether the sentences in Wilson's two prior DWI convictions were imposed, (2) Wilson is estopped from challenging the prior convictions used to enhance the case, and (3) Wilson cannot challenge the sufficiency of the evidence in a writ of habeas corpus.

A. Standard of Review
A trial court's ruling in a habeas corpus proceeding should not be overturned absent a clear abuse of discretion. Ex parte Ayers, 921 S.W.2d 438, 440 (Tex. *16 App.-Houston [1st Dist.] 1996, no pet.). A trial court abuses its discretion when it acts without reference to any guiding rules or principles. Montgomery v. State, 810 S.W.2d 372, 380 (Tex.Crim.App.1990). In determining whether a court has abused its discretion, we view the evidence in the light most favorable to the trial court's ruling. Crow v. State, 968 S.W.2d 480, 482 (Tex.App.-Houston [1st Dist.] 1998, pet. ref'd).

B. Requisites for Writ of Habeas Corpus
Article 11.072 applies to an applicant for a writ of habeas corpus in a felony case in which the applicant seeks relief from a judgment of conviction ordering community supervision. TEX.CODE CRIM. PROC. ANN. art. 11.072, § 1. At the time the application is filed, the applicant must be or have been on community supervision, and the application must challenge the legal validity of the conviction for which community supervision was imposed. Id. § 2(b)(1). The court shall enter a written order including findings of fact and conclusions of law. Id. § 7(a).[1] If the application is granted, the State may appeal the order. Id. § 8.

C. Law of DWI Felony Enhancement
When Wilson received probation in 1987, DWI was punishable as a third-degree felony if the defendant had twice before been convicted of DWI. TEX.REV.CIV. STAT., art. 6701l-1(e) (repealed 1994). For purposes of the 1987 DWI felony enhancement statute, "a conviction for an offense that occur[red] on or after January 1, 1984, [was] a final conviction, whether or not the sentence for the conviction [was] probated." Id. art. 6701l-1(g). A probated sentence for DWI that occurred prior to January 1, 1984 was not defined as a final conviction. See id. (as amended by Acts 1979, 66th Leg., p. 1609, ch. 682, § 3); see also Nixon v. State, 153 S.W.3d 550, 552 (Tex.App.-Amarillo 2004, pet. ref'd) ("[W]e hold that before a probated 1984 conviction can be deemed final ..., the offense must occur after January 1, 1984.").

D. Analysis
The State contends that the trial court abused its discretion by acting without knowledge of the law in effect in 1987, when appellant committed the DWI offense. But the record shows the trial court applied the 1987 law correctly. The State used appellant's 1983 conviction to enhance appellant's DWI offense to a third-degree felony. However, the sentence for the 1983 conviction was probated. Under the law in effect at the time of appellant's DWI, a conviction that occurred before January 1, 1984 and for which the sentence was probated was not a final conviction. See TEX.REV.CIV. STAT., art. 6701l-1(g) (repealed 1994). Appellant's 1983 conviction could therefore not be used for enhancement purposes, and without two enhancement convictions, appellant's DWI was not a felony.
Although the State accurately notes that the record does not affirmatively show whether the 1983 probation was revoked, that does not mean the trial court abused its discretion. Based on the evidence before the trial court, which was an order placing Wilson on probation for DWI in 1983, the record shows that the probation at that time was not a final conviction. See id. We cannot conclude the trial court abused its discretion by determining Wilson was not finally convicted of the 1983 DWI.
*17 The State contends that Wilson was estopped from challenging the legal sufficiency of the evidence used to convict him because he "did personally stipulate to the facts of the stipulation; the stipulation adequately recited the two prior jurisdictional convictions contained in the indictment; [and] the written stipulation is itself contained in the official trial record." However, this is not true of an applicant for habeas corpus. An applicant "may undertake to prove on habeas corpus that in fact he is innocent of the offense ... even though he pleaded guilty, confessed, and stipulated to evidence." Ex parte Sparks, 206 S.W.3d 680, 683 (Tex.Crim.App.2006). In Ex parte Sparks, Sparks "judicially confessed, agreed to the stipulation of evidence, and waived defects in the indictment." Id. Nevertheless, the Texas Court of Criminal Appeals set aside the judgment of guilt because Sparks was not guilty of the felony elements of DWI. Id. We cannot conclude, therefore, that Wilson is estopped from challenging the evidence that establishes he was previously twice convicted of DWI.
The State also contends Wilson cannot challenge the sufficiency of the evidence used to sustain his felony conviction through an application for post-conviction writ of habeas corpus. The State cites Ex parte Grigsby in support of this contention, but Grigsby is not applicable to this case. 137 S.W.3d 673, 674 (Tex.Crim.App. 2004). Grigsby pleaded guilty to the felony offense of robbery, and then challenged the sufficiency of the evidence to support his conviction through a writ of habeas corpus. The Court held that "it is well-established that a challenge to the sufficiency of the evidence used to sustain a felony conviction is not cognizable on an application for a post-conviction writ of habeas." Id. Although in the body of the writ Wilson challenges the sufficiency of the evidence used to sustain his conviction by asserting the two prior DWI convictions were not final, in the prayer he seeks habeas corpus relief based on the illegality of his felony conviction. It is proper to seek habeas corpus relief based on the illegality of the felony conviction. See Ex parte Roemer, 215 S.W.3d 887, 890-91 (Tex.Crim.App.2007) (granting habeas relief when applicant asserted that his sentence for felony DWI was illegal).
We hold that the trial court did not abuse its discretion by granting Wilson's application for writ of habeas corpus.

Conclusion
We affirm the order of the trial court.
NOTES
[1]  The trial court did not enter findings of fact and conclusions of law, but no one complains of that error.
