
885 P.2d 1316 (1994)
David Earl PARSONS, Petitioner,
v.
The FIFTH JUDICIAL DISTRICT COURT of the State of Nevada, In and For the COUNTY OF NYE, and the Honorable John P. Davis, District Judge, Respondents, and
The State of Nevada, Real Party in Interest.
No. 23999.
Supreme Court of Nevada.
November 30, 1994.
*1317 John G. Watkins, Las Vegas, for petitioner.
Arthur F. Wehrmeister, Dist. Atty., and Kirk D. Vitto and Rachel Nicholson, Deputy Dist. Attys., Nye County, for respondents.

OPINION
PER CURIAM:
Petitioner David Earl Parsons (Parsons) was charged by criminal complaint with one count of felony driving under the influence (DUI). The justice court granted Parsons' motion to strike one of his prior convictions, amended the complaint to a second-offense misdemeanor DUI charge, allowed Parsons to plead guilty, and sentenced him. The district court granted the State's petition for a writ of certiorari, finding that the justice *1318 court's actions were in excess of its jurisdiction. Accordingly, the district court vacated Parsons' conviction and rescheduled the preliminary hearing in justice court. Parsons alleges that the district court erred in granting the State's petition for a writ of certiorari. For the reasons stated below, we conclude that Parsons' contentions are without merit, and deny his petition.

FACTS
Parsons, who had two prior DUI misdemeanor convictions within seven years, was charged by criminal complaint with one count of third-offense felony DUI in violation of NRS 484.379 and NRS 484.3792. A preliminary hearing was scheduled to be held in justice court on April 20, 1992. Immediately prior to the preliminary hearing, however, Parsons' counsel asserted that the second-offense misdemeanor DUI conviction was constitutionally infirm and argued that it should be suppressed. The parties conferred off-the-record with the judge, then commenced the proceeding.
At this time, Parsons' counsel made a motion to have the felony offense "stricken down to a second offense DUI" on the basis that the complaint charging Parsons with a second-offense DUI had been improper because it incorrectly stated that the first offense had occurred in Las Vegas, Nevada, rather than in Flagstaff, Arizona. Parsons' counsel thus requested that Parsons be allowed to enter a plea and receive his sentence. The State objected, arguing that the justice court had no jurisdiction to accept a plea to a felony charge, and could only determine whether or not to bind Parsons over to the district court.
The justice court noted its opinion that if Parsons had had effective counsel at the time of his hearing on the second DUI charge the problem with the complaint would have been noted and the charge could have been dismissed or reduced to a first-offense DUI.[1] The justice court also noted that the complaint in the instant case listed the prior offenses correctly, but went on to "strike the complaint" and allow Parsons to enter a guilty plea to a second-offense misdemeanor DUI charge. Parsons was sentenced to thirty days in jail, to be served intermittently, and ordered to pay an $800.00 fine. Parsons subsequently fled the jurisdiction, and has neither served his sentence nor paid his fine.
The State filed a motion to arrest judgment with the justice court and an appeal of the judgment with the district court, both of which were denied. The State then filed a petition for a writ of certiorari in the district court, arguing that the justice court exceeded its jurisdiction in amending the felony complaint to a misdemeanor and sentencing Parsons.
The district court granted the State's petition, issuing an order nullifying Parsons' conviction and rescheduling the preliminary hearing in justice court for a determination of whether or not probable cause existed to bind Parsons over to the district court on the felony charge.
Parsons filed this petition for a writ of mandamus or prohibition directing the district court to void its order and vacate the rescheduled preliminary hearing.

DISCUSSION

