
184 Cal.App.4th 1136 (2010)
109 Cal.Rptr.3d 449
THE PEOPLE, Plaintiff and Appellant,
v.
AARON MICHAEL WOOSLEY, Defendant and Respondent.
No. C061440.
Court of Appeals of California, Third District.
May 21, 2010.
*1139 Edmund G. Brown, Jr., Attorney General, Michael P. Farrell and Dane R. Gillette, Assistant Attorneys General, Catherine Chatman, George M. Hendrickson and John G. McLean, Deputy Attorneys General, for Plaintiff and Appellant.
Allen G. Weinberg, under appointment by the Court of Appeal, for Defendant and Respondent.


*1140 OPINION
NICHOLSON, Acting P. J.
To induce defendant to plead guilty to all counts and admit the charged enhancement, the trial court promised, over the prosecutor's objection, to dismiss the enhancement and impose an agreed-upon sentence. We conclude this was an unlawful judicial plea bargain. Therefore, we reverse.

BACKGROUND
The district attorney alleged that defendant Aaron Michael Woosley committed a burglary (first degree) and, while released on his own recognizance, committed another burglary (second degree) and petty theft. (Pen. Code, §§ 459 [burglary], 484 [petty theft], 12022.1, subd. (b) [on-bail enhancement].)[1]
On July 18, 2008, after the trial court asked defense counsel to "outline the situation," the following took place:
"[DEFENSE COUNSEL]: ... [¶] This is a conditional plea, the condition being that the Court will give [defendant] an opportunity on probation, but that will come with a four-year, eight-month suspended state prison sentence: Two years being for the burglary in the first-degree, two years being for the [on-bail] Enhancement, and eight months being for the second-degree burglary.
"THE COURT: Okay. [¶] I understand this is not with the approval of the District Attorney.
"[PROSECUTOR]: That's correct, Your Honor."
And later:
"[PROSECUTOR]: ... [¶] ... I would object to the Court giving a suspended prison promise at this time. I'd ask the Court to get the probation report, and if the Court still wants to give a suspended prison term promise, they can, or they can have the defendant withdraw the plea.
*1141 "THE COURT: What it amounts to that if I reject the plea, he can withdraw it, and then we'll be where we were, but if Probation's report comes back or if the Court is satisfied after reading the probation, this is a wise disposition.
"But in any event, we don't have to make the final arguments on this at this point, but it is without your approval.
"[PROSECUTOR]: It is without my approval."
The trial court accepted defendant's plea of no contest to the burglaries and petty theft, and his admission to the on-bail enhancement. Paragraph 8 of the preprinted plea form has a typed portion stating no threats or promises were made except as stated in a handwritten portion, in part as follows: "This is a conditional & negotiated plea. . . . These pleas are conditioned upon the defendant not receiving state prison at the outset. The defendant will receive 4 years 8 months suspended state prison sentence." Paragraph 11 was initialed, and it states: "My attorney has explained to me that if the court refuses to accept the above-stated agreement, I will be allowed to withdraw my plea."
The probation report noted in part that the pleas were "`conditional upon the defendant not receiving state prison at the outset. The defendant will receive 4 years 8 months suspended state prison sentence.' [¶] NOTE: The district attorney's office objects to this agreement."
The probation report states that defendant was 19 years old and homeless. His wife and two children live with her father. Defendant finished 11th grade, and has a lengthy juvenile record, including three felony adjudications, and several cases involving violence. Defendant was a ward of the juvenile court, on probation at the time of these offenses, and was not suitable for adult probation because of "excessive criminality." The report recommends eight years eight months in state prison.
On August 14, 2008, defense counsel asked the trial court to follow the "indicated" sentence and place defendant on probation. The prosecutor objected as follows:
*1142 "[PROSECUTOR]: Your Honor, this is not an indicated sentence. This is a judicial plea bargain, which is forbidden by the California Supreme Court and specifically by Penal Code Section 1192.5.[2] The Court made a conditional promise conditioned on the plea. That is not allowed under 1192.5. It says specifically in paragraph eight of the plea form that it's conditioned upon something. When it is conditioned upon something, it is a plea. A plea cannot be taken over the prosecuting attorney's objection in court. I did object to that.
"THE COURT: And I notice that probation appears to be on the same wavelength as the district attorney and strongly believed that prison is the appropriate response at this point in time, so I'm not willing to press on."
On October 21, 2008, defendant signed a preprinted plea form stating he would again admit all the pending charges. The handwritten portion of paragraph 8 states: "This is a conditional plea. . . . These pleas & admission are conditioned upon the defendant receiving 2 years 8 months state prison." Again, paragraph 11 was initialed, stating "that if the court refuses to accept the above-stated agreement, I will be allowed to withdraw my plea."
The trial court proposed to accept this plea, "conditional as it is, see what Probation has to say about it, and set it, perhaps, for a 1204 hearing, at which time [the] People would make clear their basis for their disagreement."[3]
The prosecutor stated: "Actually, it is the People's position that this is an illegal plea. It is an illegal judicial plea bargain. The Court is taking away powers from the People inhering in the People's position and giving a conditional plea to a defendant." The prosecutor cited authorities in support, and argued, "You are promising, your Honor, this defendant something, and if he doesn't like it, he can withdraw his plea. That's strictly forbidden."
The trial court replied: "If, I believe, the probation report reveals information that I am not currently witting of, that means I can walk away from the plea as well."
The prosecutor objected that the trial court's agreement to dismiss the on-bail enhancement was improper, and asked the court not to accept the *1143 plea, stating, "[I]f the defendant wants to truly plead to the sheet no promises, I can make my arguments at 1204, but he does not get a chance to withdraw his plea when I convince you later that he deserves more than two [years] eight [months]." Defense counsel countered that defendant was admitting all charges, and sentencing "is the job of the Court and your Honor. [¶] And so if the Court is giving a condition on it, there's nothing illegal about that." The prosecutor replied that the court could give an indicated sentence but not a conditioned sentence.
The trial court accepted defendant's plea.
The prosecutor sought writ relief, which this court denied, stating there was an adequate remedy by appeal. (People v. Superior Court (Woosley) (Dec. 4, 2008, C060415) [nonpub. order].)
On February 9, 2009, the probation hearing began. In part, defendant testified about his hard early life, and about his juvenile delinquency history. The hearing was continued to February 23, 2009. That day, after other witnesses testified, the parties addressed sentencing:
"[DEFENSE COUNSEL]: . . . [¶] I'd ask the Court to follow its intended [disposition] in this case. This was a case
"THE COURT: That's the one that's outlined on the plea form?
"[DEFENSE COUNSEL]: Yes . . . .
"THE COURT: If I were to implement that, there's a burglary, first degree, which was a two, four, six. There's a misdemeanor, and there's a 459 second
"[DEFENSE COUNSEL]: Right.
"THE COURT:and an enhancement 12022.1(b). If I took the lower term on the burglary and one-third the middle on the 459, how would the enhancement fit within the two years, eight months?
"[DEFENSE COUNSEL]: The Court would have to dismiss under 1385 in the interest of justice. I think the Court can do that in that my client at the time of these offenses was just 18 years old. He has pled to all charges that he was charged with. He's taken complete responsibility for what he did."[4]
*1144 The prosecutor objected, both because of the length and severity of defendant's criminal record, despite his youth, and as follows:
"Using section 1385 as defense counsel is asking you to do to dismiss an enhancement pursuant to . . . section 12022.1(b) is something that's very frowned upon by the appellate courts . . . .
"I would agree with [defense counsel] that this Court does have the authority to do so, but I don't think this is the case to do it. Essentially this Court is being asked to ignore the fact that the People argued to keep the defendant in custody. The defendant insisted on getting out, got out and wasn't out but a couple of months before he committed a new felony. It's a repeat pattern with him."
The trial court continued the matter.
At the next hearing, on March 2, 2009, the prosecutor added: "I believe that it would be an [abuse of] discretion for this Court to follow this plea agreement and [I] ask for the Court to reject it and set it back for trial setting." The defense argued the trial court could dismiss the enhancement based on defendant's age, the fact that this was his first adult felony and his first prison term, and the fact that he took responsibility by admitting all the charges. The prosecutor replied: "Your Honor, it's disingenuous to say this defendant has pled to all the charges, because he's pleading to the charges and then as a condition, one of them is dismissed. So that is not pleading to all the charges."
The trial court selected the first degree burglary count as the principal term, for which it imposed the lower term of two years; it then imposed one-third the midterm on the second degree burglary count, eight months. (See fn. 4.) The petty theft resulted in a concurrent jail sentence. The on-bail enhancement was dismissed, but the trial court did not state on the record any reason for doing so. However, the court minutes contain a handwritten notation giving the reasons as "Age of Def." and "Prior Record."
The People timely filed this appeal from the order dismissing the on-bail enhancement. (§ 1238, subd. (a)(8).)

