On November 21, 1983, following a hearing, the circuit court revoked defendant Paul W. Newkirk’s probation which had been granted on April 25, 1983. He was then sentenced to imprisonment for five years. Defendant appeals. We reverse and remand with directions.
Defendant was charged by information on January 28, 1983, with the crime of driving while intoxicated, third offense, § 577.010, RSMo (1978). The offense occurred on July 31, 1982. To support the felony charge, the State pleaded that defendant had two prior driving while intoxicated convictions. One was on June 9, 1969, and the other on November 8, 1971.
Defendant pled guilty to the felony charge on March 21, 1983, and formal sentencing was set for April 25, 1983. On March 25, 1983, defendant, by motion, sought to withdraw his plea of guilty contending that the court lacked jurisdiction to sentence him on a felony charge. The motion was overruled and on April 25, 1983, the court suspended the imposition of sentence and placed defendant on probation for five years. Defendant later violated his probation resulting in the revocation on November 21, 1983, of that probation and a sentence of five years’ imprisonment was imposed. On that date the court also overruled a second motion by the defendant to withdraw his plea of guilty.
Ordinarily a plea of guilty consents to the judgment of the trial court and waives all defenses and errors. However if there is an attack on the jurisdiction of the court or the sufficiency of the information or indictment, a direct appeal from a plea of guilty is proper. State v. Murphy, 626 S.W.2d 649, 650 (Mo.App.1981).
The dispositive issue on appeal is whether the circuit court had jurisdiction to sentence the defendant on a felony charge rather than on a misdemeanor charge. It was conceded that the information properly charges the defendant with driving while intoxicated. The question is whether it charges him with a felony or misdemeanor. At the time of the commission of this offense, § 577.010, RSMo (1978) was in effect. That statute provided that a third offense of DWI was a class D felony. Under the law as it existed on that date, defendant would have been properly charged with a felony. At the time defendant pled guilty on March 21, 1983, § 577.-010 had been amended effective August 13, 1982, and § 577.023, RSMo (Supp.1982) had become effective. The new law (§ 577.023) provided generally that the prior intoxicated-related traffic offenses had to be within ten years of the occurrence for the present offense to constitute a felony. By November 1,1983, when the defendant’s probation was revoked and he was sentenced, § 577.-023 had been further amended effective September 28, 1983.1
*907The question then is which statutes apply. At the time the defendant pled guilty on March 21, 1983, the 1982 amendments were in effect and were applicable to his case, even though the offense occurred before the effective date of the amendments. This is because the amendments effected a change that mitigated the penalty for violation of the statute as it applied to the defendant rather than increasing it. A.B. v. Frank, 657 S.W.2d 625, 627 (Mo. banc 1983); § 1.160, RSMo (1978); see State v. Thornton, 651 S.W.2d 164 (Mo.App.1983). The application of a law which becomes effective after the date that the crime was committed does not violate the constitutional prohibition of the U.S. Const., Art. I, § 10, and Mo. Const., Art. I, § 13 against ex post facto laws because the amended statutes reduce the punishment rather than increase it. Frank, 657 S.W.2d at 627. We therefore hold that the circuit court erred in sentencing the defendant as a felon because the 1982 amendments were applicable at the time that he pled guilty. The proper charge would have been driving while intoxicated, a class B misdemeanor under § 577.010, RSMo (Supp.1982).
Because the court was without jurisdiction to sentence the defendant as a felon, the case is reversed and remanded with directions to sustain defendant’s motion to withdraw his plea of guilty. Should the State wish to proceed with the prosecution of the defendant under the misdemean- or charge (§ 577.010, RSMo (Supp.1982)) and should the defendant be found guilty or plead guilty, the 1983 amendments to § 577.023 and the 1982 amendments to § 577.010 would be applicable as they would be in effect at the time of the trial on the merits. Section 577.010, RSMo (Supp.1982); § 577.023, RSMo (Supp.1983). In view of our holding it is unnecessary to consider the other point raised by defendant on appeal.
Reversed and remanded with directions.
REINHARD, C.J., and CRIST, J„ concur.. Section 577.023.1(2), effective September 28, 1983:
A 'persistent offender’ is one who has pleaded guilty to or has been found guilty of two or more intoxication-related traffic offenses committed at different times within ten years of a previous intoxication-related traffic offense conviction; and ....
Section 577.023.1(2), effective August 13, 1982: For the third offense or for a second or subsequent offense after a previous conviction of one or more of the other of such sections if such subsequent offense is committed within ten years after the second offense or the previous conviction, a class D felony. No court shall sentence such person to pay a fine in lieu of a term of imprisonment, or suspend the imposition of sentence as to such person, section 577.011, RSMo, to the contrary notwithstanding. A third offense or a second or subsequent offense after a previous conviction of one or more of the other of such sections *907which occurs more than ten years after the second offense or previous conviction shall be treated as a first conviction.