Standard of Review.
Petitions for extraordinary writs are addressed to the sound discretion of the court, and may issue only when there is no plain, speedy, and adequate remedy at law. State ex rel. Dep't Transp. v. Thompson, 99 Nev. 358, 662 P.2d 1338 (1983); NRS 34.330. A writ of prohibition may issue to arrest the proceedings of a district court exercising its judicial functions when such proceedings are in excess of the jurisdiction of the district court. NRS 34.320. A writ of mandamus is *1319 available to compel the performance of an act which the law requires as a duty resulting from an office, trust or station, or to control an arbitrary or capricious exercise of discretion. NRS 34.160; see Round Hill Gen. Imp. Dist. v. Newman, 97 Nev. 601, 637 P.2d 534 (1981).
Whether the district court erred in entertaining the State's petition for a writ of certiorari.
A writ of certiorari may be granted "in all cases when an inferior tribunal, board or officer, exercising judicial functions, has exceeded the jurisdiction of such tribunal, board or officer and there is no appeal, nor, in the judgment of the court, any plain, speedy and adequate remedy." NRS 34.020(2).
Parsons argues that the district court erred in entertaining the State's petition for a writ of certiorari because the State had an adequate remedy at law pursuant to NRS 189.120[2] to challenge the justice court's order suppressing one of the alleged prior convictions.
We conclude that Parsons' argument is without merit. NRS 189.120 is inapplicable in the instant case because the justice court's order was not simply an order suppressing evidence, but was a final judgment of conviction. The State appealed the justice court's judgment pursuant to NRS 177.015(1)(a), which provides that in a criminal action, the State or the defendant can appeal "[t]o the district court of the county from a final judgment of the justice's court." However, the district court, laboring under the assumption that NRS 189.120 applied in this case, denied the appeal for being untimely.
The State's only remedy was to treat the justice court's actions as a discharge of the felony charge, and to move the district court for leave to file an information by affidavit with the district court, thus overriding the justice court's decision. See NRS 173.035. On June 26, 1992, the State filed such a motion, but the district court denied it on the basis that no valid preliminary hearing had been conducted in justice court as required by NRS 173.035. Accordingly, the State was left without an adequate remedy to contest the justice court's alleged excess of jurisdiction.
The district court is empowered to entertain petitions for writs of certiorari to prevent the justice court from exceeding its jurisdiction, which is exactly what the district court did in the instant case. Accordingly, we hold that the district court did not err in entertaining the State's petition for a writ of certiorari.
Whether the district court erred in concluding that the justice court exceeded its jurisdiction.
Parsons further contends that the district court erred in concluding that the justice court exceeded its jurisdiction in suppressing Parsons' second DUI conviction and amending the criminal complaint from a felony to a misdemeanor charge. We disagree.
Justice courts have only the authority granted by statute. See NRS 4.370(1). NRS 4.370(3) provides, "Justices' courts have jurisdiction of all misdemeanors and no other criminal offenses except as otherwise provided by specific statute." There is no statute providing the justice court with jurisdiction over a felony DUI charge. Thus, the justice court clearly lacked jurisdiction over the felony charge against Parsons.
Additionally, NRS 171.196 provides, "[w]here the offense is not triable in the justice's court, the defendant shall not be called upon to plead." Accordingly, the justice *1320 court erred in allowing Parsons to enter a plea. The justice court's only proper course of action given the felony charge against Parsons was to bind him over to district court or dismiss him based on an evidentiary evaluation of whether or not there was probable cause that the felony had been committed. See NRS 171.206.
Moreover, as the district court noted in granting the State's petition for a writ of certiorari, the justice court had no authority to sua sponte amend a felony complaint to a misdemeanor. Parsons argues that the justice court had such authority pursuant to NRS 173.095, which provides in part:
1. The court may permit an indictment or information to be amended at any time before verdict or finding if no additional or different offense is charged and if substantial rights of the defendant are not prejudiced.
(Emphasis added.) NRS 173.095, however, does not support Parsons' argument. The statute allows the court to "permit" an amendment, not to amend the complaint of its own accord. A sua sponte amendment from a felony to a misdemeanor amounts to the justice court attempting to charge a defendant absent any authority to do so, as the discretion and power to charge a defendant belong solely to the attorney general or the district attorney. See NRS 173.045. In the instant case, the State did not agree to the amendment; therefore, there was no misdemeanor charge pending against Parsons when the justice court permitted him to enter a plea.
Parsons additionally argues that the justice court had jurisdiction to amend the complaint despite NRS 4.370, NRS 171.196, and NRS 171.206 because these statutes govern preliminary hearings, and before any preliminary hearing was conducted, the defense counsel made an oral motion to suppress one of the prior misdemeanor convictions in accordance with NRS 174.125.[3] Such an argument fails to address the basic problem inherent in the justice court's actions. It was within the discretion of the justice court to consider the constitutional sufficiency of the priors only in the context of making an evidentiary determination of whether or not probable cause existed to bind Parsons over on the felony charge. When the justice court determined that a prior conviction was infirm on constitutional grounds, and that the felony charge accordingly could not stand, the only order that the justice court was jurisdictionally empowered to enter was a dismissal of the felony charge.[4]
In conclusion, we hold that the district court did not err in determining that the justice court exceeded its jurisdiction in suppressing Parsons' second DUI conviction, amending the complaint from a felony to a misdemeanor, and sentencing Parsons.
Whether the double jeopardy clause of the Fifth Amendment prevents the State from further prosecuting petitioner.
Parsons argues that jeopardy attached when the justice court sentenced him for a second-offense misdemeanor DUI, and that the State's attempt to prosecute him on a felony DUI charge based on the same facts underlying the misdemeanor conviction constitutes a violation of his Fifth Amendment rights. We disagree.
In order for a defendant to invoke the double jeopardy clause of the Fifth Amendment *1321 as a bar to prosecution, a defendant must be prosecuted in a court of competent jurisdiction. See Serfass v. United States, 420 U.S. 377, 391-92, 95 S.Ct. 1055, 1064-65, 43 L.Ed.2d 265 (1975) ("Both the history of the Double Jeopardy Clause and its terms demonstrate that it does not come into play until a proceeding begins before a trier `having jurisdiction to try the question of the guilt or innocence of the accused.' " (quoting Kepner v. United States, 195 U.S. 100, 133, 24 S.Ct. 797, 806, 49 L.Ed. 114 (1904))); accord State v. Lujan, 103 N.M. 667, 712 P.2d 13, 18 (Ct.App.1985) ("[T]he jurisdictional exception means that jeopardy cannot extend to an offense beyond the jurisdiction of the court in which the accused is tried."); State v. Cockrell, 102 Wash.2d 561, 689 P.2d 32, 36 (1984); In re Dubois, 84 Nev. 562, 567 n. 3, 445 P.2d 354, 356 n. 3 (1968) (noting that a lack of jurisdiction in the municipal court to convict for the felony with which appellant was later charged "may also serve as an independent basis for denying the claim of former jeopardy"); State v. Holm, 55 Nev. 468, 472, 37 P.2d 821, 822 (1935) (stating that the statute barring double jeopardy seems to contemplate that for a plea of jeopardy to be available it is necessary for the accused to have been proceeded against in a court of competent jurisdiction).
As discussed above, in this case there was no valid complaint charging Parsons with a misdemeanor because the State did not agree to an amendment of the felony complaint. Thus, the only complaint in existence when Parsons was sentenced was one charging a felony, over which the justice court had no jurisdiction. "An acquittal or a conviction by a court having no jurisdiction is void; therefore it is not a bar to subsequent indictment and trial by a court which has jurisdiction over the offense." Ex Parte Alexander, 80 Nev. 354, 359, 393 P.2d 615, 617 (1964) (holding that because the failure of the indictment to allege that the crime was committed in the State of Nevada prevented the district court from acquiring jurisdiction to try the case, the conviction resulting from trial was void and the petitioner could be retried). Therefore, Parsons' Fifth Amendment rights would not be violated if the justice court bound him over to the district court for a trial on the felony charge.
The purpose of the double jeopardy prohibition is to prevent the government from harassing citizens by subjecting them to multiple suits, or to the expense, embarrassment and ordeal of repeated trials. Green v. United States, 355 U.S. 184, 187, 78 S.Ct. 221, 223, 2 L.Ed.2d 199 (1957); State v. Lujan, 103 N.M. 667, 712 P.2d 13, 17 (Ct.App.1985). In the instant case, Parsons was not subjected to a trial, but was instead improperly permitted to plead guilty to a reduced charge upon his own motiona motion having no basis in law. Additionally, Parsons has neither served his sentence nor paid his fine, and has fled the jurisdiction. Thus, any prejudice to him would be minimal.
Accordingly, we conclude that Parsons' conviction is void and reject his claim that double jeopardy prevents the State from holding another preliminary hearing in the justice court on the felony complaint.

