
922 S.W.2d 181 (1996)
Ex Parte Vendon BECK, Jr.
No. 72361.
Court of Criminal Appeals of Texas.
May 22, 1996.
Vendon Beck, Jr., Henderson, Texas, pro se.
*182 Laura Greer Urbach, Assist. Dist. Atty., Dallas, Robert A. Huttash, State's Atty., Austin, for the State.

OPINION
PER CURIAM.
This is a post-conviction application for writ of habeas corpus filed pursuant to Article 11.07, V.A.C.C.P. Applicant was charged by indictment with burglary of a building, a state jail felony offense pursuant to V.T.C.A. Penal Code 30.02(c)(1), alleged to have been committed on or about March 7, 1995 in Dallas County. The indictment also alleged that Applicant had previously been convicted of two prior burglary of habitation offenses. On April 3, 1995, in a non-jury trial pursuant to a negotiated plea bargain agreement, Applicant pled guilty to the charged offense and true to the enhancement paragraphs. Punishment was assessed by the trial judge at twenty-five years imprisonment. No appeal was taken from this conviction.
Applicant contends, inter alia, that the punishment assessed exceeds the statutory maximum. "We have long held that a defect which renders a sentence void may be raised at any time." Heath v. State, 817 S.W.2d 335, 336 (Tex.Cr.App.1991). See also Ex parte McIver, 586 S.W.2d 851, 854 (Tex. Cr.App.1979) (Habeas corpus relief will issue to a person in custody under a sentence which is void because the punishment is unauthorized) Ex parte Harris, 495 S.W.2d 231, 232 (Tex.Cr.App.1973) and Ex parte White, 659 S.W.2d 434, 435 (Tex.Cr.App.1983). Applicant was convicted of a state jail felony, then enhanced as an habitual offender under V.T.C.A. Penal Code § 12.42(d).
At the time that Applicant committed the offense, Texas law provided that a state jail felony could not be enhanced under § 12.42(d). State v. Mancuso, 919 S.W.2d 86 (Tex.Cr.App.1996). Therefore, Applicant's sentence of twenty-five years exceeds the statutory maximum and is unlawful.
In Ex parte Sims, 868 S.W.2d 803 (Tex.Cr. App.1993), we held that where the record reflected a plea bargain agreement for the possibility of an illegal sentence, in that case improperly cumulated sentences, the appropriate remedy was to return the parties to their respective positions prior to the plea. Recently, in Ex parte Miller, 921 S.W.2d 239 (Tex.Cr.App.1996), we held that where the punishment pursuant to a negotiated plea bargain agreement exceeded the statutory maximum, the proper relief was to set aside the judgment and remand the applicant to the custody of the sheriff of the convicting county to answer the indictment. In the instant cause, the trial court has found that the guilty plea and subsequent conviction were the result of a plea bargain agreement. Thus the parties have, as in Sims and Miller, bargained for an illegal sentence. Therefore, as in Sims and Miller, the appropriate remedy is return the parties to the positions occupied prior to the plea bargain agreement.
Accordingly, relief is granted. The judgment in cause number F-9525052-IP, in the 203rd Judicial District Court of Dallas County is vacated. Applicant is remanded to the custody of the Sheriff of Dallas County to answer the indictment.
Copies of this opinion shall be sent to the Texas Department of Criminal Justice, Institutional and Pardons and Paroles Divisions.
