
8 So.3d 1033 (2008)
STATE of Alabama
v.
Louis ANDERSON.
CR-07-1171.
Court of Criminal Appeals of Alabama.
September 26, 2008.
Troy King, atty. gen., and Laura I. Cuthbert, asst. atty. gen., for appellant.
Roianne Houlton Conner and Timothy A. Offord, Jr., Montgomery, for appellee.
BASCHAB, Presiding Judge.
The appellee, Louis Anderson, was indicted for unlawfully breaking and entering a motor vehicle and second-degree theft of property. On February 26, 2008, he pled guilty to unlawfully breaking and entering a motor vehicle and second-degree *1034 theft of property, and the trial court adjudicated him guilty of unlawfully breaking and entering a motor vehicle. However, based on the appellee's statements regarding the facts of the case, the trial court reserved its adjudication of guilt on the second-degree theft of property charge so the State could present witnesses regarding the factual basis for the guilty plea. On March 21, 2008, the trial court sentenced the appellee, as a habitual offender, to serve a term of fifteen years in prison on the unlawfully breaking and entering a motor vehicle conviction. See § 13A-5-9(c)(1), Ala.Code 1975. However, because the State did not present any witnesses at that time regarding the second-degree theft of property charge, the trial court dismissed that charge. The State appealed that dismissal.
During the guilty plea proceeding, the following occurred:
"[THE APPELLEE]: I seen a car with some money in it. I broke the window. I took the bag to the car. Then I tried to go back and get the CD player, but I neverthe police ran up on me, so I jumped out of the car and took off running. So that's how
"THE COURT: Well, how did they find the CDs and the CD player in your car?
"[THE APPELLEE]: I don't know. But I never did took them, but I plead guilty to it.
"THE COURT: Well, no, you can't plead guilty to it unless they found them in your car.
"[THE APPELLEE]: I took the money and
"THE COURT: Where was the money?
"[THE APPELLEE]: $160.
"THE COURT: Where was it?
"[THE APPELLEE]: In the car.
"THE COURT: Where? How did you see it from outside the car?
"[THE APPELLEE]: It was laying on the floor.
"THE COURT: On the floor, $160. Okay. Well, how did they find the CDs and the CD player in your car?
"[THE APPELLEE]: I couldn't tell you that, Your Honor.
". . . .
"THE COURT: Well, how did the CDs and the CD player get in your car?
"[THE APPELLEE]: I'm telling you the truth. That's how it happened, Your Honor. I broke the window. $160 was laying on the floor. I got the money, took it back to the car. I was going to go back to the car and get the CD player up out of the car, but when I was wrestling to get the CD player out of the car, the police ran up on me. And I jumped out of the car and took off running.
"THE COURT: Okay. All right. The Court hereby finds that you understand your constitutional rights, that you enter your plea knowingly, voluntarily. The Court accepts the plea on the breaking and entering a vehicle and adjudicates you guilty of breaking and entering a vehicle. I'm going to reserve adjudication on the theft of property until the day of sentence, so have the officers here because there may be some confusion on
"[PROSECUTOR]: Your Honor, I think he justhe testified that he got back in the car and attempted to take now, I don't knowI think they found
"THE COURT: Now, if you want to do attemptnow, if you want to do attempt
"[PROSECUTOR]: He attempted to get the radio out.
"THE COURT: If you want to do attempt, then that's fine.
"[PROSECUTOR]: Okay.

