delivered the opinion of the court:
The issue in these two consolidated appeals is whether a defendant who pleads guilty in exchange for a cap on the length of his sentence may challenge a sentence that is imposed within the range of the cap without first moving to withdraw his guilty plea. We hold that he may not.
In People v. Linder, James Linder was charged with three counts of armed robbery, one count of aggravated vehicular hijacking, and one count of armed violence. Linder pleaded guilty to one count of armed robbery and one count of aggravated vehicular hijacking after the State agreed to dismiss the other charges and indicated that it would not seek a sentence in excess of 15 years’ imprisonment. The circuit court of Lake County accepted the plea agreement and sentenced Linder to 11 years on each of the two counts, with the sentences to run concurrently.
Although the sentence was within the agreed upon range, Linder filed a motion under Supreme Court Rule 604(d) (145 Ill. 2d R. 604(d)) asking that the sentence be reconsidered. That motion was denied. Linder subsequently appealed, arguing that he was entitled to a new sentencing hearing because his attorney failed to file the certificate required by Rule 604(d) prior to the hearing on his motion to reconsider.
Under Rule 604(d), defense counsel must certify that he or she has reviewed the proceedings, consulted with the defendant, and made any amendments to the motion necessary for adequate presentation of any defects in the plea or sentencing proceedings. Requiring such a certificate enables the trial court to insure that counsel has reviewed the defendant’s claim and considered all relevant bases for the motion to withdraw the guilty plea or to reconsider the sentence. The rule must be strictly adhered to. People v. Shirley, 181 Ill. 2d 359, 371 (1998). Where counsel has not satisfied the rule’s certification requirement, a trial court’s denial of a defendant’s motion to reconsider must be reversed and the cause must be remanded to the trial court to permit the filing of a new motion to reconsider and a new hearing on that motion. People v. Janes, 158 Ill. 2d 27, 35-36 (1994).
Although the requisite certificate was not filed by Linder’s trial counsel, the State argued that the absence of the certificate was irrelevant. According to the State, Linder would not be entitled to relief on appeal even if such a certificate had been filed because he never moved to withdraw his guilty plea and to vacate the judgment as required by this court’s decision in People v. Evans, 174 Ill. 2d 320 (1996).
The appellate court rejected the State’s argument. It held Evans inapplicable because here, unlike Evans, the trial court retained some discretion in fixing the ultimate sentence. The plea agreement merely set a cap. The precise duration of the sentence was left to the judge. Under these circumstances, the appellate court believed that Linder was required only to move to reconsider his sentence, as he had done, in order to secure appellate review. He was not obliged to also file a motion to withdraw his plea of guilty and vacate the judgment. Because Linder had moved for reconsideration of his sentence and because his attorney had not filed a Rule 604(d) certificate prior to the hearing on the motion to reconsider, the appellate court reversed the circuit court’s judgment denying Linder’s motion for reconsideration of his sentence and remanded the cause for the filing of a new motion in compliance with Rule 604(d). No. 2 — 96— 0898 (unpublished order under Supreme Court Rule 23).
In People v. Rice, Leroy Rice was charged with 11 counts of burglary. Rice agreed to plead guilty to four of the counts in exchange for the State’s dismissing the other counts and recommending a maximum sentence of six years’ imprisonment. The circuit court of Lake County accepted the plea and sentenced Rice to five years on each of the four counts, with the sentences to run concurrently. Rice then filed a motion to reconsider his sentence, which the trial court denied.
The appellate court subsequently affirmed, rejecting an argument by Rice that the certificate filed by his trial attorney in support of the motion to reconsider did not comport with the requirements of Rule 604(d). People v. Rice, 283 Ill. App. 3d 626 (1996). Rice then filed a petition for leave to appeal to this court. Although we denied that petition, we recognized that Rice’s attorney had only moved to reconsider the sentence. As with the attorney in Linder, he had not filed a motion to withdraw his client’s plea of guilty and to vacate the judgment. Accordingly, we issued a supervisory order remanding the cause to the appellate court for further consideration in light of Evans.
In its second Rice opinion, the appellate court reached a different conclusion than the panel had in Linder. It held that Evans does apply when the plea agreement calls for the State to recommend a sentencing cap and the defendant receives a sentence within the range recommended by the State. In order to challenge the sentence and obtain appellate review, the court concluded, the defendant cannot simply move for reconsideration of the sentence. He must file a motion to withdraw his guilty plea and vacate the judgment. 291 Ill. App. 3d 9, 12.
Although the appellate court construed Evans as applying to negotiated pleas involving sentencing caps, it held that application of the Evans rule to bar Rice’s claims would be unfair where, as here, the proceedings to challenge the sentence were initiated well before Evans was announced. Accordingly, the court reversed the trial court’s judgment and remanded the cause to allow Rice to initiate new proceedings in accordance with Evans if he so desired. 291 Ill. App. 3d at 12.
The State petitioned for leave to appeal from the appellate court’s decisions in both Linder and Rice. We allowed the State’s petitions (166 Ill. 2d R. 315; 134 Ill. 2d R. 612(b)) and consolidated the two cases for argument and decision.
Resolution of both appeals turns on the first sentence of Rule 604(d). It provides:
“No appeal from a judgment entered upon a plea of guilty shall be taken unless the defendant, within 30 days of the date on which sentence is imposed, files in the trial court a motion to reconsider the sentence, if only the sentence is being challenged, or, if the plea is being challenged, a motion to withdraw his plea of guilty and vacate the judgment.” 145 Ill. 2d R. 604(d).
Linder and Rice contend that because they are challenging only the sentences they received, the rule requires only that they move to reconsider the sentences. They assert that moving to withdraw their guilty pleas and to vacate the circuit court’s judgments is not a prerequisite to preserving their right to appeal. We disagree.
In People v. Evans, 174 Ill. 2d 320 (1996) our court held that the motion-to-reconsider-sentence clause of Rule 604(d) applies only to open, as opposed to negotiated, guilty pleas. When a defendant pleads guilty to certain charges in exchange for the State’s agreement to dismiss other charges and recommend a specific sentence, the defendant may not seek reconsideration of that sentence after it has been imposed unless he also moves to withdraw his guilty plea. As we wrote in Evans,
“following the entry of judgment on a negotiated guilty plea, even if a defendant wants to challenge only his sentence, he must move to withdraw the guilty plea and vacate the judgment so that, in the event the motion is granted, the parties are returned to the status quo.” Evans, 174 Ill. 2d at 332.
We reached this conclusion by reasoning that if a defendant pleads guilty to certain charges in exchange for an agreement by the State to dismiss other charges and recommend a specific sentence, allowing the defendant to subsequently challenge only his sentence violates basic contract law principles. In effect, the defendant would be attempting to hold the State to its part of the bargain while unilaterally reneging on or modifying the terms he had previously agreed to accept. Evans, 174 Ill. 2d at 327.
The rule announced in Evans was subsequently applied by this court in People v. Clark, 183 Ill. 2d 261 (1998). In Clark the defendant pleaded guilty in exchange for the State’s agreement to recommend a particular sentence. There was an issue, however, as to whether that sentence would be served consecutively to or concurrently with sentences imposed by another state. The State and the defendant agreed to have the issue resolved by the trial court.
The circuit court accepted the parties’ plea agreement, then set a hearing on the question of whether the Illinois sentence should be served concurrently or consecutively. Following that hearing, the court ruled that the sentence had to be served consecutively to the other state’s sentences. Defendant then filed a motion to reconsider his sentence. He did not seek to have his guilty plea set aside. He merely argued that making the sentence consecutive was not required by law and was too severe under the circumstances.
The circuit court denied defendant’s motion, and he appealed. When the appeal reached us for a decision on the merits, we held that “a plea agreement that leaves open only the applicability of a mandatory sentencing statute constitutes a negotiated plea agreement, as contemplated in Evans.” Clark, 183 Ill. 2d at 262. Accordingly, we concluded that the defendant, who wanted to challenge the sentence imposed by the court, could not merely move to have the sentence reconsidered. Under Evans,
“even though defendant sought to challenge only the consecutive aspect of his sentence, he was required to file a motion to vacate the judgment and withdraw the guilty plea, because his plea of guilty was given in exchange for a specific sentence, regardless of whether the statute mandated a consecutive sentence. Defendant’s motion to reconsider, therefore, was improper under these circumstances.” Clark, 183 Ill. 2d at 268.
We believe that the reasoning employed by this court in Evans and followed in Clark applies with equal force where, as here, the defendant agrees to plead guilty in exchange for the State’s dismissal of certain charges and recommendation of a cap on his sentence. By agreeing-to plead guilty in exchange for a recommended sentencing cap, a defendant is, in effect, agreeing not to challenge any sentence imposed below that cap on the grounds that it is excessive. See People v. Catron, 285 Ill. App. 3d 36, 37 (1996) (defendant who agrees to a potential range of sentences implicitly concedes that a sentence imposed within the range cannot be excessive). While the defendant may not like the sentencing court’s ultimate disposition, that is a risk he assumes as part of his bargain. A defendant who is unwilling to accept that risk should not agree to a cap rather than a fixed term. Where the sentence imposed is within the agreed upon cap, as the sentences here were, allowing the defendant to seek reconsideration of his sentence without also moving to withdraw his guilty plea unfairly binds the State to the terms of the plea agreement while giving the defendant the opportunity to avoid or modify those terms. That is precisely the situation the Evans rule was designed to prevent.
Because neither Linder nor Rice moved to withdraw his guilty plea and vacate the circuit court’s judgment, as required by Rule 604(d) and by Evans, the circuit court correctly refused to reconsider their sentences. In addition, the appellate court should not have entertained defendants’ appeals. Where a defendant fails to comply with the motion requirements of Rule 604(d), as these defendants did, the appellate court must dismiss the appeal (People v. Jamison, 181 Ill. 2d 24, 28-29 (1998)), leaving the Post-Conviction Hearing Act as the defendant’s only recourse (People v. Foster, 171 Ill. 2d 469, 471 (1996)).
Finally, we reject the appellate court’s view that Evans’ construction of Rule 604(d) should not be applied in Rice because Rice arose prior to issuance of our opinion in Evans. Rice was pending when Evans was announced, and when Rice first came before us, we remanded it to the appellate court for the express purpose of having the court reconsider its decision in light of Evans. People v. Rice, 171 Ill. 2d 580 (1997). If we believed that Evans were inapplicable, we would not have ordered that remand. As a general rule, this court’s decisions apply to all cases that are pending when the decision is announced, unless this court directs otherwise. People v. Granados, 172 Ill. 2d 358, 365 (1996). The appellate court cited no authority for deviating from that general rule here.
For the foregoing reasons, we reverse the judgment of the appellate court in Linder and affirm the circuit court’s judgment denying defendant’s motion to reconsider his sentence. We likewise reverse the appellate court’s judgment in Rice and affirm the judgment of the circuit court.
No. 83415 — Appellate court judgment reversed; circuit court judgment affirmed.
No. 84014 — Appellate court judgment reversed; circuit court judgment affirmed.
JUSTICE RATHJE took no part in the consideration or decision of this case.