DISCUSSION
The People contend the trial court engaged in unlawful judicial plea bargaining. We agree. The trial court stepped into the role of the prosecutor *1145 when it induced defendant to plead guilty in exchange for a commitment to dismiss the on-bail enhancement to reach the agreed-upon sentence.
The California Supreme Court has stated as follows:
(1) "The process of plea bargaining which has received statutory and judicial authorization as an appropriate method of disposing of criminal prosecutions contemplates an agreement negotiated by the People and the defendant and approved by the court. [Citations.] Pursuant to this procedure the defendant agrees to plead guilty in order to obtain a reciprocal benefit, generally consisting of a less severe punishment than that which could result if he were convicted of all offenses charged. [Citation.] This more lenient disposition of the charges is secured in part by prosecutorial consent to the imposition of such clement punishment . . . . [I]mplicit in all of this is a process of `bargaining' between the adverse parties to the casethe People represented by the prosecutor on one side, the defendant represented by his counsel on the otherwhich bargaining results in an agreement between them." (People v. Orin (1975) 13 Cal.3d 937, 942-943 [120 Cal.Rptr. 65, 533 P.2d 193], citation omitted (Orin); see People v. Segura (2008) 44 Cal.4th 921, 929 [80 Cal.Rptr.3d 715, 188 P.3d 649] (Segura) ["an accepted and `integral component of the criminal justice system'"].)
(2) This process implicates the separation of powers doctrine:
"While the legislative branch of government bears the responsibility and power to define criminal offenses and to prescribe punishment in mandatory or alternatively permissible forms, the imposition of sentence within the legislatively determined limits is exclusively a judicial function. [Citation.] Hence, the exercise of sentencing power cannot be made subject to the consent of the district attorney because the requirement of that consent is an injection of the executive into the province of the judicial branch of government. [Citation.] Similarly, once the executive power has been exercised by the filing of a criminal charge `the process which leads to acquittal or to sentencing is fundamentally judicial in nature.' [Citations.] . . .
"As the process which leads to acquittal or sentencing is a function exclusively vested within the judicial branch of government, the charging function of the criminal process is the sole province of the executive. [Citation.] It is equally the function of the executive to engage in any negotiation with the defense by which a lenient disposition of the charge made is secured without trial. [(Citing Orin, supra, 13 Cal.3d at p. 942.)] `[The] court has no authority to substitute itself as the representative of the People in the negotiation process and under the guise of "plea bargaining" to "agree" to a disposition of the case over prosecutorial objection.' [(Citing id. at *1146 p. 943.)] The `plea bargaining' process foreclosed to the judicial branch of government includes the acceptance of a plea of guilty in return for `clement punishment.' [(Citing id. at p. 942.)]" (People v. Superior Court (Felmann) (1976) 59 Cal.App.3d 270, 275-276 [130 Cal.Rptr. 548] (Felmann).)
(3) In addition to trenching on prosecutorial discretion, judicial plea bargainingthat is, disposing of charges over the objections of the prosecutor in order to induce a guilty pleamay "contravene express statutory provisions requiring the prosecutor's consent to the proposed disposition, would detract from the judge's ability to remain detached and neutral in evaluating the voluntariness of the plea and the fairness of the bargain to society as well as to the defendant, and would present a substantial danger of unintentional coercion of defendants who may be intimidated by the judge's participation in the matter." (Orin, supra, 13 Cal.3d at p. 943, fn. omitted; see Segura, supra, 44 Cal.4th at p. 930.)
(4) Some trial courts want to encourage resolution of criminal cases without the prosecutor's consent, and employ what has come to be known as the "indicated sentence." "In an indicated sentence, a defendant admits all charges, including any special allegations and the trial court informs the defendant what sentence will be imposed. No `bargaining' is involved because no charges are reduced. [Citations.] In contrast to plea bargains, no prosecutorial consent is required. [Citation.]" (People v. Allan (1996) 49 Cal.App.4th 1507, 1516 [57 Cal.Rptr.2d 269]; see People v. Vessell (1995) 36 Cal.App.4th 285, 296 [42 Cal.Rptr.2d 241] (Vessell).) In such cases, the trial court "may indicate to [the] defendant what its sentence will be on a given set of facts without interference from the prosecutor except for the prosecutor's inherent right to challenge the factual predicate and to argue that the court's intended sentence is wrong." (Felmann, supra, 59 Cal.App.3d at p. 276.) An "`indicated sentence' . . . falls within the `boundaries of the court's inherent sentencing powers.'" (Vessell, supra, 36 Cal.App.4th at p. 296.)
"Plea bargaining as described in People v. Orin, supra, 13 Cal.3d at page 942, may be related to an `indicated sentence' but is a distinct way of compromising a case short of trial. When giving an `indicated sentence,' the trial court simply informs a defendant `what sentence he will impose if a given set of facts is confirmed, irrespective of whether guilt is adjudicated at trial or admitted by plea.' [Citations.] An accused retains the right to reject the proposed sentence and go to trial. The sentencing court may withdraw from the `indicated sentence' if the factual predicate thereof is disproved." (People v. Superior Court (Ramos) (1991) 235 Cal.App.3d 1261, 1271 [1 Cal.Rptr.2d 333]; see People v. Brown (1986) 177 Cal.App.3d 537, 551-552, fn. 17 [223 Cal.Rptr. 66]; 20A Cal.Jur.3d (2009) Crim. Law: Pretrial Proceedings, § 888, pp. 607-609 [when a sentence is "indicated," "no guarantee is made"].)
*1147 (5) Here, the trial court gave what appeared to be an indicated sentence. But that sentence could be imposed only if the trial court dismissed the on-bail enhancement. Therefore, it was more than just an indicated sentence; it included, anticipatorily, the dismissal of the on-bail enhancement.
(6) Even though section 1385 gives the trial court discretion to dismiss "an action" in the interests of justice, the anticipatory commitment by the court to exercise that discretion to dismiss the enhancement cannot be used to negate the role of the prosecutor.[5] Such use encroaches on the prosecutor's charging authority and exposes the process to the evils discussed by the California Supreme Court in Orin, supra, 13 Cal.3d at page 943. It "would contravene express statutory provisions requiring the prosecutor's consent to the proposed disposition, would detract from the judge's ability to remain detached and neutral in evaluating the voluntariness of the plea and the fairness of the bargain to society as well as to the defendant, and would present a substantial danger of unintentional coercion of defendants who may be intimidated by the judge's participation in the matter. [Citation.]" (Ibid., fns. omitted.)
Defendant asserts, however, that this was nothing more than a plea of guilty to all charges and admission of the enhancement with an indicated sentence. To the contrary, defendant's characterization ignores the reality that the plea did not expose him to punishment for the on-bail enhancement because the trial court had promised to dismiss it. The form of the bargain was to have defendant admit the on-bail enhancement in anticipation of the trial court "exercising" its discretion to dismiss the enhancement, but the substance of the bargain was no different from the trial court dismissing the on-bail enhancement before taking the plea. Therefore, the bargain could be made only with the prosecutor's consent.
By defendant's reasoning, the trial court could agree to dismiss any or all of charges or enhancements, pursuant to section 1385, in exchange for a defendant's guilty plea on all the charges and enhancements. Such a practice is within neither the spirit nor the letter of state law as summarized in Orin.
We therefore conclude that the plea bargain in this case exceeded the trial court's authority and must be vacated.


