
207 S.W.3d 785 (2006)
Roque Tercero ARANDA, Relator,
v.
DISTRICT CLERK, Gaines County, Respondent.
No. AP-75548.
Court of Criminal Appeals of Texas.
November 15, 2006.
Roque Tercero Aranda, pro se.
Ricky B. Smith, Dist. Atty., Matthew Paul, State's Atty., Austin, for state.


*786 OPINION

PER CURIAM.
Relator filed an application for a writ of mandamus with this Court, contending that the Gaines County District Clerk refused to file his application for a writ of habeas corpus. We conditionally grant relief.
Relator was convicted of burglary of a habitation and sentenced to fifteen years' imprisonment. He contends that he attempted to file an application for a writ of habeas corpus with the Gaines County District Clerk, but the application was refused and returned. We abated Relator's mandamus application and ordered the District Clerk to respond.
According to the District Clerk, Relator's habeas application was not filed because, pursuant to a court order, Relator was found to be a "vexatious litigant" and, as a result, was prohibited from filing "new litigation" in state courts. See TEX. CIV. PRAC. & REM.CODE § 11.101. The District Clerk conceded that "if an Application for a Writ of Habeas Corpus was mailed to us by Mr. Aranda, we would never have known it because we returned the envelope, unopened[,] to him." (emphasis in the original). Under TEX. CIV. PRAC. & REM. CODE § 11.101(a)(2), a person is prohibited from filing new litigation unless the local administrative judge of the court where the litigation will be filed grants permission. There is no evidence in the record that Relator was granted permission to file new litigation in Gaines County. The decision by the Gaines County District Clerk to not file Relator's habeas application was therefore presumably based on the restrictions in § 11.101(a)(2). We address whether Chapter 11 of the Texas Civil Practice and Remedies Code applies to habeas applications filed pursuant to TEX. CODE CRIM. PROC. art. 11.07.
Section 11.001(2) of the Texas Civil Practice and Remedies Code defines litigation as "a civil action commenced, maintained, or pending in any state or federal court." We do not believe that an application for a writ of habeas corpus filed pursuant to TEX.CODE CRIM. PROC. art. 11.07 is a "civil action." Instead, we have said that when a person is confined for violating a criminal statute and files an application for a writ of habeas corpus challenging his confinement, the proceeding is criminal, not civil, in nature. Ex parte Davis, 542 S.W.2d 192, 198 (Tex.Crim.App.1976); see also Ex parte Rieck, 144 S.W.3d 510, 516 (Tex.Crim.App.2004) ("Such proceedings are categorized as `criminal' for jurisdictional purposes, and the Texas Rules of Civil Procedure do not ordinarily apply"). We conclude that Relator was not prohibited from filing an application for a writ of habeas corpus with the Gaines County District Clerk pursuant to TEX.CODE CRIM. PROC. art. 11.07.
We note, however, that the Texas Legislature has mandated the forfeiture of good time for inmates who file frivolous habeas applications. Under TEX. GOV'T CODE § 498.0045, a habeas application filed for the purpose of abusing judicial resources will be considered frivolous and will result in the forfeiture of an inmate's good time. Such good time forfeited under § 498.0045 may not be restored.
We will grant mandamus relief when a relator shows "(1) that the act sought to be compelled is purely ministerial and (2) that there is no adequate remedy at law." Winters v. Presiding Judge of the Crim. Dist. Court No. Three, 118 S.W.3d 773, 775 (Tex.Crim.App.2003). In Relator's case, the Gaines County District Clerk had a ministerial duty to file Relator's habeas application. TEX.CODE CRIM. PROC. art. 11.07, § 3(b); Deleon v. Dist. Clerk, Lynn County, 187 S.W.3d 473, 474 *787 (Tex.Crim.App.2006). Because Relator had no right to appeal the District Clerk's refusal to file his habeas application, Relator had no remedy at law.
Accordingly, we conditionally grant Relator's application for a writ of mandamus and direct the Gaines County District Clerk to accept and file Relator's habeas application. Following custom, we will withhold issuance of the writ and allow the District Clerk an opportunity to conform her actions to this opinion. Only if she refuses to file Relator's habeas application will the writ of mandamus issue. State ex rel. Hill v. Pirtle, 887 S.W.2d 921, 932 (Tex.Crim.App.1994).