CONCLUSION
Based on the foregoing, we refuse to direct the district court to vacate its order nullifying Parsons' sentence and rescheduling the preliminary hearing. Parsons' petition is hereby denied.
NOTES
[1]  The justice court based this opinion on its own knowledge, as Parsons had been convicted on a guilty plea for this second offense in the same justice court in which he appeared in the instant case.
[2]  NRS 189.120 states, in pertinent part:

1. The state may appeal to the district court from an order of a justice's court granting the motion of a defendant to suppress evidence.
2. Such an appeal shall be taken:
(a) Within 2 days after the rendition of such an order during a trial or preliminary examination.
(b) Within 5 days after the rendition of such an order before a trial or preliminary examination.
[3]  Parsons' assertion that his motion was made in accordance with NRS 174.125 is incorrect, as the motion was not made in writing or with the requisite notice to the State. Thus, the State was in a position where it was unprepared to rebut the allegation of the constitutional infirmity of the second-offense DUI conviction.
[4]  In the instant case, however, the justice court improperly relied on its own knowledge in evaluating the constitutional sufficiency of the second conviction. The justice court's personal knowledge of the circumstances regarding Parsons' conviction for the second-offense misdemeanor DUI charge was not part of the record, and the use of this personal knowledge prejudiced the State. Accordingly, in the interests of justice, we recommend that the rescheduled preliminary hearing occur in a different justice court.
