
349 P.2d 335 (1960)
66 N.M. 421
Virginia MORRIS, Petitioner-Appellant,
v.
Tomas APODACA, Respondent-Appellee.
No. 6685.
Supreme Court of New Mexico.
February 19, 1960.
Schall & Sceresse, Kenneth A. Patterson, Albuquerque, for appellant.
Paul W. Robinson, Dist. Atty., George F. Stevens and Victor R. Ortega, Asst. Dist. Attys., Albuquerque, for appellee.
CARMODY, Justice.
This is an appeal from the quashing of a writ of certiorari by the district court.
The question for our determination is whether certiorari is available to contest the action of a justice of the peace, as committing magistrate, in binding a defendant over for trial.
Appellant was charged, by complaint before the appellee as justice of the peace, with attempting to commit a felony, to-wit: abortion. A preliminary hearing was held, and thereafter the state filed an information in the district court. To this information, the defendant (appellant here) filed a plea in abatement attacking the proceedings in the justice court. On the same day, appellant also filed her petition for writ of *336 certiorari. A joint hearing was held by the district court on both the plea in abatement and the writ of certiorari. As a result thereof, the court overruled the plea in abatement and quashed the writ of certiorari. The criminal case is still pending in the district court, not having been tried subject to the disposition of this appeal.
Upon the filing of the transcript and appellant's brief in chief, appellee filed his motion to dismiss the appeal. Appellant resists the motion on the general theory that certiorari is her proper remedy.
We have no constitutional or statutory definition of "certiorari" as it applies to this type of proceeding, although, generally, by the constitution and statute, the district and supreme courts are authorized to issue writs of certiorari. Therefore, it would follow that what is known as the common law writ of certiorari would apply. This being true, it can generally be stated that certiorari will lie in two classes of cases, (1) whenever it is shown that the inferior court or tribunal has exceeded its jurisdiction; (2) whenever it is shown that the inferior court or tribunal has proceeded illegally, and no appeal is allowed or other mode provided for reviewing its proceedings. 10 Am.Jur. 527, Certiorari, § 5.
It is quite obvious that the second category is not applicable to the instant case, inasmuch as appellant not only has the right of review guaranteed to her in the district court, but also, in the event of a conviction, has the right of appeal to this court. The problem, therefore, is whether or not the appellee exceeded his jurisdiction.
The complaint was filed before him, charging an offense under the laws of the state of New Mexico. He proceeded to hear the evidence adduced on behalf of the state at the preliminary hearing, in the presence of appellant and her counsel, and thereafter determined that an offense had been committed, the punishment of which was not within his jurisdiction, and that there was probable cause to believe that appellant was guilty thereof. See § 41-3-12, N.M.S.A., 1953 Comp. The fact that appellee may or may not have been mistaken in his belief is not a matter for our consideration at this time.
Although there are very few cases on the precise point, the Supreme Court of Arizona was called upon to decide almost the exact question with which we are here concerned, in Valles v. Johnson, 1950, 71 Ariz. 71, 223 P.2d 815, 817. The court held that certiorari was not available to review the erroneous order of a justice of the peace issued in binding the defendant over for trial. That court made the following statement which is in line with our feeling in this cause, as follows:
"By making certiorari available to any one wishing to contest the orders of a Justice Court in a case similar to the one at hand, we would only succeed in bogging down the workings of our County Attorneys in the mire of legal process, and offer to one, perhaps justly accused, a method of evading the arm of justice for an unreasonable period of time."
State ex rel. Prince v. Coors, 1948, 52 N.M. 189, 194 P.2d 678, involved a writ of prohibition, and not a writ of certiorari. However, there we held that prohibition was not available to a defendant who, prior to trial, raised the question of lack of preliminary hearing. Realizing that the two writs are very different, nevertheless we feel that there is a similarity between that case and this, and hold, utilizing the language of Justice Compton in the above case with the mere change of the word "prohibition" to that of "certiorari," as follows:
"It is shown from the record that respondent has jurisdiction both of the subject matter and person. Thus having jurisdiction to determine the cause and render judgment, [certiorari] * * * cannot be used to supply the ordinary functions of an appeal or writ of error, nor may it be used to restrain an inferior court from making an erroneous decision."
*337 The granting of a writ of certiorari is within the sound discretion of the court, Appeal of Fredericks, 1938, 285 Mich. 262, 280 N.W. 464, 125 A.L.R. 259, and White v. White, 1944, 70 R.I. 48, 36 A.2d 661, 151 A.L.R. 1374, and where, as here, appellant's rights are amply protected, we cannot but feel that the initial issuance of the writ was an abuse of discretion, that the same should never have issued, and that the criminal case should have been allowed to proceed in a normal course following the denial of the plea in abatement. In any event, appellee did not exceed his jurisdiction, even though his action may or may not be error, a question upon which we expressly decline comment.
In view of what has been said, therefore, appellee's motion will be sustained and the appeal dismissed; and it is so ordered.
It is further ordered that the time within which to file a motion for rehearing herein is hereby limited to five days.
McGHEE, C.J., and COMPTON, MOISE and CHAVEZ, JJ., concur.
