Upon an agreed statement of facts, Petitioner, Jeffrey Todd Shilling, was found guilty of operating a motor vehicle while intoxicated in violation of Maryland Code (1987 Repl. Vol., 1989 Cum.Supp.) § 21-902(a) of the Transportation Article. Despite its awareness that in 1984 Shilling previously had been found guilty of driving while under the influence of alcohol, a violation of Maryland Code (1987 Repl.Vol., 1989 Cum.Supp.) § 21-902(b) of the Transportation Article, and had been given probation before judgment, the Circuit Court for Carroll County (Burns, Jr., J.), stayed the entry of a judgment of conviction and granted Shilling probation before judgment and fined him $250.00 as a condition of probation.
The State appealed on the ground that the trial judge failed to impose a sentence as mandated under Maryland Code (1987 Repl.Vol., 1989 Cum.Supp.) Article . 27, § 641(a)(2). The Court of Special Appeals agreed and reversed the lower court with instructions to enter a conviction and to impose a sentence. State v. Shilling, 75 Md. App. 233, 540 A.2d 1184 (1988). The court found that probation before judgment was an improper disposition since Shilling’s violation of § 21-902(a) was subsequent to his violation of § 21-902(b). Therefore, as a subsequent offender, Shilling, under the terms of § 641(a)(2), could not be granted probation before judgment. The intermediate appellate court found no merit in Shilling’s contention that under Maryland Rule 4-245(c) he was entitled to notice of the State’s intention to prosecute him as a subsequent offender. The court explained that because probation before judgment was not a prior conviction, the State was not required to give notice.
We granted Shilling’s Petition for Certiorari to consider the following issues:
1. Whether Article 27, § 641(a)(2) is a mandatory sentencing statute upon which the State has a right to appeal.
*2912. Whether the trial court failed to impose the proper sentence when it granted Shilling probation before judgment.
3. Whether the State was required to give notice pursuant to Maryland Rule 4-245(c) of its intention to prosecute a defendant as a subsequent offender.
We set forth those parts of the statutes and Maryland Rules which are fundamental to a determination and resolution of these issues:
Former Maryland Code (1987 Repl.Vol.) Art. 27, § 641(a)(2) provides:
(a)(2) — Notwithstanding paragraph (1) of this subsection, a court may not stay the entering of judgmént and place a person on probation for a second or subsequent violation of § 21-902(a) or (b) of the Transportation Article if the second or subsequent violation occurred within 5 years of the previous violation. A person is in violation of § 21-902(a) or (b) if that person receives probation under this section.
Transportation Article § 21-902(a) and (b) provide:
(a) Driving while intoxicated. — A person may not drive or attempt to drive any vehicle while intoxicated.
(b) Driving while under the influence of alcohol. — A person may not drive or attempt to drive any vehicle while under the influence of alcohol.
Former Maryland Code (1957, 1968 Repl.Vol.) Art. 5, § 14. Right of Appeal by State.—
The State may appeal to the Court of Special Appeals from a final order or judgment granting a motion to dismiss, or quashing or dismissing any indictment, information, presentment or inquisition in a criminal action, but the State shall have no right of appeal in any criminal action where the defendant has been tried and acquitted.
Maryland Code (1984 Repl.Vol. 1989 Cum.Supp.) § 12-302(c)(2) of the Courts and Judicial Proceedings Article:
*292The State may appeal from a final judgment if the State alleges that the trial judge failed to impose the sentence specifically mandated by the Code.
Maryland Rule 4-245, in pertinent part, provides:
(a) Definition. — A subsequent offender is a defendant who, because of a prior conviction, is subject to additional or mandatory statutory punishment for the offense charged.
(c) Required Notice of Mandatory Penalties. — When the law prescribes a mandatory sentence because of a specified previous conviction, the State’s Attorney shall serve a notice of the alleged prior conviction on the defendant or counsel at least 15 days before sentencing in circuit court or five days before sentencing in District Court. If the State’s Attorney fails to give timely notice, the court shall postpone sentencing at least 15 days unless the defendant waives the notice requirement.
Shilling argues that, pursuant to Courts and Judicial Proceedings Article § 12-302(c)(2), the State has no right to appeal because an appeal is only permissible if the trial judge failed to impose a sentence as prescribed by § 641(a)(2). The latter statute, he argues, is only applicable to a second or subsequent violation of the same subsection. Therefore, he urges this Court not to consider his violation of § 21-902(a) as a subsequent offense to subsection (b), and to hold that the trial court did not err in granting him probation as a first time offender in violation of § 21-902(a). Alternatively, Shilling argues that should § 641(a)(2) be deemed a mandatory sentencing statute, then his constitutional rights to due process were denied since the State failed to give him proper notice that it would treat him as a subsequent offender based upon his prior violation of § 21-902(b).
Because the first and second issues are intertwined we address them together. We consider then whether a sentence is mandated under § 641(a)(2) so that *293the State may appeal pursuant to Cts. and Jud.Proc. Art. § 12-302(c)(2) when the mandate is not carried out. Here, the defendant was given probation before judgment pursuant to Art. 27, § 641(a)(2). Subsection 641(a)(2) mandates that a court impose a sentence upon a subsequent violation of § 21-902(a) or (b), irrespective of its length, so long as it does not exceed the statutory maximum. Probation before judgment for a first offender, while a final appealable judgment, see Telak v. State, 315 Md. 568, 556 A.2d 225 (1989), is not tantamount to a sentence which imposes a period of incarceration after a conviction defining a defendant’s culpability.
When § 641(a)(2) directs that in the case of a second or subsequent violation a court “may not stay the entering of judgment,” however, we think the legislature mandated that the court enter on the record the finding of guilt and intended that some sentence, however minimal, be imposed upon the defendant if the subsequent violation occurred within five years of the previous violation.
That this is the legislative intent is made clear by the language of the statute, see Kaczorowski v. City of Baltimore, 309 Md. 505, 525 A.2d 628 (1987), and is made evident by the legislative mandate eliminating the possibility of probation for a subsequent violation of either (a) or (b). Thus, it is our view that the legislature intended to deny a subsequent offender who abuses alcohol and operates a motor vehicle any kind of grace where he is found to have violated the provisions of § 21-902 a second time within a five year period. The trial judge in the case sub judice failed to follow the dictates of § 641(a)(2) when he imposed probation before judgment, an illegal disposition specifically prohibited by statute.
On prior occasions we have pointed out the impropriety of trial courts failing to follow the clear mandate of the legislature and the right of the State to appeal when that failure results in the court refusing to impose a sentence mandated by law. See State v. Hannah, 307 Md. 390, 514 A.2d 16 (1986); State ex rel. Sonner v. Shearin, 272 Md. *294502, 325 A.2d 573 (1974). In each instance, we pointed out that the State’s appeal would lie because the issue generally involved whether the trial court’s jurisdiction had been exceeded in prescribing a sentence contrary to the statute’s mandate.
Section 12-302(c)(2) confers a right of appeal on the State urider circumstances where the State alleges that the trial court failed to impose a sentence specifically mandated by the statute under which the defendant is charged. For our purposes, a sentence is specifically mandated when the legislature prohibits probation before judgment or suspension of the imposition of sentence. In Hannah, we discussed at length the history regarding the enactment' of § 12-302(c) and its impact upon the State’s right of appeal. There we pointed out that prior to the enactment of § 12-302(c), the State’s right of appeal, as authorized by Art. 5, § 14, permitted an appeal by the State from the imposition of an illegal sentence. The appellate courts were entitled to correct an illegal sentence at any time. See State v. Wooten, 277 Md. 114, 352 A.2d 829 (1976); State v. Jacob, 234 Md. 452, 199 A.2d 803 (1964); State v. Fisher, 204 Md. 307, 104 A.2d 403 (1954). See also Sonner, 272 Md. at 520, 325 A.2d at 583. Section 12-302, as originally enacted, departed from Art. 5, § 14 by virtually eliminating the State’s right to appeal an illegal sentence as documented in Sonner. In subsequent cases, we have recognized that, although Sonner and earlier cases would have allowed the State a right of appeal .where there, was an “illegal” sentence, the enactment of § 12-302(c)(2) seeks, to specify that the State may appeal when the trial court-does not impose a sentence the. legislature has clearly mandated. See Telak, Hannah, supra.
Hannah was a case where the defendant was granted probation before judgment contrary to the minimum mandatory sentence of five years for use of a handgun in the commission of a crime under Maryland Code (1957, 1987 Repl.Vol.) Art. 27, § 36B, Maryland’s handgun statute. Subsection 36B(d)(l) provided in relevant part that a term of *295not less than 5 but no more than 20 years be imposed for a first violation of the handgun law, and that “no court shall enter a judgment of probation before or without verdict” on a handgun offense. Art. 27, § 36B(e)(3). The State appealed contending that the defendant should have been given the minimum sentence under the statute. In concluding that the minimum sentence requirement could not be satisfied by any form of probation, we stated that the State’s appeal would lie under § 12-302(c)(2) because the statute expressly authorized the State a right of appeal where the trial court’s disposition clearly violated the statutory mandate given by the legislature, thus making the sentence an illegal sentence. We noted generally that a trial judge cannot impose a legal sentence less than the minimum required under the statute. Hannah, 307 Md. at 402, 514 A.2d at 22. See also State v. Thurmond, 73 Md.App. 686, 536 A.2d 128 (1988) (any other sentence not in accordance with the statute would be illegal).
Here, Shilling contends that Art. 27, § 641(a)(2) is not a mandatory sentencing statute, in that it does not specifically set forth a minimum sentence that must be imposed. We recognized in Hannah that the handgun statute specified a mandatory minimum sentence. Section 641(a)(2), however, is different, in that it specifies a maximum sentence that may be imposed while stating that any form of probation (meaning probation before judgment) is prohibited. The statute does not with particularity specify what the minimum penalty shall be, but leaves this, in part, to the discretion of the sentencing court. This is made clear when one examines the language of the statute.
Although the language used in the Transportation Article, “not more than,” places a cap as to the sentence that may be imposed for either violation, we stress that it does not, however, prescribe with specificity what the minimum punishment would be. If, however, we construe the legislative intent to withhold any further grace, such as probation before judgment, and to treat subsequent offenders more harshly, then anything less than some sentence of punish*296ment would thwart that intent. The legislative intent that the subsequent offender suffer some penalty is indelibly clear to us. Thus, as we see it, the legislature in clearly prohibiting probation for the subsequent offender mandated that some sentence be imposed whether it be one day and/or a dollar. We hold, therefore, that a sentence must be imposed under these circunistances, and the State may maintain its appeal.
Having determined that this case is properly before us, we now turn to the issue of whether Shilling was entitled to notice under Maryland Rule 4-245(c). Shilling contends that the State was required to give him notice that it would seek additional punishment under the subsequent offender statute, Maryland Rule 4-245. However, the State asserts that no notice was required since Shilling’s prior probation before judgment was not a “prior conviction” under Maryland Rule 4-245(a). For reasons stated below, we disagree with the State’s contention.
In Myers v. State, 303 Md. 639, 496 A.2d 312 (1985), we pointed out that the word “conviction” has different meanings and may vary according to the context and purpose of the statute in which it appears. We noted that probation before judgment was a conviction in certain instances, but not a conviction in others. We said that probation before judgment is not a conviction where a defendant is satisfactorily discharged from probation because he has fulfilled the terms and conditions of his probation order. By contrast, we noted that probation before judgment is a conviction if the defendant violates the probation order and judgment. is then entered for the crime for which he had been previously found guilty. Id. at 647, 496 A.2d at 316. We went on to explain that the legislature in amending § 641 reserved to the trial judge the power to grant probation before judgment thereby deferring the determination of the sentence to be imposed until and unless a violation occurred.
*297Maryland Rule 4-245(a) defines a subsequent offender as one who because of a prior conviction is subject to an additional or mandatory statutory punishment. Since Shilling would be deemed a subsequent offender under § 21-902, for purposes of § 641(a)(2), he was entitled to notice. We pointed out in Loveday v. State, 296 Md. 226, 462 A.2d 58 (1983), that notice is required where additional penalties for subsequent offenses are sought. Id. at 236-37, 462 A.2d at 62-63. See also, King v. State, 300 Md. 218, 477 A.2d 768 (1984); Armstrong v. State, 69 Md.App. 23, 515 A.2d 1190 (1986), cert, denied, 309 Md. 47, 522 A.2d 392 (1987). As we previously indicated Rule 4-245(c) provides, in part, that
[w]hen the law prescribes a mandatory sentence because of a specified previous conviction, the State’s Attorney shall serve a notice of the alleged prior conviction on the defendant or counsel at least 15 days before sentencing in circuit court or five days before sentencing in District Court.
We believe that the operative language of Rule 4-245(c) makes it mandatory for the State to serve notice at least 15 days before sentencing in the circuit court. The purpose of requiring reasonable notice of the State’s intention to seek enhanced punishment is to provide the defendant with an opportunity to be heard where the State alleges a prior conviction or violation of a statute. The burden of establishing the prior offense rests with the State, and it follows that the underlying purpose of giving a defendant notice is to inform the defendant fully of the State’s case against him in order that he may intelligently conduct his defense. King, 300 Md. at 229, 477 A.2d at 774. The purpose of Rule 4-245(c) embodies this requirement.
Accordingly, we hold that the State’s right of appeal may be maintained, the imposition of probation before judgment was impermissible, and notice to sentence the defendant as a subsequent offender was required pursuant to Md. Rule 4-245(c).
*298JUDGMENT OF THE COURT OF SPECIAL APPEALS VACATED AND CASE REMANDED TO THAT COURT WITH DIRECTIONS TO REMAND CASE TO THE CIRCUIT COURT FOR CARROLL COUNTY FOR RESEN-TENCING. COSTS TO BE DIVIDED EQUALLY.
McAULIFFE, J., concurs in part and dissents in part.