(concurring in part and dissenting in part). I concur with the lead opinion’s remand for resentencing on the armed robbery conviction. However, I dissent from its holding that the modification *102of the felony-firearm sentence was harmless error because the defendant admits to the prior felony-firearm conviction. In contrast, I would hold that the defendant is also entitled to resentencing for the felony-firearm conviction.
The defendant’s sentence for the felony-firearm conviction was changed from two years to five years, although the prior conviction had not been officially established or made a part of the record in this case. Even if it had been established, I disagree with the lead opinion’s assertion that the defendant’s sentence would necessarily have to be amended to be five years. If the prosecution has the discretion whether to charge the defendant with felony-firearm initially, it should also be able to enter into a plea bargain requiring the defendant to serve only two years instead of five. I would not want to limit the discretion of the prosecutor in a plea-bargain situation.
I emphasize that defendant was charged with felony-firearm. The information indicated that the sentence was a mandatory two years. Further, as he pleaded guilty, the judge informed him that he faced a two-year term.1 On the basis of the plea, he was, in fact, sentenced to the mandatory two-year term. Because the prosecution had the ability to discover the defendant’s prior record, but did not do so, it *103should be held to its bargain of a two-year sentence for the felony-firearm conviction.
I
Sentencing is a critical stage of the proceedings, at which the defendant has a Sixth Amendment right to be represented by counsel. People v Eason, 435 Mich 228, 234, n 8; 458 NW2d 17 (1990); People v Smith, 423 Mich 427, 452; 378 NW2d 384 (1985) (opinion of Williams, C.J.); People v Wakeford, 418 Mich 95, 121; 341 NW2d 68 (1983); People v Johnson, 386 Mich 305, 316-317; 192 NW2d 482 (1971).
In this instance, the defendant’s sentence for felony-firearm was increased from two years to five years. Such a judicial order establishing the term of imprisonment is indeed a “sentence,” at which the right to counsel attaches.
It appears that the action of the trial court and the affirmance of the Court of Appeals are largely premised on the view that it is certain that the defendant should have received a five-year sentence for felony-firearm. The unstated assumption is that, therefore, it would have been a waste of time and resources to conduct a resentencing.
There are at least two reasons why this approach is erroneous. First, the constitutional and other protections that attend a sentencing2 are properly honored even when the outcome of the sentencing proceeding is a foregone conclusion.3 Thus, a person convicted of *104first-degree murder4 must be formally sentenced, although the trial court’s only option is a life sentence without possibility of parole. Other mandatory penalties, including the ordinary two-year sentence for felony-firearm, likewise must be formally pronounced in the presence of the defendant.
Second, a court may not deny counsel at a critical stage of the proceedings on the ground that the court cannot think of a basis upon which to challenge a ruling that the court intends to make. If this defendant had been given an opportunity to appear with counsel, he might well have been able to formulate a legal challenge to the five-year sentence.5 Several potential issues are evident here, though his right to counsel at sentencing is not dependent on a court’s ability to foresee a meritorious argument.
n
In this case, the charging documents stated that the defendant faced a two-year term of imprisonment. As he pleaded guilty, he was informed again that he faced a two-year term. On the basis of this plea, he was convicted and later sentenced to the two-year term. Without notice or the opportunity to be represented by counsel, the defendant was resentenced to a five-year term of imprisonment by an order that the trial court entered sua sponte. Such an occurrence violates the defendant’s right to counsel.6 A court may *105not enter an amended order of judgment that increases the period of a defendant’s incarceration without giving notice and allowing the defendant an opportunity to appear with counsel, address the court, and hear the court’s explanation of its sentencing decision.
in
For these reasons, I would reverse the judgment of the Court of Appeals, reverse in part the judgment of the trial court, and remand this case to the trial court for further proceedings. MCR 7.302(F)(1).
In connection with the plea, the assistant prosecutor agreed to the dismissal of some unrelated charges. During the plea proceeding, the trial court advised the defendant:
Now, the People have agreed with you and your attorney that if you plead guilty as charged to armed robbery and felony firearm which carries a mandatory two years and has to be served consecutive; in other words, you can’t serve the time for both crimes simultaneously. You have to do felony firearm two years first before you begin getting any credit for the armed robbery.
See, generally, MCR 6.425 and chapter IX of the Code of Criminal Procedure, MCL 769.1 et seq.; MSA 28.1072 et seq.
As I emphasized above, I do not think the five-year sentence is a foregone conclusion in this case. The two-year sentence was part of the plea bargain, which should be enforced. However, even if the five-year sen*104tence were required, the defendant should be entitled to formal resentencing.
MCL 750.316; MSA 28.548.
For example, he would have been able to argue that the two-year sentence was part of the plea bargain.
It is unnecessary to determine whether it is also a denial of his constitutional right to due process of law.