Opinion
BEDSWORTH, J.To facilitate a plea agreement, the juvenile court dismissed one count and added another to a wardship petition that was filed against respondent Jeffrey H. The prosecution objected to the court’s actions, and on appeal it contends the court exceeded its authority in amending the petition on its own accord. Although Jeffrey does not dispute this contention, he argues the People’s appeal should be dismissed because it is aimed at an order that underlies the court’s decision to grant him probation. We find the appeal cognizable and reverse the order amending the petition.
PROCEDURAL BACKGROUND
In the spring of 2010, the District Attorney of Orange County filed three separate petitions to declare Jeffrey a ward of the juvenile court pursuant to Welfare and Institutions Code section 602.1 Taken together, the first two *1055petitions charged Jeffrey with possessing methamphetamine and marijuana for sale, transporting Ecstasy, and two counts of possessing controlled substance paraphernalia. The third petition charged Jeffrey with a single count of second degree robbery.
Jeffrey, who was in custody, denied all of the allegations, and his trial was set for May 26. However, discovery was not completed until May 24, so the court set a new trial date of June 2.
On that day, the parties were ready to proceed, but because there were no courtrooms available, the court continued the trial until June 7. Noting that June 7 was “day five of seven,” the judge stated “I don’t know if we’ll go that day, but we might have a better idea when we can.”2
On June 7, the matter was again continued. The judge explained, “Court’s unavailable today. We’re engaged in a contested trial, [f] At this time we’ll put this over for . . . trial to this Wednesday, which is June the 9th, 2010. . . . And that will be day seven of seven.”
On June 9, the parties answered ready for trial, but again there were no courtrooms available. After meeting with the parties in chambers, the court announced that Jeffrey was changing his plea. Under the plea agreement, the court dismissed the robbery charge in the third petition and added a new count (designated as count 2) charging Jeffrey with grand theft. Jeffrey then admitted the allegations, as amended, and the court placed him on probation.
The prosecutor objected to this procedure. Specifically, he objected to the court dismissing the robbery count and adding on its own motion the new count of grand theft. He stated, “It’s petitioner’s position that the court does not have the authority to do that type of plea agreement, that it would be, in fact, an illegal plea agreement.”
The judge responded, “I understand what you’re saying .... I’m not really happy about the situation and how it appeared. I want you to know this is a day-seven-of-seven trial. You know that. And there is no courtroom available. The only other remedy this court would have had would be to dismiss, [f] And with that, I think we’re done.”
The following day, the People filed a notice of appeal. The notice states the People are appealing from: “The trial court’s orders of June 9, 2010, *1056dismissing Count 1 of a single count petition to declare the minor a ward of the court, on its own motion amending to add its own Count 2, and accepting an admission to this Count 2 in an unlawful plea bargain, all over the People’s objection.”
DISCUSSION
The People’s argument is threefold: (1) The juvenile court usurped the prosecution’s charging authority by dismissing the robbery count and adding the grand theft count; (2) the court engaged in unlawful plea bargaining because it did not obtain the People’s consent to the plea agreement; and (3) the court failed to explain how dismissing the robbery count would further the ends of justice. The People contend that, in light of these errors, Jeffrey’s plea must be vacated and the court’s order dismissing the robbery charge and adding the grand theft charge must be reversed. Jeffrey does not dispute the substance of the People’s contentions. However, he claims the People’s appeal is not cognizable because they are challenging orders that underlie the grant of his probation. Jeffrey’s claim does not withstand scrutiny.
The statute governing appeals in juvenile court cases is section 800. Subdivision (b)(4) of that statute authorizes the People to appeal from an “order or judgment dismissing or otherwise terminating the action before the minor has been placed in jeopardy . . . .” (§ 800, subd. (b)(4).) Under that provision, the People may appeal from an order dismissing or terminating the action altogether or “where the order in question has the effect of terminating only part of the action.” (In re Rottanak K. (1995) 37 Cal.App.4th 260, 269 [43 Cal.Rptr.2d 543], italics omitted.) Since the People’s appeal in this case targets an order that had the effect of terminating part of the action against Jeffrey, i.e., the robbery count, it is authorized under section 800, subdivision (b)(4). (37 Cal.App.4th at pp. 264—273 [authorizing an appeal from an order sustaining a demurrer to various enhancement allegations].)
However, just because an appeal is authorized under that provision does not mean it is proper. Section 800 also contains an express prohibition on the People’s right to appeal from orders granting probation. Specifically, subdivision (c) provides: “Nothing contained in this section shall be construed to authorize an appeal from an order granting probation. Instead, the people may seek appellate review of any grant of probation, whether or not the court imposes disposition, by means of a petition for a writ of mandate or prohibition which is filed within 60 days after probation is granted. The review of any grant of probation shall include review of any order underlying the grant of probation.” (§ 800, subd. (c).)
Jeffrey concedes the People did not appeal from the order granting him probation. Nonetheless, he maintains section 800, subdivision (c) applies to *1057preclude their appeal because in attacking the court’s decision to amend the petition, they are challenging an order underlying the grant of probation. We disagree. Based on our Supreme Court’s decision in People v. Douglas (1999) 20 Cal.4th 85 [82 Cal.Rptr.2d 816, 972 P.2d 151] (Douglas), we find that section 800, subdivision (c) does not bar the People’s appeal in this case.
Douglas interpreted Penal Code section 1238, which governs the right of the People to appeal in adult criminal cases. Described as “the Penal Code counterpart of section 800” (In re Rottanak K., supra, 37 Cal.App.4th at p. 269), Penal Code section 1238, subdivision (d) contains a limitation on the People’s right to appeal that is materially.indistinguishable from the limitation set forth in Welfare and Institutions Code section 800, subdivision (c). In fact, the only difference between the two provisions is that Penal Code section 1238, subdivision (d) uses the word “sentence” in lieu of “disposition.”3 Therefore, Douglas's interpretation of Penal Code section 1238, subdivision (d) has logical implications for this case. (In re Do Kyung K. (2001) 88 Cal.App.4th 583, 590 [106 Cal.Rptr.2d 31] [since the Legislature used virtually identical language in Pen. Code, § 1238, subd. (d) and Welf. & Inst. Code, § 800, subd. (c), the “language should be given the same interpretation in both statutes”].)
In Douglas, the defendant was charged with two felonies, but as part of a plea agreement, the trial court reduced both offenses to misdemeanors and sentenced him to probation. Although the People objected to the plea, they did not object to the grant of probation itself. Rather, they appealed solely on the basis the trial court exceeded its authority in reducing one of the felonies to a misdemeanor. (Douglas, supra, 20 Cal.4th at pp. 88-89.)
In deciding whether the appeal was barred by Penal Code section 1238, . subdivision (d), the Douglas court noted the purpose of that provision is to ensure the People’s challenges to probation orders are heard and considered in a timely fashion. The court explained the provision “provide[s] a means for [writ] review of assertedly illegitimate probation orders while avoiding the unfairness that could result to a defendant who, while the People’s appeal from his or her probation grant is prepared, briefed, heard and decided, might serve all or a substantial part of the probationary period, only to be resentenced to a full state prison term if the People’s appeal is ultimately successful. . . . [Citations.]” (Douglas, supra, 20 Cal.4th at pp. 92-93.)
*1058In light of this consideration, the Douglas court determined the appeal prohibition in Penal Code section 1238, subdivision (d) applies not only when the People explicitly appeal from an order granting probation, but also when their appeal, “in substance,” challenges such an order. (Douglas, supra, 20 Cal.4th at p. 93.) In other words, it is not how the People label their claim, but what they target in it that dictates whether an appeal can lie in a particular case. (Ibid.) If the claim poses a direct threat to the defendant’s probation, it cannot be brought on appeal and instead must be raised by way of a writ. (Id. at p. 96.)
As noted, the People in Douglas only attacked the trial court’s order reducing the one felony charge to a misdemeanor. They did not attack the court’s order granting probation or seek a reversal of that order. Therefore, in neither form nor substance did their appeal target the court’s order granting probation. (Douglas, supra, 20 Cal.4th at pp. 93-94.)
Nevertheless, the defendant argued the appeal was barred because it targeted an “order underlying the grant of probation” within the meaning of Penal Code section 1238, subdivision (d). The Supreme Court rejected this claim. It ruled the reference to such orders in subdivision (d) simply clarifies the scope of review available when a probation order is challenged by way of writ. (Douglas, supra, 20 Cal.4th at p. 94.) It does not require “ ‘all aspects of a case in which a defendant is placed on probation’ to be reviewed by writ petition alone.” (Id. at p. 95.) In fact, even if a reversal of the order in question would necessarily result in the defendant’s plea and conviction being vacated, that does not mean the order is nonappealable. (Id. at p. 94, fa. 9.) Rather, it is only when the People effectively mount a direct threat to the defendant’s probation that the appeal prohibition in Penal Code section 1238, subdivision (d) comes into play. (20 Cal.4th at p. 96.)
In the present case, the People have not appealed from an order granting probation. Instead, they have appealed from an order dismissing one count in a petition, adding another, and allowing Jeffrey to admit the new allegation as part of a plea bargain. In so doing, the People simply seek reinstatement of the original charges; they are not attacking, in either form or substance, the probationary grant itself. Because their appeal does not pose a direct threat to Jeffrey’s probation, it is not barred by section 800, subdivision (c). (Cf. People v. Alice (2007) 41 Cal.4th 668 [61 Cal.Rptr.3d 648, 161 P.3d 163] [although the People could appeal the trial court’s dismissal of a felony charge, they could not appeal a subsequent order granting the defendant probation].)
The remaining issue requires little discussion. In fact, Jeffrey does not dispute it. The trial court exceeded its authority in amending the third petition *1059over the prosecution’s objection to dismiss the robbery count and add a new count of grand theft and then allowing Jeffrey to admit this new allegation as part of a plea bargain. The law is clear that “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.” (People v. Orin (1975) 13 Cal.3d 937, 943 [120 Cal.Rptr. 65, 533 P.2d 193]; accord, People v. Segura (2008) 44 Cal.4th 921, 930 [80 Cal.Rptr.3d 715, 188 P.3d 649] [“only the prosecutor is authorized to negotiate a plea agreement on behalf of the state”]; People v. Allan (1996) 49 Cal.App.4th 1507 [57 Cal.Rptr.2d 269] [trial court overstepped its authority in dismissing charges in order to facilitate a plea bargain to which the People objected]; People v. Superior Court (Ludwig) (1985) 174 Cal.App.3d 473 [220 Cal.Rptr. 87] [trial court’s failure to obtain prosecutor’s consent to plea agreement rendered agreement illegal].) Therefore, the trial court’s order amending the petition must be reversed, and the original charges reinstated.
DISPOSITION
The trial court’s order amending the third petition is reversed. The matter is remanded to the trial court with directions to reinstate count 1 (second degree robbery) and delete count 2 (grand theft) in that petition and to allow Jeffrey to withdraw his admission to the charges.
Rylaarsdam, Acting P. J., and Fybel, J., concurred.
Respondent’s petition for review by the Supreme Court was denied September 28, 2011, S194755. Kennard, J., was of the opinion that the petition should be granted.
Unless noted otherwise, all further statutory references are to the Welfare and Institutions Code.
The court’s reference to “day five of seven” reflects its awareness that when, as here, a minor consents to a jurisdictional hearing date that is more than 15 days beyond the date he is ordered detained, “the hearing shall commence on the date to which it was continued or within seven days thereafter . . . .” (§ 682, subd. (e).)
Penal Code section 1238, subdivision (d) provides: “Nothing contained in this section shall be construed to authorize an appeal from an order granting probation. Instead, the people may seek appellate review of any grant of probation, whether or not the court imposes sentence, by means of a petition for a writ of mandate or prohibition which is filed within 60 days after probation is granted. The review of any grant of probation shall include review of any order underlying the grant of probation.”