
115 Cal.Rptr.2d 59 (2001)
94 Cal.App.4th 1249
The PEOPLE, Plaintiff and Respondent,
v.
Randy Loyd BUTTRAM, Defendant and Appellant.
No. G028162.
Court of Appeal, Fourth District, Division Three.
December 31, 2001.
Review Granted March 13, 2002.
Amanda F. Doerrer, under appointment by the Court of Appeal, for Defendant and Appellant.
Bill Lockyer, Attorney General, David P. Druliner, Chief Assistant Attorney General, Gary W. Schons, Assistant Attorney General, Laura Whitcomb Halgren and Robert M. Foster, Deputy Attorneys General, for Plaintiff and Respondent.


*60 OPINION
RYLAARSDAM, J.
Defendant Randy Loyd Buttram appeals from the judgment sending him to prison for six years after he pleaded guilty to possessing heroin and methamphetamine in exchange for a promise his sentence would not exceed six-years. He failed to obtain a certificate of probable cause from the trial court. He contends the court abused its discretion by refusing to initiate proceedings to commit him to the California Rehabilitation Center (CRC) under Welfare and Institutions Code section 3051.
We invited supplemental briefing as to whether the appeal is properly brought under an exception to the certificate of probable cause requirement. We conclude such a certificate was required and dismiss the appeal.
Defendant had several prior felony convictions and agreed to plead guilty in exchange for a promise by the court that he would not be sentenced to more than six years in prison. On the plea form, the six-year term was referred to as a "lid." In the colloquy with the court, it was referred to as a "maximum six year state prison term." To eliminate any possible confusion, the court emphasized at that time that there was no assurance he would get anything less than that term. At sentencing, defendant moved to initiate civil commitment proceedings to CRC under Welfare and Institutions Code section 3051. The court denied the motion and imposed the six-year prison sentence.
Under Penal Code section 1237.5, a defendant who pleads guilty must obtain a certificate of probable cause before appealing that judgment unless the grounds for the appeal are those "occurring after entry of the plea which do not challenge its validity or [] involving a search or seizure . ..." (Cal. Rules of Court, rule 31(d).) Here, the amended notice of appeal indicates the appeal is purportedly brought under this exception. Relying on People v. Cole (2001) 88 Cal.App.4th 850, 106 Cal. Rptr.2d 174, defendant argues his appeal fits the exception because the court retained discretionary sentencing authority under the terms of the plea, and he is simply challenging the exercise of that authority, not the validity of the plea. The Attorney General contends a certificate of probable cause was required because defendant was not sentenced to more than the specified six years. We agree.
In Cole, the reviewing court carved out an exception to the dictates of Penal Code section 1237.5. Cole pleaded guilty to three "strikes" knowing he would receive a prison term that would not be greater than 25 years to life even though all the charges and enhancements carried a maximum sentence of 75 years to life. The court told Cole he could argue at sentencing that one or more of the prior conviction allegations should be stricken, but that he would not receive any sentence greater than 25 years to life. That was the sentence he received. The appellate court addressed his attack on the trial court's refusal to strike the priors despite his failure to obtain a certificate of probable cause. (People v. Cole, supra, 88 Cal.App.4th at pp. 853-854, 106 Cal.Rptr.2d 174.) The court characterized his appeal of this issue as "invit[ing] review of the litigation contemplated by the plea agreement." (Id. at p. 870, fn. 8, 106 Cal.Rptr.2d 174.) Thus, the court expanded the exception to the certificate of probable cause requirement to include challenges to sentences imposed as part of a plea agreement "when the question of whether to impose the negotiated maximum [term] is left [open] to the court's discretion at an adversary hearing *61 ...." (Id. at p. 871, 106 Cal.Rptr.2d 174.)
We reject the invitation to accept such legislative responsibilities; support exists for a more bright-line approach. In People v. Hester (2000) 22 Cal.4th 290, 92 Cal.Rptr.2d 641, 992 P.2d 569, the court held that the rule permitting defendants to challenge an unauthorized sentence on appeal does not apply to a defendant who pleaded guilty in return for a specified sentence. (People v. Hester (2000) 22 Cal.4th 290, 294-295, 92 Cal.Rptr.2d 641, 992 P.2d 569 [rejecting otherwise valid claim trial court should have stayed sentence under Penal Code section 654].) As stated in Hester, "defendants are estopped from complaining of sentences to which they agreed." (Id. at p. 295, 92 Cal. Rptr.2d 641, 992 P.2d 569) Once a defendant has agreed to a specified sentence, whether described as a "maximum" or not, his sole remedy for review of that term is to attempt to withdraw the plea if the sentencing court fails to impose the specified sentence. (Id. at p. 296, 92 Cal. Rptr.2d 641, 992 P.2d 569.)
Hester is not the sole guidance we have on the issue. In other circumstances, the California Supreme Court emphasized the same point in People v. Panizzon (1996) 13 Cal.4th 68, 51 Cal.Rptr.2d 851, 913 P.2d 1061. "[B]y contesting the [validity] of the very sentence he negotiated as part of the plea bargain, defendant is, in substance, attacking the validity of the plea .... [and] the certificate requirement of [Penal Code] section 1237.5 applies." (Id. at p. 78, 51 Cal.Rptr.2d 851, 913 P.2d 1061.)
This is precisely the case here. Defendant is attempting to avoid serving a six-year prison sentencethe very sentence he agreed could be imposed when he pleaded guilty. Having succeeded in reducing the court's range of sentencing options, he endeavored to better his deal by asking for a civil commitment in lieu of the prison sentence. Thus, his appeal "in substance, .... challenges the validity of the plea" which specifically requires a certificate of probable cause. (Cf. People v. Lloyd (1998) 17 Cal.4th 658, 665, 72 Cal. Rptr.2d 224, 951 P.2d 1191 [when the plea agreement specifically reserves an argument to be raised and resolved only at sentencing, defendant may appeal that issue without first obtaining certificate of probable cause].)
The appeal is dismissed.
I CONCUR: SILLS, P.J.
O'LEARY, J., Dissenting.
I respectfully dissent from my colleagues' decision to dismiss this appeal for lack of a certificate of probable cause. (Pen.Code, § 1237.5) I would consider the appeal and affirm the judgment because the trial court's refusal to initiate civil narcotics addict commitment proceedings (Welf. & Inst.Code, § 3051) was well within its discretion.
A certificate of probable cause is not required if an appeal following a guilty plea is based solely upon grounds occurring after entry of the plea which do not challenge its validity. (People v. Panizzon (1996) 13 Cal.4th 68, 75, 51 Cal.Rptr.2d 851, 913 P.2d 1061; Cal. Rules of Court, rule 31(d).) "[T]he critical inquiry is whether a challenge to the sentence is in substance a challenge to the validity of the plea, thus rendering the appeal subject to the requirements of [Penal Code] section 1237.5." (People v. Panizzon, supra, 13 Cal.4th at p. 76, 51 Cal.Rptr.2d 851, 913 P.2d 1061.)
The defendant in Panizzon pleaded no contest with the understanding he would receive the exact sentence he later attempted to appeal as constituting cruel and unusual punishment. The Supreme Court held that by contesting the constitutionality of the very sentence to which he *62 agreed, the defendant was attacking the validity of the plea, and a certificate of probable cause was required. (People v. Panizzon, supra, 13 Cal.4th at p. 78, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) But Panizzon does not resolve the issue presented here, nor does it compel the result the majority reaches.
In Panizzon, the Supreme Court noted its earlier decisions permit an appeal without a certificate of probable cause in cases where "the negotiated pleas ... related to the issue of guilt without specification of the penalty to be imposed." (Id. at p. 78, 51 Cal.Rptr.2d 851, 913 P.2d 1061, italics in original, fn. omitted.) The Supreme Court reaffirmed the principle it originally set forth in People v. Ward (1967) 66 Cal.2d 571, 575, 58 Cal.Rptr. 313, 426 P.2d 881, that it is when the guilty plea has obviated the need for a further adversary hearing to determine the penalty, that the right to appeal post-plea matters may properly be confined. (People v. Panizzon, supra, 13 Cal.4th at p. 79, fn. 9, 51 Cal.Rptr.2d 851, 913 P.2d 1061.) In Panizzon the defendant received the precise sentence to which he agreed. Here, the defendant agreed to a maximum term of six years, but the plea envisioned that at sentencing the court would consider exercising discretion to impose a lesser term. In other words, the plea agreement left the final penalty undetermined. There was a subsequent proceeding at which the trial court considered its sentencing options after vigorous argument by both sides.
People v. Cole (2001) 88 Cal.App.4th 850, 106 Cal.Rptr.2d 174, is directly on point. In Cole, the defendant pled guilty to three felony counts which could be sentenced consecutively with third strike terms to a maximum of 75 years to life. The trial court indicated he would not receive more than 25 years to life, and it would consider striking one or more of Three Strikes priors. (Id. at p. 856, 106 Cal.Rptr.2d 174.) At sentencing, the court did not strike any of the priors and imposed three concurrent 25-year-to-life terms. The defendant appealed without obtaining a certificate of probable cause. (Id. at pp. 856-857, 106 Cal.Rptr .2d 174.)
Cole permitted the appeal, holding that "when, as part of the plea agreement, the question of whether to impose the negotiated maximum sentence is left to the trial court's discretion at an adversary hearing, [Penal Code] section 1237.5 does not apply to an appellate claim that the trial court abused its discretion under Penal Code section 1385 in not striking prior convictions." (People v. Cole, supra, 88 Cal. App.4th at pp. 870-871, 106 Cal.Rptr.2d 174.) "If the agreement leaves the determination whether to impose the negotiated maximum sentence to the trial court's discretion at an adversary hearing, an appellate challenge to the trial court's ruling does not attack the validity of the plea. Instead, it simply invites review of the litigation contemplated by the plea agreement. That review, and a possible reversal of the trial court's determination, do not in any way vitiate the parties' bargain." (Id. at p. 870, fn. 8, 106 Cal.Rptr .2d 174.)
I disagree with the majority's criticism of Cole as "carv[ing] out an exception to the dictates of Penal Code section 1237.5." (Maj. opn., ante, at p. 60.) The Supreme Court and the California Rules of Court articulate the exception: A certificate of probable cause is not required if the appeal is based on post-plea matters so long as the defendant is not in substance challenging the validity of the plea. (People v. Panizzon, supra, 13 Cal.4th at p. 75, 51 Cal.Rptr.2d 851, 913 P.2d 1061; Cal. Rules of Court, rule 31(d).) Cole correctly applies that exception. When a negotiated plea involves agreement as to the maximum *63 possible sentence, but contemplates further proceedings in which the trial court will determine the actual penalty, a defendant's challenge to the manner in which the court exercised its sentencing discretion is not an attack on the validity of his plea. Therefore, a certificate of probable cause is not required.
