OPINION
PHILLIPS, Judge.This is an appeal from a conviction for aggravated robbery. Appellant pleaded guilty before the court, and punishment, enhanced by two prior felony convictions, was assessed at life imprisonment.
Appellant challenges the validity of his guilty plea because the trial court failed to admonish him of the range of punishment which attached to the offense, as required by Article 26.13(a)(1), V.A.C.C.P. We agree and reverse the judgment.
Appellant was indicted on February 15, 1977, for the aggravated robbery of Delores Niemann. Included in the indictment were paragraphs which alleged two prior felony convictions of appellant for purposes of enhancement. Appellant’s case was called on March 14, 1978, and appellant pleaded guilty. The court admonished appellant concerning the range of punishment as follows:
JUDGE: You plead guilty knowing that the penalty could be-up to life imprisonment?
MB. TAYLOR: Yes, sir.
JUDGE: And the lowest you could get, would be what, five years?
MR. DIETZE [Prosecutor]: Assuming he is found guilty, habitual, assuming he is the same person, two previous convictions, it would be automatic life.
JUDGE: You understand all about that, and you still want to plead guilty?
MR. TAYLOR: Yes, sir.
JUDGE: The Court will accept your plea.
Written statements of the complainant and a witness to the offense were admitted in evidence, along with the pen packets for the two prior convictions alleged in the indictment. Appellant stipulated that he was the same person who had been convicted of the prior felonies, and the second previous felony conviction was for an offense that occurred subsequent to the first previous conviction having become final. The court found appellant guilty of the offense charged and found that appellant had been convicted of the two prior felonies. The court set punishment at life imprisonment pursuant to Section 12.42(d) of the Penal Code.
Subsequently, on September 19,1978, the trial court held a hearing to reassess punishment. The court feared that the procedure it followed when it originally assessed punishment was improper and wished to correct the error. At this time appellant filed a motion to withdraw his plea of guilty on the grounds that the trial court had failed to admonish him when he entered his guilty plea that he could receive a mandatory punishment of life imprisonment under Section 12.42(d), supra. Appellant’s motion was denied and a second judgment was rendered based on the original judgment. Appellant then filed a motion for new trial urging the same error; his motion was denied, and he appealed to this Court.
Appellant urges that the court erred when it failed to admonish him that he could receive a mandatory life sentence under Section 12.42(d), supra. Prior to accepting a plea of guilty, the trial court must *828admonish the defendant of the range of punishment attached to the offense. Article 26.13(a)(1), supra; McDade v. State, 562 S.W.2d 487 (Tex.Cr.App.1978); Murray v. State, 561 S.W.2d 821 (Tex.Cr.App.1977); Walker v. State, 524 S.W.2d 712 (Tex.Cr.App.1975). In this case the court admonished appellant only as to the range of punishment for an unenhanced first degree felony, i. e., confinement in the penitentiary ranging from a minimum term of five years to a maximum term of life imprisonment. See Section 12.32 of the Penal Code. The court did not admonish appellant as to the punishment which would attach if appellant’s conviction were enhanced by the two prior felony convictions, i. e., mandatory life imprisonment, with no discretion in the court to assess a term of years. See Section 12.42(d), supra.
The court did state that it could assess punishment at life imprisonment, but it did not inform appellant that if the enhancement paragraphs of the indictment were proved up it could assess only that punishment. As it stood, the admonition implied that the court would have the discretion to assess punishment anywhere between five years and life imprisonment. Clearly, appellant was not made aware of the full consequences of his plea of guilty.
Even prior to 1975, when Article 26.13, supra, was amended to explicitly provide that a defendant must be admonished as to the range of punishment attached to the offense, this Court held that a trial court must admonish a defendant in a felony case of the consequences of his plea, including the punishment provided by law for the offense and the punishment which could be inflicted under his plea. Wright v. State, 499 S.W.2d 326 (Tex.Cr.App.1973); Alexander v. State, 163 Tex.Cr.R. 53, 288 S.W.2d 779 (1956). In Teamer v. State, 557 S.W.2d 110 (Tex.Cr.App.1977), we held it was proper to admonish the defendant on the range of punishment for a second degree felony, where the defendant pleaded guilty to the commission of a third degree felony and the indictment alleged a prior felony conviction for the purpose of enhancement.
We hold that the trial judge violated the mandate of Article 26.13(a)(1), supra, to admonish the defendant of the range of punishment attached to the offense.
Because the court failed to admonish appellant concerning the most severe punishment which could be inflicted, the trial judge cannot be said to have substantially complied with the terms of Article 26.-13(a)(1), supra. See Walker, supra. Moreover, we cannot say that .the error was harmless in light of the maximum punishment assessed and appellant’s sworn statement attached to the motion to withdraw his plea of guilty that he did not understand the range of punishment which might be assessed and did not understand that he was being charged as an habitual criminal. Finally, the prosecutor’s statement during the court’s admonishment of appellant to the effect that appellant could get “automatic life” was not sufficient to cure the error. Article 26.13, supra, provides, and this Court has held, that it is the trial court which must admonish the accused of the range of punishment attached to the offense. A prosecutor may not admonish the accused. See Whitten v. State, 587 S.W.2d 156 (1979); Murray v. State, supra.
The judgment is reversed and the cause remanded.