OPINION ON MOTION FOR REHEARING
On motion for rehearing appellant argues that the court wrongly decided that dismissal *726in the justice court of a felony cause of action rendered moot the writ of habeas corpus filed in the district court. We -write further to explain the role of the justice of the peace as a magistrate in regard to felony petitions.
Appellant’s Position
Appellant claims the justice court had no jurisdiction in criminal cases except where a fine only may be imposed. Appellant points out his punishment for the felony offense alleged included two to 10 years confinement. Appellant relies on Ex parte Ward, 560 S.W.2d 660 (Tex.Crim.App.1978) for the proposition that the justice court has authority to take a felony complaint and issue a warrant of arrest, but does not have jurisdiction of a felony case. Id. at 662. Appellant concludes the justice court had no jurisdiction to dismiss the case, so that the writ of habeas corpus was still pending in the district court.
Dual Criminal Jurisdiction of Justice Court
We agree with appellant that a justice court has jurisdiction over criminal cases where a fine only may be imposed and that the justice court has authority to take a felony complaint and issue a warrant of arrest, but does not have jurisdiction of a felony case. It appears, however, that appellant confuses the two roles of a justice of the peace: (1) the general criminal jurisdiction; and (2) jurisdiction as a magistrate. The real question is whether the justice court had jurisdiction over the complaint in its function as a magistrate such that its dismissal of the complaint constituted a dismissal of the case. The answer is clarified by an examination of the respective roles of a justice court exercising criminal jurisdiction as a justice of the peace and as a magistrate.
a. General Criminal Jurisdiction of Justice Court
As pointed out by appellant, TexCode CRIM.P.Ann. art. 4.11 (Vernon Supp.1995) provides that a justice court has jurisdiction over criminal cases where the fine does not exceed $500. This is the general criminal jurisdiction of a justice of the peace. It does not include jurisdiction over felony cases. However, a justice of the peace is also a magistrate.
b. Jurisdiction of Justice Court as Magistrate
The Texas Code of Criminal Procedure lists the justice of the peace as one of the officers that can function as a magistrate. Tex.Code CRIM.P.Ann. art. 2.09 (Vernon Supp.1995). Also listed are judges of the district courts. Id. The duties of a magistrate include: (1) issuing arrest warrants pursuant to TexCode CrimP.ÁNN. art. 15.03 (Vernon 1977); (2) filing complaints, which are the affidavits upon which warrants are based;1 (3) giving the statutory warnings to an arrested person, pursuant to TexCode CrimPAnn. art. 15.17 (Vernon Supp.1995); (4) issuing search warrants pursuant to Tex. Code Crim.P.Ann. art. 18.01 (Vernon Supp. 1995); and (5) conducting examining trials pursuant to TexCode Crim.P.Ann. art. 16.01 (Vernon Supp.1995).
When a justice court holds an examining trial, he sits as a magistrate and not as a justice of the peace, and his powers and jurisdiction are those of the magistrate and not those of a justice of the peace. Brown v. State, 55 Tex.Crim. 572, 118 S.W. 139, 142 (App.1909). In Ex parte Clear, 573 S.W.2d 224 (Tex.Crim.App.1978), the issue before the court was whether the justice court had sole jurisdiction of the felony complaint filed therein. The court of criminal appeals in Clear stated that:
all the magistrates of a given county have co-equal jurisdiction; indeed this appears to be nothing less than the plain import of the statute. More specifically, we hold that a justice of the peace acting as a magistrate has jurisdiction concurrent with that of a district judge who also seeks to exercise magisterial powers.
Id. at 228 (emphasis added).
The Clear court went on to state that TexCode CrimPAnn. art. 4.16 (Vernon 1977) provides: “When two or more courts have concurrent jurisdiction of any criminal offense, the court in which an indictment or a complaint shall first be filed shall retain jur*727isdiction except as provided in Article 4.12.” 2 The court held that the justice court “possessed sole jurisdiction over this complaint against relator, to the exclusion of all other courts, until dismissed by the court or superseded by the action of the grand jury, or until the time that the requirements of Article 1.1413 of the Code of Criminal Procedure had been met.” Id. at 229 (emphasis added, footnotes omitted).
c. Application to This Case
Following the Clear case, the justice court herein, in its capacity as magistrate, had sole jurisdiction over the complaint by virtue of its having been originally filed there. The justice court retained that jurisdiction until it dismissed the complaint. See Preston v. State, 109 Tex.Crim. 610, 6 S.W.2d 757 (App.1928) (holding that where the complaint filed in justice court was dismissed, another complaint charging the same offense could be filed subsequently in county court). Once the complaint was dismissed, appellant was under no criminal restraint and would not be under criminal restraint until further charges were filed or an indictment was returned by the grand jury. As we held on original submission, the habeas corpus proceeding in district court, challenging appellant’s restraint based on the complaint pending in justice court, was rendered moot by the dismissal of the complaint in the justice court.
Conclusion
Having explained the difference between the justice court’s general criminal jurisdiction, where a justice court has no jurisdiction over a felony case, and its function as a magistrate, where a justice court has jurisdiction over a felony complaint, we overrule appellant’s motion for rehearing.
COHEN and MIRABAL, JJ., also participating.
. See Tex.Code Crim.P.Ann. arts. 15.03, 15.04, 15.17 (Vernon 1977 & Supp.1995).
. Article 4.12 deals with certain misdemeanor cases to be tried in justice court and thus is not applicable. See Tex.Code Crim.P.Ann. art. 4.12 (Vernon 1977).
. Article 1.141 allows waiver of indictment for noncapital felony. TexCode Crim.Proc.Ann. art. 1.141 (Vernon 1977).