*1035 "THE COURT: If not, have the officers here to see whether there is some confusion
"[PROSECUTOR]: Will do.
"THE COURT:in the testimony. That's all.
"[PROSECUTOR]: Okay.
"THE COURT: Okay? On the day of sentencing. I'll reserve adjudication on the theft of property second degree. There's some question whether it will be theft of property second degree or theft of property third degree anduntil March the 21st. I just need to know where were the CDs and tape player actually found."
(R. 8-12.)
During the sentencing hearing, because the State did not call any witnesses to testify regarding the second-degree theft of property charge, the trial court dismissed that count of the indictment. The court explained that, because the appellee denied taking the CD player and CDs out of the victim's vehicle, it wanted a law enforcement officer or other witness to testify as to where those items were found. The State objected, arguing that it had the discretion to determine whether the charge would be dismissed and that, at a minimum, the appellee had admitted to third-degree theft of property. It then asked that the trial court allow the appellee to withdraw his guilty plea to second-degree theft of property and be tried on that charge. However, the trial court stated that it would either allow the State to amend the charge to third-degree theft of property or dismiss that count of the indictment. After further discussion as to whether the State had had its witnesses in court at the appropriate times, the trial court dismissed the second-degree theft of property charge.
The State argues that the trial court erroneously dismissed the second-degree theft of property charge based on the insufficiency of the evidence. The appellee argues that the trial court dismissed the charge because the State did not proceed with the prosecution of the charge. During the sentencing hearing, the trial court indicated that it was dismissing the charge because the State did not comply with its order to have a witness or witnesses at that hearing to testify as to where the CD player and CDs were found. In essence, the trial court dismissed the second-degree theft of property charge because the State did not present evidence, during either the guilty plea proceeding or the sentencing hearing, to establish a sufficient factual basis to support the appellee's guilty plea based on that charge. However, we have previously held that it is not appropriate to dismiss an indictment prior to trial based on a lack of evidence. See State v. McClain, 911 So.2d 54 (Ala.Crim. App.2005); State v. Foster, 935 So.2d 1216 (Ala.Crim.App.2005); State v. Edwards, 590 So.2d 379 (Ala.Crim.App.1991).
Moreover, during the sentencing hearing, the State correctly noted that it had the discretion to determine whether to pursue a lesser charge and asked that the trial court allow the appellee to withdraw his guilty plea to second-degree theft of property and be tried on that charge. As the Alabama Supreme Court explained in Piggly Wiggly No. 208, Inc. v. Dutton, 601 So.2d 907, 910-11 (Ala.1992):
"In exposing and prosecuting crimes, district attorneys are members of the executive branch of state government. Dickerson v. State, 414 So.2d 998, 1008 (Ala.Crim.App.1982).... See, also, 63A Am.Jur.2d Prosecuting Attorneys § 24 (1984):
"`A duty rests upon the prosecuting attorney to prosecute in his county or district, on behalf of the people, all public offenses. Where a statute so provides, the prosecuting attorney *1036 must initiate proceedings for the prosecution of persons charged with or reasonably suspected of public offenses, when he has information that such offenses have been committed. But, as a general rule, if a prosecutor has possible cause to believe that the accused committed an offense defined by statute, the decision whether or not to prosecute, and what charge to file or bring before a grand jury, rests entirely in his discretion. In other words, the duty to prosecute is not absolute, but qualified, requiring of the prosecuting attorney only the exercise of a sound discretion, which permits him to refrain from prosecuting whenever he, in good faith and without corrupt motives or influences, thinks that a prosecution would not serve the best interests of the state, or that, under the circumstances, a conviction could not be had, or that the guilt of the accused is doubtful or not capable of adequate proof.
"`A prosecutor is not subject to judicial supervision in determining what charges to bring and how to draft accusatory pleadings; he is protected from judicial oversight by the doctrine of separation of powers. Thus, it has been held that mandamus will not lie to compel a prosecuting attorney to institute a criminal prosecution, since the acts of a prosecuting attorney are not purely ministerial acts, but involve in a large measure learning and the exercise of discretion.'
". . . .
"Article III, § 43, Constitution of Alabama 1901, provides in pertinent part:
"`[T]he judicial [branch of government] shall never exercise the legislative and executive powers ....'
"In Finch v. State, 271 Ala. 499, 503, 124 So.2d 825, 829 (1960), this Court recognized:
"`Great care must be exercised by the courts not to usurp the functions of other departments of government. § 43, Constitution 1901. No branch of the government is so responsible for the autonomy of the several governmental units and branches as the judiciary. Accordingly, we have held that courts cannot and will not interfere with the discretion vested in other units or branches of government.
"`. . . .'
"This Court is precluded by Art. III, § 43, of the Alabama Constitution from interfering with [the prosecutor's] exercise of discretion in this regard."
Also, in Dickerson v. State, 414 So.2d 998, 1008 (Ala.Crim.App.1982), abrogated on other ground by Ex parte Bohannon, 564 So.2d 854 (Ala.1988), we stated:
"[I]t is obvious that the office of district attorney falls under the purview of the executive rather than the judicial branch of government. While the office of district attorney may be enumerated in § 6.20(a) of Amendment No. 328 to the 1901 Alabama Constitution, the district attorney is not a judicial officer or a part of the judicial branch of government because of his office....
"The district attorney is a public officer representing the sovereign power of the people and has been defined as `the foremost representative of the executive branch of government in the enforcement of the criminal law in his county.' 27 C.J.S. District and Prosecuting Attorneys § 1(a) (1959). He is only an officer of the court to the extent that all attorneys are officers of the court. People v. Rodriguez, 13 Misc.2d 1004, 178 N.Y.S.2d 993 (1958), cert. denied, 362 U.S. 984, 80 S.Ct. 959, 4 L.Ed.2d 1009 (1960).
"Amendment 328 does not give the judicial branch any power, authority, or control over the office of district attorney. *1037 No rule of judicial administration governs the office. Even the powers and duties of the district attorney make no reference to control and regulation by the judicial branch. Section 12-17-184, Code of Alabama 1975.
"It is the obligation of the attorney general and the district attorney to expose and prosecute crimes. In re White, 53 Ala.App. 377, 300 So.2d 420, cert. denied, 293 Ala. 778, 300 So.2d 439 (1974). Such is not the primary function of the judicial branch of government."
Because this case involved a guilty plea rather than a trial, the trial court should not have dismissed the indictment based on lack of evidence to support the plea after the appellee disputed the factual basis for his guilty plea and the State did not present other witnesses to establish the factual basis for the plea. See McClain, supra; Foster, supra; Edwards, supra. Rather, it should have simply refused to accept the appellee's plea to that charge and allowed the State to determine, in its discretion, whether to amend the charge to third-degree theft of property or to proceed to trial. See Dutton, supra; Dickerson, supra. We understand the trial court's frustration. Nevertheless, we must conclude that it exceeded its authority when it dismissed the second-degree theft of property charge against the appellee. Therefore, we reverse the trial court's judgment and remand this case for proceedings that are consistent with this opinion.
REVERSED AND REMANDED.
McMILLAN, SHAW, and WELCH, JJ., concur. WISE, J., dissents, with opinion.
WISE, Judge, dissenting.
I respectfully dissent from the majority's decision to reverse the trial court's dismissal of the second-degree-theft-of-property charge against Anderson. This case is before us based on the State's appeal of the trial court's order, pursuant to Rule 15.7, Ala.R.Crim.P. In my opinion, however, the facts of this case do not meet the criteria for an appeal under Rule 15.7.
It is well settled that
"`the State has a limited right to appeal; that right is governed by § 12-12-70, Ala.Code 1975 [authorizing the State to appeal from a judgment holding a statute invalid], § 12-22-91, Ala.Code 1975 [authorizing the State to appeal when the statute under which the indictment is preferred is held to be unconstitutional]; and Rule 15.7, Ala. R.Crim. P. [authorizing the State to take a pretrial appeal from rulings suppressing evidence or from orders dismissing all or part of an indictment]. According to these provisions, the State may appeal from ... pretrial rulings ... dismissing charges....'"
State v. D.L.A., 975 So.2d 1014, 1017 (Ala. Crim.App.2007), quoting State v. Maddox, 828 So.2d 946, 947 (Ala.Crim.App.2001). See also State v. Seawright, 961 So.2d 187 (Ala.Crim.App.2006). However, it is equally well settled that "once jeopardy has attached the State no longer has a right to appeal." State v. Savage, 961 So.2d 181, 183 (Ala.Crim.App.2006). Further "[i]n relation to a guilty plea, jeopardy attaches when a guilty plea is entered and a court of competent jurisdiction accepts that plea." Id.
Here, Anderson pleaded guilty to one count of unlawfully breaking and entering a motor vehicle and one count of second-degree theft of property. However, after hearing Anderson's statements regarding the facts of the case the trial court accepted Anderson's guilty plea to unlawfully breaking and entering a motor vehicle, but declined to adjudicate Anderson guilty of second-degree theft of property. Subsequently, the trial court dismissed the theft charge against Anderson. In my opinion, *1038 because the trial judge did not dismiss the theft charges until after Anderson had attempted to plead guilty to the charge, jeopardy had already attached, and the State no longer had a right to appeal the circuit court's dismissal of the second-degree-theft-of-property charge. Given these circumstances, the proper course of action for the State would have been to petition this Court for a writ of mandamus pursuant to Rule 21, Ala.R.App.P., rather than a pretrial appeal pursuant to Rule 15.7, Ala.R.Crim.P., because a petition for a writ of mandamus is the proper avenue for the State to seek redress of claims when there is no other relief available. See Ex parte Sullivan, 779 So.2d 1157 (Ala.2000) (recognizing that the State could by mandamus petition seek review of the trial court's dismissal of an indictment after jeopardy attached); and State v. Savage, 961 So.2d 181 (Ala.Crim.App.2006) (granting State's mandamus petition challenging trial court's dismissal of indictment after jeopardy had attached). Because this appeal is before this Court pursuant to Rule 15.7, Ala.R.Crim.P., rather than pursuant to the mandamus procedures provided in Rule 21, Ala.R.App.P., I believe that we have no recourse but to dismiss this appeal. Accordingly, I must respectfully dissent.
