OPINION
MEYERS, J.,delivered the opinion of the Court,
in which KELLER, P.J., and PRICE, WOMACK, KEASLER, HERVEY, and HOLCOMB, JJ., joined.Applicant was indicted for the offense of Driving While Intoxicated. Following the advice of his counsel, he stipulated to a prior offense and pled guilty. The prior involuntary-manslaughter1 conviction was used for enhancement purposes, and he was sentenced to four years in the Texas Department of Criminal Justice — Correctional Division. Applicant filed an application for a writ of habeas corpus alleging that his counsel was ineffective for stipulating to a prior involuntary manslaughter conviction for the purposes of enhancing his offense to a felony and, as a result, his sentence was illegal. We filed and set the application and requested briefing on this issue and the issue of whether Applicant is estopped from raising an illegal-sentence claim.
ANALYSIS
Applicant stipulated to a 1990 conviction for involuntary manslaughter, and this conviction was used to enhance his offense to a felony. Texas Penal Code Section 49.09 governs the enhancement of intoxication offenses and states that:
(a) Except as provided by Subsection (b), an offense under Section 49.04, 49.05, 49.06, or 49.065 is a Class A misdemeanor, with a minimum term of confinement of 30 days, if it is shown on the trial of the offense that the person has *889previously been convicted one time of an offense relating to the operating of a motor vehicle while intoxicated, an offense of operating an aircraft while intoxicated, an offense of operating a watercraft while intoxicated, or an offense of operating or assembling an amusement ride while intoxicated.
(b) An offense under Section 49.04, 49.05, 49.06, or 49.065 is a felony of the third degree if it is shown on the trial of the offense that the person has previously been convicted:
(1) one time of an offense under Section 49.08 [intoxication manslaughter] or an offense under the laws of another state if the offense contains elements that are substantially similar to the elements of an offense under Section 49.08; or
(2) two times of any other offense relating to the operating of a motor vehicle while intoxicated, operating an aircraft while intoxicated, operating a watercraft while intoxicated, or operating or assembling an amusement ride while intoxicated.
(c) For the purposes of this section:
(1) “Offense relating to the operating of a motor vehicle while intoxicated” means:
(A) an offense under Section 49.04 or 49.045;
(B) an offense under Section 49.07 or 49.08, if the vehicle operated was a motor vehicle;
(C) an offense under Article 67011-1, Revised Statutes, as that law existed before September 1,1994;
(D) an offense under Article 67011-2, Revised Statutes, as that law existed before January 1,1984;
(E) an offense under Section 19.05(a)(2), as that law existed before
September 1, 199), if the vehicle operated was a motor vehicle; or
(F)an offense under the laws of another state that prohibit the operation of a motor vehicle while intoxicated,
(emphasis added). Applicant’s sentence was enhanced under Section 49.09(b)(1), which increases an offense to a third-degree felony when the defendant has previously been convicted of intoxication manslaughter. As stated above, Applicant’s prior conviction was not for intoxication manslaughter, but for involuntary manslaughter under former Penal Code Section 19.05(a)(2). The only mention of the statute under which Applicant was convicted in 1990 is in Section 49.09(c)(1)(E), which defines the term “offense relating to the operating of a motor vehicle while intoxicated.” This term is used in Section 49.09(a) and is also used in Section 49.09(b)(2). However, the term is not used in Section 49.09(b)(1), under which Applicant’s sentence was enhanced to a felony. Thus, there are two situations in which Section 49.09 permits prior offenses relating to the operating of a motor vehicle while intoxicated to be used for enhancement, and only one of those situations applies in this case. First, a prior offense relating to the operating of a motor vehicle while intoxicated may be used to raise an offense from a Class B misdemeanor to a Class A misdemeanor under Section 49.09(a). Second, if a defendant has two prior convictions for offenses relating to the operating of a motor vehicle while intoxicated, then his current offense may be enhanced to a third-degree felony under Section 49.09(b)(2). Therefore, because Applicant has only one prior conviction for an offense relating to the operating of a motor vehicle while intoxicated and does not have even a single conviction for intoxication manslaughter, his sentence cannot properly be enhanced to a felony. Instead, Applicant’s stipulation to a prior *890offense relating to the operating of a motor vehicle while intoxicated should have only raised his offense from a Class B misdemeanor with a minimum term of 72 hours2 to a Class A misdemeanor with a minimum term of confinement of 30 days under Section 49.09(a). Therefore, Applicant’s current sentence is illegal.
Although the statute treats the former offense of involuntary manslaughter under 19.05(a)(2) and the current offense of intoxication manslaughter differently, the fact that the legislature included the former offense under the definition of an “offense relating to the operating of a motor vehicle while intoxicated” indicates that the legislature was aware of the statute’s distinct treatment of the offenses. Perhaps the legislature took out the confusing 10-year rule3 but left Section 49.09(b), which calls for different treatment of offenses that occurred prior to September 1, 1994, in order to give less effect to offenses from the distant past. While the issue in this case appears to be similar to the situation in Griffith v. State, 116 S.W.3d 782 (Tex.Crim.App.2003), the cases can be distinguished. In Griffith, the State sought to use prior offenses of rape and aggravated rape to enhance the appellant’s punishment for his current sexual-assault charge. We held that the State could use the prior offenses for enhancement purposes although rape and aggravated rape were not offenses listed in the enhancement statute. We interpreted the penal code section regarding penalties for repeat and habitual felony offenders as including the statutory predecessors of the offenses listed in the statute. The difference between these eases is that the statute in Griffith does not even mention the offense of rape, while the statute in the case before us refers to former Section 19.05(a)(2) involuntary manslaughter in the definition section, and even directs us how to deal with that offense. When the legislature specifically instructs us how to deal with an offense, we should give effect to each word and follow their direction. If this differing treatment for similar offenses is not what the legislature intended, then they can again alter the statute accordingly.
The State argues that Applicant is estopped from asserting a claim that his sentence is illegal because he stipulated to the prior offense and pled guilty. However, estoppel does not apply here because there is no invited error in this case. Invited error is when a party asks for something, gets what they ask for, and then complains about it. Applicant simply stipulated to a prior conviction that was erroneously used to enhance his sentence to a felony when it should have been used only to enhance from a Class B misdemeanor to a Class A misdemeanor. He did not ask for his stipulation to be used to enhance his sentence to a level that is not allowed under the statute, which is what occurred in this case. He did plead guilty to an offense of a higher classification than that for which he was eligible, but this is not invited error. If a defendant was charged with criminally negligent homicide, but was somehow induced by the State to plead guilty to manslaughter, then his sentence for a second-degree felony would be illegal because he was charged with only a state-jail felony.
Similarly, in this case, Applicant was encouraged to plead guilty to felony DWI when he was charged with only a Class A misdemeanor DWI. This is the basis for Applicant’s ineffective-assistance claim. Applicant’s attorney states that he “intensively researched” the issue of *891whether the prior conviction could be used to enhance the offense to a felony. He determined that the enhancement was proper based on an unpublished memorandum opinion by the First District Court of Appeals, Louviere v. State, No. 01-02-00504-CR, 2003 WL 360909 (Tex.App.Houston [1st Dist.] February 20, 2003) (not designated for publication), 2003 Tex. App. LEXIS 1583. On facts similar to Applicant’s case, Louviere allowed the use of a past involuntary-manslaughter conviction for enhancement purposes based on the determination in Gowans v. State, 995 S.W.2d 787, 792 (Tex.App.-Houston [1st Dist.] 1999), that, although involuntary manslaughter under former Penal Code Section 19.05(a)(2) was modified into intoxication manslaughter, “the offense remained substantively the same.” However, the issue in Gowans was whether criminally negligent homicide was a lesser-included offense of intoxication manslaughter. The court’s conclusion was simply that, when involuntary manslaughter under former Penal Code Section 19.05(a)(2) was modified into intoxication manslaughter, the offense still did not require proof of a culpable mental state for conviction. Rather than advise his client that the enhancement was proper under Louviere, Applicant’s attorney could have argued that Louviere was incorrect because it not only mischaracterized Gow-ans’ statement that the offense remained substantively the same as the court’s “holding,” but also took the statement totally out of context. However, because counsel’s decision was based on existing caselaw, it was not ineffective assistance for counsel to advise Applicant to accept the plea.
CONCLUSION
Although Applicant’s attorney offered reasonable assistance, Applicant’s prior conviction for involuntary manslaughter was improperly used to enhance his sentence to a felony, and thus Applicant is serving an illegal sentence. Relief is granted.
KEASLER, J., filed a concurring opinion, in which HERVEY, J., joined.
COCHRAN, J., filed a dissenting opinion. JOHNSON, J., concurred in the result.. The initial indictment stated that Applicant had a prior conviction for intoxication manslaughter. The indictment was later corrected to say that the prior conviction was for involuntary manslaughter.
. See Penal Code Section 49.04(b).
. See former Section 49.09(e) (2001); Getts v. State, 155 S.W.3d 153 (Tex.Crim.App.2005).