*1073Defendant Francisco Javier Baldivia committed a series of criminal offenses when he was 17 years old. Before Proposition 57 took effect in November 2016, defendant entered into a plea agreement in a direct-filed adult criminal proceeding that had been initiated without a juvenile court fitness hearing. Under the plea agreement, he pleaded no *1074contest to four counts and admitted various enhancement allegations, including Penal Code section 12022.531 firearm enhancement allegations. His pleas and admissions were entered in exchange for an agreed prison sentence of 17 years and 4 months and the dismissal of other counts and enhancement allegations. He filed a timely notice of appeal challenging only post-plea proceedings, and he did not obtain a certificate of probable cause.
Proposition 57, which bars direct-filed adult criminal proceedings for juveniles and requires a juvenile fitness hearing before a juvenile case may be transferred to adult criminal court, took effect during the pendency of defendant's appeal. The firearm enhancement statutes were also amended to grant trial courts discretion to strike such enhancements. Defendant contends on appeal that he is entitled to a *706remand for a juvenile fitness hearing and, if he is found unfit for juvenile court and transferred to adult criminal court, a resentencing hearing at which the trial court may exercise its newly granted discretion to strike the firearm enhancement.
We hold that defendant may raise these issues in his appeal from the judgment despite his failure to obtain a certificate of probable cause in support of his appeal from the judgment because these changes in the law were implicitly incorporated into his plea agreement. Consequently, his contentions do not challenge the validity of his plea. The Attorney General concedes as much and also concedes the merit of defendant's contentions. We agree and reverse the judgment.
I. Background
In March 2015, 17-year-old defendant and a compatriot used a gun to rob a man of his wallet and truck. Less than two hours later, they again used a gun to rob another man of his vehicle. The police were able to track the second vehicle because the victim had left his cell phone in his vehicle. When the police tried to pull over the vehicle, the vehicle increased its speed to over 100 miles per hour and proceeded at high speed through a residential neighborhood without slowing or stopping at stop lights. Defendant and his compatriot eventually abandoned the vehicle and fled on foot. Although defendant initially resisted, he was arrested, and his compatriot was also captured. Defendant was associated with the Sureno gang, and he had "three dots on his forehead, and 'VST' on his chest." His juvenile criminal history included adjudications for robbery, eluding, vehicle theft, and resisting arrest, all within the 18 months preceding his March 2015 offenses.
Although defendant was a juvenile, he was charged in adult criminal court by a direct-filed amended complaint with two counts of second degree *1075robbery (§§ 211, 212.5, subd. (c) ), two counts of carjacking (§ 215), active participation in a criminal street gang (§ 186.22, subd. (a) ), reckless eluding an officer ( Veh. Code, § 2800.2, subd. (a) ), and resisting an officer (§ 148, subd. (a)(1) ). It was further alleged that defendant had committed the robberies, the carjackings, and the eluding for the benefit of a gang (§ 186.22, subd. (b)(1)(C), (4) ). In addition, it was alleged that a principal in the robberies and carjackings had personally used a firearm ( § 12022.53, subds. (b), (e)(1) ).
In May 2016, defendant entered into a plea agreement under which he agreed to plead no contest to the two robbery counts, the eluding count, and the resisting count and to admit the firearm and gang enhancement allegations attached to the robbery counts in exchange for an agreed sentence of 17 years and four months in prison and dismissal of the remaining counts and allegations. In June 2016, the court imposed the agreed prison sentence, which included 13 years and four months for the section 12022.53 firearm enhancements. The court dismissed the other counts and allegations, and defendant timely filed a notice of appeal challenging only post-plea proceedings. He did not request a certificate of probable cause.
Proposition 57 took effect on November 9, 2016. ( People v. Superior Court (Lara ) (2018) 4 Cal.5th 299, 304, 228 Cal.Rptr.3d 394, 410 P.3d 22 ( Lara ).) On November 14, 2016, defendant's appointed appellate counsel filed a Wende2 brief, which stated the case and the facts but raised no issues. In December, defendant's appellate counsel filed a motion to strike the opening brief and to file a new opening brief. In *707response, this court issued the following order: "On the court's own motion, the appeal is stayed. The matter is returned to the trial court to hold any and all proceedings necessary to address the Proposition 57 issues raised by appellant's case, including, but not limited to a request for certificate of probable cause. Within 15 days of the completion of the proceedings in the trial court, appellant shall file a notice in this court summarizing the outcome of the proceedings below and requesting the reinstatement of the appeal to active status. Appellant's motion to file an amended opening brief is denied without prejudice to renewal upon return of the matter to active status in this court."
Defendant then filed a motion in the superior court asking the superior court to "remand" the case to the juvenile court for a "juvenile transfer hearing" in light of Proposition 57. The prosecution opposed the request on the ground that Proposition 57 was "not retroactive." In June 2017, the superior court denied defendant's motion. In July 2017, defendant filed a notice of appeal from the court's denial of his motion. In his notice of appeal, he claimed that he was challenging the "validity of the plea or admission"
*1076and requested a certificate of probable cause. The only grounds identified in his request for a certificate related to the denial of his motion for remand. The court granted the certificate.
In July 2017, defendant's appellate counsel notified this court of the completion of the proceedings in the trial court. This court lifted the stay and restored the case to active status. Defendant's appellate counsel did not renew his request to strike the Wende brief and file a new opening brief. This court ordered that defendant's two appeals be considered together. Defendant's appellate counsel filed an opening brief in the second appeal in March 2018 in which he contended that Proposition 57 applied to his case and that he was entitled to a remand to the juvenile court for a transfer hearing. The Attorney General filed a concession brief in which he not only conceded that defendant was entitled to a transfer hearing, but also asserted that defendant was entitled to a remand for the sentencing court to exercise its newly granted discretion to strike the firearm enhancement. Defendant's reply brief adopted the Attorney General's assertions regarding the firearm enhancement.
We requested supplemental briefing from the parties addressing, among other things, whether the Proposition 57 and firearm enhancement contentions could be raised in defendant's appeal from the judgment in the absence of a certificate of probable cause in light of defendant's agreed-term plea agreement. The Attorney General and defendant agreed that those contentions could be raised in that appeal despite the absence of a certificate.3
II. Discussion
Although there was no authority on the certificate issue when we requested briefing from the parties on that issue, the Second District Court of Appeal published its decision in People v. Hurlic (2018) 25 Cal.App.5th 50, 235 Cal.Rptr.3d 255 ( Hurlic ) shortly after the Attorney General filed his supplemental response brief. Defendant's supplemental reply brief adopted the Second District's analysis, which is similar to the Attorney General's analysis.
Hurlic had entered into a plea agreement for an agreed term that included 20 *708years for a firearm enhancement. ( Hurlic , supra , 25 Cal.App.5th at pp. 53-54, 235 Cal.Rptr.3d 255.) He was sentenced in September 2017, and his notice of appeal was filed in October 2017. He did not obtain a certificate of probable cause. Senate Bill No. 620 (2017-2018 Reg. Sess.) (Senate Bill No. 620), which *1077amended section 12022.53 to grant trial courts discretion to strike firearm enhancements, took effect in January 2018, while Hurlic's appeal was pending. ( Hurlic , at p. 54, 235 Cal.Rptr.3d 255.) Section 12022.53 now provides: "The court may, in the interest of justice pursuant to Section 1385 and at the time of sentencing, strike or dismiss an enhancement otherwise required to be imposed by this section. The authority provided by this subdivision applies to any resentencing that may occur pursuant to any other law." (Stats. 2017, ch. 682, § 2; § 12022.53, subd. (h).) On appeal, Hurlic argued that he was entitled to a remand for the trial court to exercise its newly granted discretion under Senate Bill No. 620. The Attorney General argued that Hurlic could not raise this issue on appeal because he had entered into an agreed-term plea agreement and had not obtained a certificate of probable cause. ( Hurlic , at p. 54, 235 Cal.Rptr.3d 255.)
The Second District recognized that it was required to "[r]econcil[e]" "two lines of authority." ( Hurlic , supra , 25 Cal.App.5th at p. 55, 235 Cal.Rptr.3d 255.) One line of authority, which concerned when certificates are required, suggested that because Hurlic had entered into an agreed-term plea agreement, his appellate contention, which could lead to a reduction in his sentence, went to the validity of the plea and he could not obtain relief absent a certificate. ( Hurlic , at pp. 55-56, 235 Cal.Rptr.3d 255.) The other line of authority, which concerned the retroactive effect of new, potentially ameliorative statutes, suggested that because Hurlic's case was not yet final he could obtain relief. ( Hurlic , at p. 56, 235 Cal.Rptr.3d 255.)
The Second District concluded that there were three reasons why the latter line of authority should prevail over the former under these circumstances. ( Hurlic , supra , 25 Cal.App.5th at p. 57, 235 Cal.Rptr.3d 255.) First, plea agreements are " 'deemed to incorporate' " changes in the law. ( Hurlic , at p. 57, 235 Cal.Rptr.3d 255.) Second, the certificate requirement's purpose (to weed out frivolous appeals) would not be served under these circumstances. Hurlic's appeal was indisputably meritorious, and no defendant could possibly obtain a certificate to make a challenge based on a law that did not exist at the time of sentencing. ( Hurlic , at pp. 57-58, 235 Cal.Rptr.3d 255.) Third, Senate Bill No. 620 was enacted after section 1237.5 (the certificate requirement) and therefore should be given priority over the earlier enacted statute. ( Hurlic , at p. 58, 235 Cal.Rptr.3d 255.)
We find the Second District's first reason dispositive. "[T]he general rule in California is that the plea agreement will be ' "deemed to incorporate and contemplate not only the existing law but the reserve power of the state to amend the law or enact additional laws for the public good and in pursuance of public policy. ..." ' [Citation.] That the parties enter into a plea agreement thus does not have the effect of insulating them from changes in the law that the Legislature has intended to apply to them." ( Doe v. Harris (2013) 57 Cal.4th 64, 66, 158 Cal.Rptr.3d 290, 302 P.3d 598 ( Doe ).) Doe had *1078entered into a plea agreement requiring him to register as a sex offender. At the time of the plea agreement, the law prohibited public access to certain information about registered sex offenders. The law was subsequently changed to mandate public access *709to this information. The change was expressly retroactive. ( Doe , at pp. 66-67, 158 Cal.Rptr.3d 290, 302 P.3d 598.) The issue was whether Doe's plea agreement implicitly incorporated the prohibition on public access to his information. ( Doe , at p. 67, 158 Cal.Rptr.3d 290, 302 P.3d 598.) The California Supreme Court held that it did not. "[T]he parties to a plea agreement-an agreement unquestionably infused with a substantial public interest and subject to the plenary control of the state-are deemed to know and understand that the state, again subject to the limitations imposed by the federal and state Constitutions, may enact laws that will affect the consequences attending the conviction entered upon the plea." ( Doe , at p. 70, 158 Cal.Rptr.3d 290, 302 P.3d 598.) Thus, Doe's plea agreement incorporated the possibility that changes in the law would alter the consequences of his plea.
In Harris v. Superior Court (2016) 1 Cal.5th 984, 209 Cal.Rptr.3d 584, 383 P.3d 648 ( Harris ), the California Supreme Court applied Doe to a plea agreement that had been entered into prior to the enactment of Proposition 47. Proposition 47 contained provisions that permitted courts to resentence prior felony convictions as misdemeanors. The issue was how Proposition 47 would affect a prior plea agreement. ( Harris , at p. 991, 209 Cal.Rptr.3d 584, 383 P.3d 648.) Harris had entered into an agreed-term plea agreement under which he had pleaded guilty to grand theft and admitted an enhancement allegation in exchange for dismissal of a robbery charge and other enhancement allegations. ( Harris , at p. 987, 209 Cal.Rptr.3d 584, 383 P.3d 648.) After Proposition 47 was enacted, he sought to have his grand theft conviction resentenced as a misdemeanor. ( Harris , at p. 987, 209 Cal.Rptr.3d 584, 383 P.3d 648.) The issue before the California Supreme Court was whether application of Proposition 47 to Harris would permit the prosecution to withdraw from the plea agreement and reinstate the original charges. ( Harris , at p. 989, 209 Cal.Rptr.3d 584, 383 P.3d 648.) The court viewed the question as "whether the electorate intended the change to apply to the parties to this plea agreement." ( Harris , at p. 991, 209 Cal.Rptr.3d 584, 383 P.3d 648.) Because Proposition 47 explicitly applied to convictions obtained by plea, the court found that the electorate had intended for the change to apply to plea agreements. ( Harris , at p. 991, 209 Cal.Rptr.3d 584, 383 P.3d 648.)
Under Doe and Harris , a plea agreement is deemed to incorporate subsequent changes in the law so long as those changes were intended by the Legislature or the electorate to apply to such a plea agreement. In Doe and Harris , the changes in the law were expressly intended to apply retroactively. The parties here contend that, under the California Supreme Court's decision in Lara , an "inference of retroactivity" requires that both Senate Bill No. 620 and Proposition 57 be applied to all judgments that were not final when those laws took effect. ( Lara , supra , 4 Cal.5th at p. 303, 228 Cal.Rptr.3d 394, 410 P.3d 22.)
In Lara , the California Supreme Court held that the long-recognized "inference of retroactivity" meant that Proposition 57's transfer hearing *1079provisions applied "to all juveniles charged directly in adult court whose judgment was not final at the time it was enacted." ( Lara , supra , 4 Cal.5th at pp. 303-304, 228 Cal.Rptr.3d 394, 410 P.3d 22.) This "inference of retroactivity" is "the ordinary presumption long established under the Estrada[4 ] rule," which applies whenever there is no evidence of a *710legislative intent that the change be only prospective. ( People v. Buycks (2018) 5 Cal.5th 857, 882-883, 236 Cal.Rptr.3d 84, 422 P.3d 531.) Hence, the California Supreme Court concluded in Lara that Proposition 57 implicitly incorporated this inference of retroactivity because it did not state otherwise. Senate Bill No. 620 also did not state otherwise, and in fact expressly contemplated that it would have retroactive effect since it provided that this newly granted discretion would apply at any "resentencing" proceeding.
While the analysis in Lara , unlike that in Harris , did not depend on express indications of the electorate's intent, but rather was premised on the implication that the electorate had incorporated the "inference of retroactivity" by not expressly indicating otherwise, the result in both cases was that the change in the law was deemed to be retroactive. We can see no reason why this distinction should alter the impact on plea agreements. If the electorate or the Legislature expressly or implicitly contemplated that a change in the law related to the consequences of criminal offenses would apply retroactively to all nonfinal cases, those changes logically must apply to preexisting plea agreements, since most criminal cases are resolved by plea agreements. It follows that defendant's appellate contentions were not an attack on the validity of his plea and did not require a certificate of probable cause.
Because it is undisputed that his Proposition 57 and Senate Bill No. 620 contentions are meritorious, we will remand this matter for a transfer hearing and, if necessary, a resentencing hearing.
III. Disposition
The judgment is reversed. On remand, the juvenile court shall hold a transfer hearing. If the juvenile court finds defendant fit for juvenile court treatment, it shall impose an appropriate juvenile disposition. If the juvenile court finds defendant unfit, this matter shall be transferred to adult criminal court, and the court shall hold a resentencing hearing at which it may exercise its discretion to strike the firearm enhancements. If the court strikes one or both of those enhancements, it shall resentence defendant. If it declines to *1080strike either of the firearm enhancements, it shall reinstate the judgment. Defendant's appeal from the superior court's order denying his remand motion is dismissed as moot.
WE CONCUR:
Elia, Acting P. J.
Bamattre-Manoukian, J.
Subsequent statutory references are to the Penal Code unless otherwise specified.
People v. Wende (1979) 25 Cal.3d 436, 158 Cal.Rptr. 839, 600 P.2d 1071.
They disagreed about the validity of this court's order in the first appeal that created the circumstances that led to the second appeal. Since our resolution of defendant's first appeal disposes of all of his contentions, we need not address the second appeal, which we dismiss as moot.
In re Estrada (1965) 63 Cal.2d 740, 48 Cal.Rptr. 172, 408 P.2d 948.