
790 P.2d 521 (1990)
STATE of New Mexico, Plaintiff-Appellee,
v.
Gildardo BENCOMO, Defendant-Appellant.
No. 11409.
Court of Appeals of New Mexico.
March 13, 1990.
Jacquelyn Robins, Chief Public Defender, Jonathan A. Abbott, Asst. Appellate Defender, Santa Fe, for defendant-appellant.
Hal Stratton, Atty. Gen., Katherine Zinn, Asst. Atty. Gen., Santa Fe, for plaintiff-appellee.

OPINION
HARTZ, Judge.
Defendant appeals the judgment entered on his plea of no contest to the charge of child abuse resulting in death. NMSA 1978, § 30-6-1(C)(2) (Repl.Pamp. 1984). We apply the doctrine of fundamental error and reverse because the district court failed to offer defendant the opportunity to withdraw his plea after the court refused to accept the prosecutor's sentencing recommendation pursuant to a plea agreement between the state and defendant.
The plea agreement provided that the state would recommend a period of actual incarceration not to exceed six months and an in-house mental health treatment program to last up to eighteen months. Nevertheless, the district court's judgment, sentence, and commitment, filed on February 15, 1989, imposed a sentence of imprisonment for a term of nine years, the maximum allowed. On March 3 defendant filed a motion for reconsideration, which was denied by order dated March 16. On March 17 defendant filed a motion to withdraw his plea, claiming that (1) the district attorney had violated the plea agreement by informing the district court that defendant had committed an unrelated heinous act and that police officers involved in the case felt that defendant deserved a one-year incarceration, and (2) defendant did not receive effective assistance of counsel because his attorney did not provide adequate advice. Later that day the district court filed its order denying defendant's motion to withdraw his plea and defendant filed a timely notice of appeal.
Defendant's original docketing statement listed only one issue presented: whether the district court abused its discretion in denying defendant's motion to withdraw his plea. We assigned the case to the general calendar and requested counsel to brief the question of this court's jurisdiction to hear an appeal from an order denying a post-conviction motion. See SCRA 1986, 5-802(G)(2) (review of district court's denial of petition for writ of habeas corpus is by filing petition for writ of certiorari *521 with supreme court). We need not address that question, however, because we grant the relief defendant seeks without having to consider the merits of the contentions in his post-conviction motion. We rely on a ground raised by defendant for the first time on appeal.
That ground is the failure of the district court to offer defendant the opportunity to withdraw his plea pursuant to SCRA 1986, 5-304(D) when the district court determined that it would not accept the state's recommendation for incarceration of only nine months. Rule 5-304(D) states:
D. Rejection of plea. If the court rejects the plea agreement, the court shall inform the parties of this fact, advise the defendant personally in open court that the court is not bound by the plea agreement, afford either party the opportunity to withdraw the agreement and advise the defendant that if he persists in his guilty plea, plea of no contest or guilty but mentally ill the disposition of the case may be less favorable to the defendant than that contemplated by the plea agreement.
Eller v. State, 92 N.M. 52, 582 P.2d 824 (1978) held that even though a plea agreement states only that the prosecutor will recommend a certain sentence, Rule 5-304(D) requires the district court to permit withdrawal of the plea if the court does not follow that recommendation. The district court in this case did not follow the command of Eller. Defendant is therefore entitled to remand so that he may withdraw his plea if the district court does not resentence him in accordance with the plea agreement.
We undoubtedly have jurisdiction to consider the Eller issue on appeal. Defendant filed a timely notice of appeal from the judgment, and we can resolve the Eller issue based on the district court record at the time the notice of appeal was filed.
Of greater concern than our jurisdiction to review the Eller question is whether we can properly consider that question when it was raised by defendant for the first time on appeal. In general, an appellate court will not consider a question unless it has been preserved for review in district court. See SCRA 1986, 12-216. One exception to the general rule, however, permits consideration for the first time on appeal of questions involving "fundamental error." See R. 12-216(B)(2). No reported New Mexico decision has considered when there may be fundamental error with respect to a plea of guilty or no contest. The doctrine of fundamental error ordinarily concerns the conduct of a trial. Yet the articulation of the doctrine in State v. Lucero, 70 N.M. 268, 272, 372 P.2d 837, 840 (1962) suggests its application in other contexts:
The doctrine of fundamental error has its place in this jurisdiction. But the errors complained of must be such as go to the foundation of the case, and which deprive the defendant of rights essential to his defense. The discretion residing in this court to apply the doctrine is not to be exercised in aid of strictly legal, technical or unsubstantial claims. Where substantial justice has been done, the parties must have taken and preserved exceptions in the lower court before this court will notice them on appeal. [Citations omitted.]
When a defendant has pleaded guilty or no contest, the "foundation of the case" is the validity of the plea. "Substantial justice" has not been done when grave doubt arises as to whether the defendant would have entered and maintained his plea if his rights had been observed. Thus, applying the principles of Lucero to the context of a plea of guilty or no contest, we find the error below to be fundamental because it satisfies the following two requirements: (1) the error must be clear, and (2) the error must clearly have affected the outcome.
We have already discussed the first requirement. The second requirement is satisfied because of the high probability that defendant would have withdrawn his plea if the district court had complied with Eller. We note that the sentence imposed was the maximum sentence permissible for the only charge filed against defendant (the plea agreement did not require the state to dismiss or refrain from filing any *523 other charges), and defendant filed a motion to withdraw his plea promptly after the district court denied his motion to reconsider sentence. There is no hint that defendant intentionally waived his rights under Eller for tactical reasons. We point out that we would ordinarily question whether the second requirement was satisfied if defendant waited a considerable period of time before raising the Eller issue, because in that event one could infer that (1) at the time of sentencing, defendant felt that, notwithstanding the penalty's being harsher than expected, the plea was still advantageous, and (2) defendant's belated desire to withdraw the plea was inspired by a belief that the state would be substantially handicapped by having to go to trial at a delayed date. Our holding that the failure to comply with Eller constituted fundamental error is supported by decisions in other jurisdictions. In those decisions, even though the defendant had not objected at the time of sentencing, the appellate court overturned a plea of guilty or no contest on the ground that the defendant had not been afforded an opportunity to withdraw his plea after the sentencing court rejected a promised or recommended sentence. See State v. Bergerson, 144 Vt. 200, 475 A.2d 1071 (1984) (plain error); People v. Johnson, 10 Cal.3d 868, 112 Cal. Rptr. 556, 519 P.2d 604 (1974) (In Bank); State v. Schaeffer, 5 Conn. App. 378, 498 A.2d 134 (1985) (plain error); People v. Smith, 76 A.D.2d 891, 429 N.Y.S.2d 29 (1980).
Finally, the state urges us to certify this case to the New Mexico Supreme Court for a reconsideration of Eller. We recognize that Eller may have been a controversial decision. It was a 3-2 decision of the New Mexico Supreme Court, reversing a 2-1 decision of this court. Nevertheless, we ordinarily do not certify an issue to our supreme court for reconsideration of an earlier case unless subsequent legislation, decisions of the New Mexico Supreme Court, or decisions of the United States Supreme Court place in question the underpinnings of the decision being challenged. That is not the situation here. On the contrary, the New Mexico Supreme Court has not seen fit to modify the language of Rule 5-304(D), which would be the most expedient way for that court to modify Eller. Therefore, we do not accept the state's invitation to certify this case to our supreme court. We note, of course, that the supreme court could revisit Eller by granting certiorari in this case.
For the above reasons, we remand to the district court with instructions either (1) to resentence defendant in conformity with the plea agreement or (2) to permit defendant to withdraw his plea.
IT IS SO ORDERED.
ALARID and APODACA, JJ., concur.
