Opinion
SUZUKAWA, J.INTRODUCTION
Tyrone Sanders appeals from a judgment committing him to a two-year term as a sexually violent predator. (Welf. & Inst. Code, § 6600 et seq.)1 The judgment was entered based upon a stipulated agreement. Appellant contends that the judgment must be reversed because his constitutional right to due process was violated by the excessive delay involved in resolving the matter, and also because the agreement was invalid. We conclude that because he admitted to the allegations contained in the petition seeking his commitment, he is foreclosed from seeking appellate review of any due process violation based on delay. Further, we reject appellant’s contention that the agreement was invalid. Accordingly, we affirm the judgment.
FACTUAL AND PROCEDURAL BACKGROUND
On July 8, 2005, the Los Angeles County District Attorney filed a petition seeking commitment of appellant as a sexually violent predator (SVP). Later that month, appellant personally waived his right to a probable cause hearing and stipulated that there was probable cause to proceed on the petition based *843on the doctors’ reports. The court ordered defendant transported to Atascadero State Hospital forthwith.
On September 20, 2006, the Governor signed into law Senate Bill No. 1128 (2005-2006 Reg. Sess.), a piece of urgency legislation that, among other things, amended section 6604 to lengthen the term of an SVP commitment from two years to an indeterminate period. (See People v. Castillo (2010) 49 Cal.4th 145, 150 [109 Cal.Rptr.3d 346, 230 P.3d 1132] (Castillo).) During the November 2006 general election, the voters of California adopted Proposition 83 (known as Jessica’s Law), which enacted the same changes. (49 Cal.4th at pp. 150, 152.)
On October 31, 2006, the parties in this matter filed a stipulation with the court in which they agreed that appellant would receive a two-year commitment following his trial on the 2005 petition, notwithstanding the change in the law occasioned by legislative amendment of the Sexually Violent Predators Act (SVPA) providing for imposition of an indeterminate term of commitment. This stipulation was originally entered into on October 11, 2006, by the Los Angeles County District Attorney’s Office, the Los Angeles County Public Defender, and the Los Angeles County Superior Court, and indicated it was to be filed in every SVP case in which a petition was pending prior to the effective date of the legislation. As relevant here, the stipulation stated as follows: “On September 20, 2006 Senate Bill 1128, urgency legislation, was signed into law by the Governor. Additionally a ballot initiative commonly known as ‘Jessica’s Law’ is on the ballot in November of 2006. The legislation and the initiative include language which would lengthen the term of commitment for a SVP from two years to an indeterminate term. Due to uncertainty in the retroactive application of this change, it is the intention of the Los Angeles County District Attorney’s Office to apply the current[2] two year commitment period to all currently pending initial commitment petitions, as limited below, for cases in which the trial and commitment occur after the effective date of the legislation or the initiative[,] whichever occurs first, hereafter ‘effective date.’ For all cases in which an initial commitment petition is filed after the effective date of the legislation, the District Attorney’s office will seek the indeterminate term.”
*844The matter then remained pending for a substantial period of time, during which defense counsel requested continuances to file pretrial motions and to prepare for trial. In addition, appellant filed two Marsden3 motions, the second of which was granted in November 2008. In May 2009, appellant also filed a motion to dismiss the petition, contending the SVPA violated his constitutional rights to due process and equal protection, and was an illegal ex post facto law. On numerous occasions, appellant unsuccessfully objected to the delay in bringing the matter to trial, and argued the petition should be dismissed.
The Settlement Agreement
Eventually, on May 11, 2010, the parties informed the court they had reached a stipulation under which appellant admitted the allegations of the petition, and agreed to receive a two-year commitment. The stipulation provided as follows: “In the event the respondent’s admission to the two-year commitment term is deemed unenforceable for any reason, the respondent shall be permitted to withdraw his admission to the petition and will be entitled to a trial on the most recently filed petition providing the respondent has not already been found to qualify as a sexually violent predator on that petition. If the jury determines that the respondent is a sexually violent predator, the commitment will be an indeterminate term. [¶] At the conclusion of the two-year commitment in case ZM008930 if appropriate, a sexually violent predator petition will be filed seeking an indeterminate commitment.”
Appellant and his attorney stipulated to a factual basis for appellant’s admission of the allegations of the petition based upon all the police reports, probation reports, psychologists’ reports, and the records of appellant’s prior convictions. Appellant admitted having suffered forcible oral copulation and rape convictions in 1979, 1987, and 1990, within the meaning of section 6600. He admitted that he had a currently diagnosed mental disorder that predisposed him to commit sexually violent, predatory crimes, that as a result of the diagnosed mental disorder it was likely that, if released, he would engage in sexually violent, predatory criminal behavior, and that he agreed to be committed as a sexually violent predator.
At the hearing on May 11, 2010, at which appellant was present, defense counsel acknowledged that although it was a civil matter, some criminal procedures applied and he therefore asked the court to issue “something like a certificate of probable cause with regard only to the issue of speedy trial.” The court replied, “Correct. I would agree to the defendant not waiving his [constitutional] right.” However, the court added: “Even though it may not be a valid issue.”
*845Defense counsel explained that appellant had become aware of an unpublished opinion recently filed by the Court of Appeal in which an individual was found to be a sexually violent predator by a jury, and the trial court ordered appellant to be committed for two years, but the Court of Appeal modified the commitment to an indefinite term based on its conclusion that the change in the SVPA rendered a two-year commitment unauthorized by law. Appellant felt it was in his best interest to agree to the two-year commitment to avoid any possibility of going to trial and receiving a two-year commitment, only to have it be converted to an indeterminate term. Counsel continued: “[Appellant] did express his desire that he be allowed to challenge the speedy trial issue that he has personally raised all the way through. The District Attorney is not involved in any sort of agreement regarding his challenge of the speedy trial issue. It has been explained to him that the appellate court may deny his efforts simply by stating there [are] no grounds for appeal period or they may just rule against him on the merits. There [are] a lot of possibilities of things not working out in his favor. He understands it and that has been explained to him and the court has agreed to sign, I will draw up the papers, a document similar to a certificate of probable cause so we can raise the issue after admitting—agreeing to this condition of the two-year commitment.”
The court clarified: “What I am agreeing to do is sign something that indicates that he has not waived his right to file an appeal based on the speedy trial issue.” “I am certainly not stating he is going to prevail or that he has a speedy trial right, because I think that’s an issue in controversy.” Defense counsel responded, “In signing any document it would not indicate any belief on the court’s part that it supports the contention of [appellant]. It only says because it’s a unique issue, that he should have that right—if appropriate, he has a right to raise the issue.”
The prosecutor stated: “I am not involved in any kind of an agreement with respect to what he can or cannot appeal. He clearly has whatever constitutional rights that he has. That may change based on any changes in the law in the future that would obviously apply to [appellant] as well as anyone else. From our perspective, as I explained to [appellant] earlier, we are agreeing at this time to no more than the two-year commitment. Obviously, after that time expires we may choose, if we are allowed to under the law, to file another petition. We are agreeing at any point in time if, based on this admission, a court chooses to impose anything more than a two-year commitment, we agree that he may withdraw his admission and have a trial.” She *846added: “I want to make sure it was clear what I stated earlier. I’m not agreeing to any additional—anything outside of the admission that we have taken here in court.”
The court found that appellant had knowingly, willingly, and voluntarily waived his constitutional rights, and that he understood the nature of the petition and the consequences of his admission. The court entered a judgment of commitment.
This timely appeal followed.
DISCUSSION
I. The SVPA, Due Process Requirements, and the Effect of an Admission of the Petition’s Allegations
The SVPA “allows for the involuntary commitment of certain convicted sex offenders, whose diagnosed mental disorders make them likely to reoffend if released at the end of their prison terms.” (Cooley v. Superior Court (2002) 29 Cal.4th 228, 235 [127 Cal.Rptr.2d 177, 57 P.3d 654].) An SVP is “a person who has been convicted of a sexually violent offense against one or more victims and who has a diagnosed mental disorder that makes the person a danger to the health and safety of others in that it is likely that he or she will engage in sexually violent criminal behavior.” (§ 6600, subd. (a)(1).) A person who is declared an SVP is committed to the State Department of Mental Health for treatment. (§ 6604.) Under the prior version of the SVPA, the commitment was for two years subject to recommitment for additional two-year periods only if the People proved to a jury beyond a reasonable doubt that the individual still met the definition of an SVP. The current version changed the commitment to an indefinite one, from which an individual can be released only if he proves by a preponderance of the evidence that he no longer is an SVP. (People v. McKee (2010) 47 Cal.4th 1172, 1183-1184 [104 Cal.Rptr.3d 427, 223 P.3d 566].)
The SVPA does not specify a time by which a trial on a commitment proceeding under the SVPA must be commenced or concluded. (See §§ 6604, 6604.1; Litmon v. Superior Court (2004) 123 Cal.App.4th 1156, 1171 & fn. 5 [21 Cal.Rptr.3d 21]; People v. Superior Court (Ramirez) (1999) 70 Cal.App.4th 1384, 1389-1391 [83 Cal.Rptr.2d 402].) Though the constitutional right to a speedy trial applies only in criminal prosecutions, the federal due process clause extends to involuntary civil commitments under the SVPA and requires a hearing “ ‘ “at a meaningful time and in a meaningful manner.” ’ ” (People v. Litmon (2008) 162 Cal.App.4th 383, 395 [76 Cal.Rptr.3d 122]; see Addington v. Texas (1979) 441 U.S. 418, 425 *847[60 L.Ed.2d 323, 99 S.Ct. 1804] [“[C]ivil commitment for any purpose constitutes a significant deprivation of liberty that requires due process protection.”].) Thus, although involuntary civil commitment proceedings under the SVPA are distinct from criminal proceedings, we look to the standards and precedents established in the analogous criminal context for guidance.
In criminal proceedings, the essence of a speedy trial issue or a due process claim based on delay is that the passage of time has frustrated the defendant’s ability to defend the allegations against him. “[T]he weighing process required to establish a constitutional speedy trial violation necessitates consideration of prejudice to the accused in the particular context of the case. By pleading guilty, a defendant concedes the absence of prejudice, having admitted ‘ “all matters essential to the conviction.” ’ (People v. Turner [(1985)] 171 Cal.App.3d [116,] 126 [214 Cal.Rptr. 572], quoting People v. DeVaughn [(1977)] 18 Cal.3d [889,] 895 [135 Cal.Rptr. 786, 558 P.2d 872].) Viewed in this way, a guilty plea in both felony and misdemeanor prosecutions forecloses any further inquiry into whether there has been a deprivation of a defendant’s speedy trial right. [Fn. omitted.]” (People v. Egbert (1997) 59 Cal.App.4th 503, 511 [68 Cal.Rptr.2d 913].) “In essence, a defendant who pleads guilty after the court denies a motion to dismiss for a speedy trial violation waives the right to a speedy trial.” (Id. at fn. 3.) Thus, a guilty plea forecloses a defendant from asserting on appeal a claimed violation of the constitutional right to a speedy trial. (Id. at p. 512; see also People v. Hernandez (1992) 6 Cal.App.4th 1355, 1357-1358 [8 Cal.Rptr.2d 324].) Likewise, with regard to involuntary civil commitment proceedings under the SVPA, we conclude that an admission to the allegations set forth in the petition forecloses appellate review of any purported due process violation based on delay in bringing the matter to trial. (See People v. Medina (2009) 171 Cal.App.4th 805, 817-818 [89 Cal.Rptr.3d 830] [where appellant consented to entry of SVPA recommitment order, court observed that a consent judgment entered by court under authority of and in accordance with contractual agreement of parties is ordinarily not appealable].)
We note that the trial court in this matter agreed to issue a document in the nature of a certificate of probable cause (although the court recognized that statutory procedure is not technically applicable in SVPA proceedings). As the court made clear, however, by issuing such a document the court did not represent that appellant would “prevail or that he has a speedy trial right, because I think that’s an issue in controversy.” The court readily acknowledged that “it may not be a valid issue.” The court was correct in voicing skepticism regarding the efficacy of the document it agreed to sign. Here, just as in the criminal context, the parties and the trial court cannot, by agreeing to issuance of a certificate of probable cause (or its purported equivalent), expand the jurisdiction of the appellate court and make cognizable on appeal *848an issue that has been waived by a guilty plea or a no contest plea. (People v. Kaanehe (1977) 19 Cal.3d 1, 9 [136 Cal.Rptr. 409, 559 P.2d 1028]; People v. DeVaughn, supra, 18 Cal.3d at pp. 895-896.)
II. Appellant’s Admission Was Not Conditioned on the Availability of an Appeal on Due Process Grounds
Appellant contends that the judgment must be reversed because the stipulation by which he agreed he would receive a two-year commitment is invalid, because the agreement was premised on preservation of his right to challenge on appeal the delay in the proceedings. Appellant asserts that he clearly intended to make the agreement only if he could raise a due process challenge on appeal to the delays in his trial proceedings.
“Issues cognizable on an appeal following a guilty plea are limited to issues based on ‘reasonable constitutional, jurisdictional, or other grounds going to the legality of the proceedings’ resulting in the plea. [Citations.]” (People v. DeVaughn, supra, 18 Cal.3d at pp. 895-896.) A claim that the plea itself was improperly induced would challenge the legality of the proceedings resulting in the plea, and would thus be cognizable on an appeal. (Id. at p. 896 [applying Pen. Code, § 1237.5]; People v. Draughon (1980) 105 Cal.App.3d 471 [164 Cal.Rptr. 440] [guilty plea vacated because premised on assurance of preservation on appeal of speedy trial issue].) Thus, we consider the merits of appellant’s argument that he was improperly induced to agree to the stipulated judgment based on the promise that his right to appeal regarding his claim of excessive delay would be preserved. However, we find no such promise was made.
As recited above, appellant was informed by his own counsel and by the trial court that there was no guarantee that his due process claim regarding delay in the proceedings would be cognizable on appeal. Defense counsel said: “[Appellant] did express his desire that he be allowed to challenge the speedy trial issue that he has personally raised all the way through. The District Attorney is not involved in any sort of agreement regarding his challenge of the speedy trial issue. It has been explained to him that the appellate court may deny his efforts simply by stating there [are] no grounds for appeal period or they may just rule against him on the merits. There [are] a lot of possibilities of things not working out in his favor. He understands it and that has been explained to him . . . .” (Italics added.) The prosecutor specifically stated the stipulation to which she agreed was not premised on the availability of an appeal on the delay issue. The People took no position on that issue.
*849As such, the record definitively belies appellant’s contention that a condition of his agreeing to a two-year commitment was the availability of an appeal, on the merits, of his due process claim of excessive delay. Appellant was not improperly induced to agree to the stipulated judgment based on a false or erroneous promise.
Finally, appellant contends that the agreement is invalid on a contractual basis because he gained nothing by making this deal. According to appellant, “the agreement was made in fearful contemplation of the upcoming ruling by the California Supreme Court in Castillo which ultimately resulted in People v. Castillo[, supra,] 49 Cal.4th 145. Had appellant known that the Supreme Court was going to reverse the Court of Appeal and find that the stipulation between the District Attorney’s Office and the SVP defendants calling for a two-year commitment was valid, appellant would never have made the agreement. In essence, appellant felt coerced into making this agreement because of the erroneous rulings on this issue by Division Five of this Court. Appellant believes that a court forcing him to make a decision that is not in his best interest by the implicit threat of illegally imposing an indeterminate commitment is sufficient coercion and circumstance to cause the agreement itself to be invalid.” Appellant contends that the stipulation resulted in no benefit to him and thus, in contractual terms, it was invalid for want of consideration. We disagree.
In the first place, appellant’s assumption that a guilty plea is invalid unless made for a consideration which would support a contract is simply erroneous. (People v. Marsh (1984) 36 Cal.3d 134, 140 [202 Cal.Rptr. 92, 679 P.2d 1033].) More importantly, appellant is incorrect in asserting that he received no benefit by entering into this agreement. In fact, regardless of the outcome of Castillo, appellant secured a benefit by agreeing to a two-year commitment.
Less than two weeks after appellant entered into the stipulation at issue here, the Supreme Court held in Castillo, based on principles of judicial estoppel, that the stipulation at issue there (by which the People agreed to seek two-year commitments) could not be disregarded by a Court of Appeal in favor of imposing an indeterminate term. However, the Supreme Court announced that “we know today, with the benefit of such subsequent clarification [afforded by appellate decisions clarifying the effect of the amendments to the SVPA], that a stipulation similar to the one we consider in the present case now could not properly be negotiated, entered into, and enforced . . . .” (Castillo, supra, 49 Cal.4th at p. 173.) Thus, by entering into the stipulation when he did, just before Castillo’s definitive pronouncement that such stipulations were no longer valid, appellant secured for himself a two-year commitment. Had he not entered the plea agreement before Castillo was decided and instead gone to trial, he arguably would have been subject to an indefinite term of commitment.
*850Even if Castillo had been decided differently and the Supreme Court had upheld the Court of Appeal’s decision, appellant still would have been entitled to a two-year commitment on the current petition because he received the two-year commitment by means of a plea agreement, unlike the defendant in Castillo, who went to trial. While the Supreme Court in Castillo decided the matter entirely on the basis of judicial estoppel, the Court of Appeal had concluded that the law required imposition of an indeterminate term of commitment, and that neither the principles of judicial estoppel nor those of equitable estoppel or promissory estoppel prevented that from being the outcome. The Supreme Court noted that the Court of Appeal held that Castillo could not “satisfy the ‘detrimental reliance’ requirement for application of equitable estoppel [fn. omitted] or the ‘induced action or forbearance’ requirement of promissory estoppel. [Fn. omitted.]” (Castillo, supra, 49 Cal.4th at p. 155.) The court continued: “But regardless of whether, on the facts of this case, detrimental reliance or induced forbearance can be established for purposes of equitable estoppel or promissory estoppel, that question simply has no relevance to application of judicial estoppel. The doctrine of judicial estoppel is designed to protect the integrity of the legal system as a whole, and does not require a showing of detrimental reliance by a party. [Citations.]” (Id. at pp. 155-156.)
Unlike appellant, the defendant in Castillo did not admit he was an SVP in reliance on the promise of a two-year term; he went to trial, with the chance that he would not be found to be an SVP, and he therefore gave up nothing by entering the stipulation. In contrast, appellant, in order to secure a two-year term rather than an indefinite one, gave up his right to a trial and the chance to have no commitment at all if found by a jury not to be an SVP. The prosecution received the benefit of the bargain: it did not have to prove to a jury that appellant was an SVP. Once the disposition was accepted, the prosecution could not thereafter refuse to enforce the bargain. (See People v. Cantu (2010) 183 Cal.App.4th 604, 607 [107 Cal.Rptr.3d 429] [“The critical point of no return for enforcement of a plea bargain is the entry of plea or detrimental reliance.”].) “ ‘When, as here, the court has jurisdiction of the subject, a party who seeks or consents to action beyond the court’s power as defined by statute or decisional rule may be estopped to complain of the ensuing action in excess of jurisdiction.’ ” (People v. Jones (1989) 210 Cal.App.3d 124, 136 [258 Cal.Rptr. 294], quoting In re Griffin (1967) 67 Cal.2d 343, 347 [62 Cal.Rptr. 1, 431 P.2d 625].) Thus, even if Castillo had been decided differently, the People likely would have been barred by the principles of equitable estoppel from attempting to set aside appellant’s disposition. Clearly, the agreement is not invalid for want of consideration.
*851DISPOSITION
The judgment committing appellant to a two-year term is affirmed. Epstein, P. J., and Manella, J., concurred.
Appellant’s petition for review by the Supreme Court was denied May 23, 2012, S201265.
All further undesignated statutory references are to the Welfare and Institutions Code.
“Although the stipulation characterized a two-year commitment term as the ‘current’ law, in fact the current law as of October 11, 2006, was reflected in Senate Bill No. 1128, which had removed the two-year commitment term and replaced it with an indeterminate term. The characterization in the stipulation apparently reflects the circumstance that the document was substantially negotiated and drafted prior to September 20, 2006, the effective date of Senate Bill No. 1128 (Stats. 2006, ch. 337, § 55).” (Castillo, supra, 49 Cal.4th at p. 150, fn. 5.)
People v. Marsden (1970) 2 Cal.3d 118 [84 Cal.Rptr. 156, 465 P.2d 44],