*1148 DISPOSITION
The judgment is reversed with directions to the trial court to vacate defendant's plea and reinstate the dismissed enhancement.
Robie, J., and Butz, J., concurred.
NOTES
[1]  Further unspecified references are to the Penal Code.

Section 12022.1, subdivision (b) states: "Any person arrested for a secondary offense which was alleged to have been committed while that person was released from custody on a primary offense shall be subject to a penalty enhancement of an additional two years in state prison which shall be served consecutive to any other term imposed by the court."
For convenience, we refer to this as the "on-bail" enhancement, its customary designation, although defendant was not on bail, but had been released on his own recognizance.
[2]  This may be a typographical error or perhaps the prosecutor misspoke. He probably meant section 1192.7.
[3]  Section 1204 provides for a hearing to receive evidence of aggravating and mitigating sentencing factors.
[4]  If a prison sentence is imposed, first degree burglary is punishable by two, four, or six years, and second degree burglary is punishable by 16 months, two years, or three years. (§§ 18, 461.) By imposing the low term of two years for first degree burglary, and a consecutive eight-month term for second degree burglaryone-third the midterm of two years (see § 1170.1, subd. (a))the trial court could reach a sentence of two years eight months by, and only by, dismissing the enhancement.
[5]  Section 1385, subdivision (a) states: "The judge or magistrate may, either of his or her own motion or upon the application of the prosecuting attorney, and in furtherance of justice, order an action to be dismissed. The reasons for the dismissal must be set forth in an order entered upon the minutes. No dismissal shall be made for any cause which would be ground of demurrer to the accusatory pleading."
