In this case we are called upon to decide whether a trial court is bound to impose a mandatory minimum sentence pursuant to a subsequent offender statute where the defendant is a subsequent offender but there is a plea agreement whereby the State agreed not to treat the conviction as a subsequent offense. For the reasons set forth below, we hold that the decision to pursue a mandatory minimum sentence under a subsequent offender statute is a matter of prosecutorial discretion, and the court is, therefore, not bound to impose a mandatory sentence if the prosecution either does not send, or later withdraws, notice of the defendant’s prior convictions. Additionally, we hold that a court not only may, but should, permit the State to withdraw the subsequent offender notice upon request.
*109I.
A.
Fundamental to an understanding of this case are both Maryland Code (1957, 1996 RepLVol.), Article 27, § 286(c),1 which sets forth a mandatory sentence for subsequent offenders, and Maryland Rule 4-245(c), which requires the State to give a defendant notice of the defendant’s prior convictions where those prior convictions would subject the defendant to a mandatory sentence under a subsequent offender statute. We, therefore, begin our analysis with a discussion of the relevant rule and statutory provision that guide us in this case.
Article 27, § 286(a) prohibits, inter alia, the manufacturing of, distribution of, and possession with intent to manufacture or distribute controlled dangerous substances. Subsections (b)(1) and (b)(2) set forth the penalty for violating subsection (a) with respect to specified Schedule I and II drugs. Subsection (b) provides in pertinent part: “Any person who violates any of the provisions of subsection (a) of this section with respect to: (1) A substance classified in Schedules I or II which is a narcotic drug is guilty of a felony and is subject to imprisonment for not more than 20 years, or a fine of not more than $25,000, or both.” Significant to this case, Art. 27, § 286(c) further provides: “A person who is convicted under subsection (b)(1) or subsection (b)(2) of this section, or of conspiracy to violate subsection (b)(1) or (b)(2) of this section shall be sentenced to imprisonment for not less than 10 years if the person previously has been convicted” of any of these offenses. Art. 27, § 286(c)(1). This sentence, with one very limited exception not applicable in this case, is to be served without parole. Art. 27, § 286(c)(2).
Maryland Rule 4-245 provides for the defendant to be given notice of the defendant’s alleged prior convictions where the defendant is subject to a mandatory penalty or where the defendant is subject to an additional non-mandatory penalty *110which the State’s Attorney intends to pursue. Subsection (c) of Md. Rule 4-245, relevant here because of the mandatory language in Art. 27, § 286(c), reads as follows:
“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.”
Subsection (e) of Md. Rule 4-245 requires the court to make a determination before sentencing the defendant as to whether the defendant is a subsequent offender. The State bears the burden of proving the prior offense beyond a reasonable doubt. Thus, unless the defendant waives this notice requirement, in order for a defendant to receive a mandatory sentence under a subsequent offender provision, the defendant must first receive notice from the State of the alleged prior conviction, and the State must prove beyond a reasonable doubt the factual basis for the enhanced sentence. See Jones v. State, 324 Md. 32, 595 A.2d 463 (1991), where we stated:
“Where the General Assembly has required or permitted enhanced punishment for multiple offenders, the burden is on the State to prove, by competent evidence and beyond a reasonable doubt, the existence of all of the statutory conditions precedent for the imposition of enhanced punishment.”
324 Md. at 37, 595 A.2d at 465.
B.
We next turn to the facts of the case sub judice. Victor Tyrone Beverly was charged with twelve counts of drug-related offenses pursuant to Art. 27, § 286. Beverly had previously been convicted under Art. 27, § 286, which provides that a subsequent offender “shall be sentenced to imprisonment for not less than 10. years” without parole. Art. 27, *111§ 286(c). Beverly was given notice of mandatory penalties as required by Maryland’s subsequent offender rule, Md. Rule 4-245.
On the day of trial, the State, Beverly, and Beverly’s counsel (Mr. Guth) appeared before the trial judge. We glean from the record that a plea agreement apparently had been reached because the discussion began with the State explaining the terms of that agreement, that is, that there would be a recommendation of a sentencing cap of ten years presumably with the possibility of parole. The State, thus, would be withdrawing the subsequent offender notice that required a minimum of ten years imprisonment without parole. In exchange for the State’s sentencing concession, it appears that Beverly was prepared to plead guilty. The State’s Attorney, Ms. Erisman, who had “inherited the case from someone else,” expressed confusion over what the mandatory and other sentencing guidelines called for under the circumstances of Beverly’s case. “[W]ith that uncertainty” in mind, Ms. Erisman indicated that her “recommendation would be a cap of ten years.”2 The judge, however, expressed a belief that the court was not permitted by law to sentence Beverly to anything less than ten years without parole because Beverly was a subsequent offender and had been given the required notice under Maryland Rule 4-245. The following colloquy ensued:
“THE COURT: [T]he court reads the statute to indicate that the court cannot give a less than ten-year sentence.
MS. ERISMAN: If I were to invoke the mandatory.
THE COURT: Is that required?
MS. ERISMAN: Yes. The State must invoke the mandatory.
THE COURT: An invocation of the mandatory? See, it doesn’t say that in the statutes, though.
*112MS. ERISMAN: My understanding, Your Honor, is that the purpose of plea discussions on a pre-trial basis if the State does not invoke the mandatory, then the court is free to give whatever sentence the court deems appropriate in the case.
THE COURT: Where does it say that? Where does that come from? I see, all I’m looking at is ... Article 27, Section 286 subsection (c). A person who is convicted under Section [b](l) or Subsection (b) of this section, [b](2), shall be sentenced to imprisonment for not less than ten years if the person previously has been convicted under Subsection [b](l) or Subsection [b](2) or of conspiracy or of an offense under the laws of another State, that would be a violation of the subsection.
MS, ERISMAN: Your Honor, I believe that the Maryland Rules' might provide us with the enlightenment that the court seeks, and I believe would be an area of Rule 4-245 or within one of those pages.”
The judge then read from the rule, noting that the way she “read Article 27, Section 286, Subsection [c](l), the sentence is mandatory.” The discussion continued:
“I read that as a mandatory sentence. And therefore, that it is governed by ... Subsection [c], requiring that the State’s Attorney serve a notice fifteen days before sentencing. Okay. So, that means that if you serve a notice today, then the court must postpone the sentencing for fifteen days unless Mr. Beverly agrees to waive that requirement. That’s how I read it____
MR. GUTH: Your Honor, it is my understanding that if Mr. Beverly agreed to be sentenced today, the State’s offer of ... a cap of ten years with parole would be available to him. Or rather, that would—actually he would not be given an opportunity then to argue for less.
THE COURT:—he can argue all day for less, but I understand the statute to say I don’t have the authority, that the sentence is absolute; it must be at least ten years.
*113MR. GUTH: You mean if the State decided not to invoke that mandatory penalty, if they withdrew their invocation of that penalty, you know, I—
THE COURT: Well, see, that’s not the way I understand it. If they withdraw their application of that penalty, they can do whatever they want, but the statute tells me I must, that I must give that penalty, that I don’t have any choice. And if the State hasn’t given him notice by this time, unless he waives the notice, then I must postpone. The court shall postpone sentencing at least fifteen days unless the defendant waives the notice requirement. And the court shall impose this sentence if he were found guilty. Now, it doesn’t say I shall give him 20 years, which is, ... I guess, what I could do technically if we’re talking about possession with intent to distribute cocaine, for instance. Then the court can give him twenty times two.
MR. GUTH: But the court—you’re saying the court is bound to give him ten years without parole?
THE COURT: That’s the way I read the statute.”
The State’s Attorney then indicated her belief that it was in fact common practice to enter into plea bargains where the State will agree not to seek a subsequent offender sentence. The court responded: “I wish you would tell me how I’m reading it wrong.” The court then stated that,
“the purpose of [subsection c] is to facilitate the imposition of mandatory sentences prescribed by the Legislature. That is, accomplished not by giving the defendant a vested interest in avoiding mandatory sentences, but rather by permitting the mandatory sentence to occur, but only after insuring that the defendant has received the requisite notice thus allowing him or her to challenge the assertion] that he or she is a subsequent offender.
Now, as I understand the meaning of that, if he or she is a subsequent offender, there’s no challenge. That means the court is required to impose the sentence. The State is required, apparently, to give notice, and in the mandatory *114sentence the State is required to give that notice fifteen days before sentencing.
The court is required to give the mandatory sentence, and the defendant is entitled to an opportunity to show that he wasn’t really convicted before this____ I haven’t read anything that suggested the court has discretion over what to give, what sentence to give, just as the court has no discretion about the minimum for a handgun violation; you either go to jail or you get a fine or both, but you’ve got to get one of them because that’s mandated in the statute.
And that’s how I read it. Not that you don’t have to give the notice, but that you do have to give it, and the court must give, the mandatory sentence, and the mandatory sentence is ten years if, in fact, he has a prior conviction.”
This discussion continued but the judge reiterated that she had no alternative and had to impose the subsequent offender mandatory penalty. Apparently because the judge felt she lacked the authority to impose the sentence contemplated by the plea agreement, Beverly did not enter the guilty plea and, instead, requested a jury trial. On March 27, 1997, the jury returned guilty verdicts on all twelve counts. At that point, the State’s Attorney indicated her intention to seek mandatory penalties. The trial judge sentenced Beverly to a total of fifteen years, ten of those years without parole. At the sentencing hearing, Beverly reiterated his objection to the judge’s prior ruling that the court was bound to impose the mandatory sentence for subsequent offenders even if the State were to withdraw the subsequent offender notice.
The dissent, under a heading perhaps aptly titled “A Manufactured Issue,” categorically states that: “Indeed, there is no basis in this record for even inferring that a plea agreement had been reached.” 349 Md. 106, 134-35, 707 A.2d 91, 105 (1998). The dissent goes on to describe the plea discussions below as “nothing more ... than an academic discussion of whether, in a hypothetical situation, a prosecutor could tie the judge’s hands.” 349 Md. at 136, 707 A.2d at 105. These discussions occurred immediately before Beverly’s scheduled *115trial. It would be naive to believe that, prior to the election of a court or jury trial, the State with the acquiescence of the defendant engaged the judge in an “academic discussion” of the defendant’s prior criminal history. The discussion was not “whether, in a hypothetical situation, the prosecutor could tie the judge’s hands”; it was an explanation to the judge of a plea offer to withdraw the notice of mandatory penalties. It seemed clear to everyone involved in the proceedings and present in the trial court that a plea agreement had been reached at least to the extent that if Beverly would plead guilty the State would not seek any mandatory subsequent offender punishment. Other terms of the agreement were not spelled out because the judge made it clear that regardless of any agreement she could not avoid sentencing Beverly to the mandatory multiple offender penalties.
Beverly knows there was a plea agreement to withdraw the “notice of mandatory penalties” and phrases the single issue in the case as: “When the State offered a plea bargain to [Beverly], did the trial court err in ruling that the State could not withdraw a subsequent offender notice, and even if the State did so, [must] the court ... impose a sentence of ten years imprisonment without parole?” The State agrees with Beverly’s factual recitation of, and also acknowledges, the plea offer when they phrase their issue as: “[Has] Beverly ... waived his right to argue that the trial court erred in refusing to allow the State to withdraw its notice to seek mandatory penalties by abandoning this claim below and by failing to pursue a plea agreement with the State ... ?” Based on this issue as framed by the parties we granted certiorari on our own motion prior to consideration of this case by the Court of Special Appeals. There has been no suggestion from anyone except the dissent that the State did not agree to withdraw the notice of mandatory penalties if Beverly would plead guilty.
In fact, after the trial, the defense attorney reiterated the State’s plea offer and that it was not accepted because the judge indicated she would still sentence under the mandatory *116subsequent offender provision, even if the State tried to withdraw the notice. The defense counsel stated:
“During our discussions, the State had made an offer of ten years with the possibility of parole and when I asked Mr. Beverly are you interested in ten years with the possibility of parole, Mr. Beverly said yes, I am.
When asked, your honor, if you would entertain that plea to the ten years with parole, if you recall your honor looked under the statute and basically indicated that it was not in your hands to impose the ten years with parole based upon the State’s filing of their notice of mandatory penalties.
So at that time you—Mr. Beverly could not take advantage of the plea that the State had offered at that time.
Basically what happened was Mr. Beverly, for lack of any better words, was sort of cornered into going to trial in this case because obviously ten years without parole, if he. was facing that at that time, basically he had no other option. He might as well have rolled the dice and see what happens.”
The State did not disagree with this statement concerning the plea offer. The trial judge also acknowledged there was a plea offer which she, perhaps erroneously, had rejected because the attorneys cited no authority for withdrawing the subsequent offender notice; she stated, “the offer to Mr. Beverly may have been continued if I had a little help [in researching whether a notice of mandatory sentence could be withdrawn].”
Beverly appealed to the Court of Special Appeals, claiming the trial court erred in ruling that the court was legally obligated to impose the mandatory sentence under Art. 27, § 286(c) and that the State could not withdraw the subsequent offender notice. We granted certiorari before review by the Court of Special Appeals to address the important issues involved in the resolution of this matter.
We now turn, as a preliminary matter, to the State’s argument that this Court should refuse to address Beverly’s claims. We will then explain why the State not only may plea *117bargain away a mandatory sentence where there has been no notice of intention to seek a mandatory sentence, but may also choose to withdraw the notice once it has already been given.
II.
As a preliminary matter we reject the State’s argument that this Court should refuse to answer the questions raised by Beverly’s claims because Beverly acquiesced to the trial judge’s interpretation of the law and further because Beverly subsequently failed to pursue a guilty plea with the State. The State cites Watkins v. State, 328 Md. 95, 613 A.2d 379 (1992), for the proposition that there is no basis for appeal where a party acquiesces to the court’s ruling. In Watkins, we refused to address the defendant’s contention that the trial judge erred in not allowing the defense to present evidence of a pending case against one of the witnesses. 328 Md. at 99-100, 613 A.2d at 381. There, defense counsel asked if he could present the evidence, the State responded, the court said “Alright,” and defense counsel merely said “Thank you.” Id. We ruled that this was acquiescence and, therefore, “there [was] no basis for appeal.” Watkins, 328 Md. at 100, 613 A.2d at 381.
Here, the State argues that the following interchange demonstrates that Beverly’s counsel similarly abandoned Beverly’s claims:
“THE COURT: [B]ut tell me how I’m wrong. I mean, I’m eager to hear your point of view, but this is what I read and the only way I’ve read it. So, tell me what I read wrong.
[BEVERLY’S COUNSEL]: Its sound right to me, Your Honor, and I have no argument as to that.”
But there was much more to that interchange. Unlike in the brief interchange in Watkins, the above discussion appears in the transcript after eleven pages of discussion of the same issue. Moreover, following that discussion, Mr. Guth, Beverly’s attorney, continued, “I just think that this defendant *118coming into this court is ... not being given the opportunities that other individuals are given in other courts just by way of allowing him to not have the ten years without parole invoked upon them if they did wish to enter into a plea agreement. So my argument is that ... he is not being given the benefit of what other individuals are given in other courts.” The court then responded:
“Okay. I don’t know anything about that. I can’t tell you the last time I’ve been in anybody else’s court---- I don’t know what other people are doing. All I know is that’s the way I read the law. If it’s dead wrong, just show me how I’m wrong. Otherwise, this is my decision. I mean, as far as I can see this is what the Legislature says you’ve got to get. It’s like use of a handgun. You know, I can give you all the sentences I want to give, but five of it has to be without parole. I can give you only five, but it’s without parole because that’s what I understand is a mandatory sentence.
Okay. Now, if you’re going to reduce it to simply wearing, carrying, transporting, that’s something else, and I don’t ever tell the State what to call because that’s the State’s discretion and the State’s call. But once the State calls the count, then I have to live with the count, and I have to give what I believe the ... law requires.” (Emphasis added).
While defense counsel is expected to argue vigorously for his client, the client also has an interest in defense counsel showing polite deference to the judge who will hear the trial. Here, it appears that once Beverly’s attorney realized that the court was not going to change its mind, defense counsel, having vigorously argued the matter, politely continued on with the matter of the day. To deem Beverly’s behavior acquiescence would be to ignore the reality of what goes on at the trial level.
This Court is also not persuaded that Beverly’s subsequent election not to proceed with a guilty plea constituted a waiver of the issue. We believe that the statements made by *119the judge definitively indicated the court’s belief that it could not sentence Beverly to less than ten years without parole. Defendant was thus presented with a situation where he knew that any plea negotiation that he might enter would result in a minimum of a ten-year sentence without parole. Thus, if there was in fact a plea agreement in which the State was to recommend a ten-year cap, Beverly was in essence “cornered” into a not guilty plea. We do not believe that the defendant, having been told that the court could not legally follow the plea agreement, should be required to plead guilty in order to challenge the trial judge’s legal conclusion, knowing that the court would not follow the plea agreement.
The State cites the Supreme Court’s decision in Luce v. United States, 469 U.S. 38, 105 S.Ct. 460, 83 L.Ed.2d 443 (1984), and our decision in Jordan v. State, 323 Md. 151, 591 A.2d 875 (1991), to support the State’s claim that the issue was not preserved because ultimately Beverly chose not to plead guilty. In Luce, the Supreme Court held “that to raise and preserve for review the claim of improper impeachment with a prior conviction, a defendant must testify.” 469 U.S. at 43, 105 S.Ct. at 464, 83 L.Ed.2d at 448. In that case, the trial judge denied the defendant’s motion in limine “to forbid the use of a prior conviction to impeach his credibility.” Luce, 469 U.S. at 39, 105 S.Ct. at 462, 83 L.Ed.2d at 446. At trial, the defendant neither testified nor proffered that he would testify and what his testimony would include. Id. The trial judge specifically noted that the admissibility of the prior conviction depended on the content of the defendant’s testimony. Luce, 469 U.S. at 39-40, 105 S.Ct. at 462, 83 L.Ed.2d at 446. For example, if the defendant were to testify that he had no “prior involvement with drugs,” the defendant could be impeached by his prior conviction. Luce, 469 U.S. at 40,105 S.Ct. at 462, 83 L.Ed.2d at 446-47. In refusing to substantively address the issue, the Supreme Court stated that any harm the defendant may have suffered was “wholly speculative.” Luce, 469 U.S. at 41, 105 S.Ct. at 463, 83 L.Ed.2d at 447. This, the Court noted, is particularly true with evidentiary matters, especially impeachment, because such rulings are “subject to change *120when the case unfolds.” Id. The Luce Court also noted that “[b]ecause an accused’s decision whether to testify ‘seldom turns on the resolution of one factor,’ a reviewing court cannot assume that the adverse ruling motivated a defendant’s decision not to testify.” Luce, 469 U.S. at 42, 105 S.Ct. at 463, 83 L.Ed.2d at 448 (citation omitted).
This Court followed Luce in Jordan. The issue in Jordan was “whether a trial court’s ruling that the defendant’s prior statement was voluntary [was] preserved for appeal if the defendant fails to testify on his own behalf and proffers to the court that, but for its ruling, he would have exercised his right to testify.” Jordan, 323 Md. at 155, 591 A.2d at 877. In holding that the issue of the voluntariness of his statement was not preserved, we noted that, when the admission of evidence is at issue, “[i]n order to properly weigh probative value against prejudicial effect, a reviewing court ‘must know the precise nature of the defendant’s testimony, which is unknowable when ... the defendant does not testify.’ ” Jordan, 323 Md. at 158, 591 A.2d at 878 (quoting in part Luce, 469 U.S. at 41, 105 S.Ct. at 463, 83 L.Ed.2d at 447). Moreover, as the Supreme Court had in Luce, supra,we found that the injury was “remote and speculative.” Jordan, 323 Md. at 156, 591 A.2d at 877.
Unlike in Jordan and Luce where the admission of evidence was at issue, the harm in the case sub judice is not so speculative. We, in fact, have evidence in the record that the State was prepared to offer a cap of ten years and, had Beverly accepted a plea to a cap of ten years, the court should have had at its option the ability to sentence the defendant to less than ten years without parole. It is also clear from the record that the trial judge believed that, if the defendant pled guilty, the court was obligated to sentence the defendant to at least ten years without the possibility of parole. We also know that Beverly was ultimately convicted on all twelve counts, the State then chose to invoke the mandatory subsequent offender rule, and Beverly received a fifteen-year sentence, ten years of which was to be served without parole. Moreover, the judge’s ruling was a matter of law and not *121subject to change as “the case unfolds.” Finally, unlike in Luce, it is likely here that Beverly’s decision to plead not guilty was solely based on the trial court’s legal determination that, if Beverly pled guilty, the court could not sentence Beverly in accord with the plea agreement. In other words, the court had asserted that it could not go along with the plea agreement because the bargain was unlawful. Beverly asks this Court to enforce the plea bargain reached with the State, claiming that it was rejected by the trial judge solely because of the court’s mistake of law. We, thus, believe Beverly’s claim was properly preserved for appeal. Had the court refused to allow the plea bargain because the judge felt it was too lenient, that would be a different case. Here, however, the sole reason for refusing to follow the plea agreement was the trial judge’s erroneous belief that the agreement required her to impose an unlawful sentence.
III.
A.
We turn now to Beverly’s assertion that the trial court erred in ruling that, if Beverly were to plead guilty, it would be bound to impose the sentence of ten years without parole mandated by the subsequent offender provisions of Art. 27, § 286 notwithstanding any possible plea agreement between the State and Beverly, whereby the State promised to withdraw the subsequent offender notice and recommend a sentence less than this subsequent offender statutory minimum.
It is well-settled that the determination of which criminal charges, if any, to bring is a matter of prosecutorial discretion. See, e.g., Md.Code (1957, 1996 Repl.Vol.), Art. 10, § 34 (directing the State’s Attorney to “prosecute and defend, on the part of the State, all cases in which the State may be interested”); Ewell v. State, 207 Md. 288, 296, 114 A.2d 66, 71 (1955)(“The state’s attorney is given broad discretion as to the cases he will prosecute.”); Brack v. Wells, 184 Md. 86, 90, 40 A.2d 319, 321 (1944)(“[Prosecutor] must be trusted with broad official discretion to institute and prosecute criminal causes, *122subject generally to judicial control. The office is one not purely ministerial, but involves the exercise of learning and discretion. As a general rule, whether the State’s Attorney does or does not institute a particular prosecution is a matter which rests in his discretion.” (Citations omitted)).
Courts have long recognized the benefits of plea bargaining and the role played in the plea bargaining process by prosecutorial discretion with respect to charging. See, e.g., State v. Brockman, 277 Md. 687, 692-93, 357 A.2d 376, 380-81 (1976)(observing that plea bargains were not new and, in fact, seem “to have originated in seventeenth century England”). Plea bargaining plays an essential role in our system of justice both at the state and national levels. See, - e.g., Santobello v. New York, 404 U.S. 257, 260, 92 S.Ct. 495, 498, 30 L.Ed.2d 427, 432 (1971); Loveday v. State, 296 Md. 226, 235, 462 A.2d 58, 62 (1983); Brockman, 277 Md. at 692, 357 A.2d at 380. “[P]lea agreements account for the disposition of an overwhelming percentage of all criminal cases.” Brockman, 277 Md. at 693, 357 A.2d at 380; accord Brady v. United States, 397 U.S. 742, 752 m 10, 90 S.Ct. 1463, 1471 n. 10, 25 L.Ed.2d 747, 758 n. 10 (1970)(“It has been estimated that about 90%, and perhaps 95%, of all criminal convictions are by pleas of guilty; between 70% and 85% of all felony convictions are estimated to be by guilty plea.”). Thus, plea agreements serve to prevent overcrowding in the courts. See, e.g., Santobello, 404 U.S. at 260, 92 S.Ct. at 498, 30 L.Ed.2d at 432; Brockman, 277 Md. at 693, 357 A.2d at 380.
Moreover, as the Supreme Court of United States noted in Santobello:
“Disposition of charges after plea discussions is not only an essential part of the process but a highly desirable part for many reasons. It leads to prompt and largely final disposition of most criminal cases; it avoids much of the corrosive impact of enforced idleness during pre-trial confinement for those who are denied release pending trial; it protects the public from those accused persons who are prone to continue criminal conduct even while on pretrial *123release; and, by shortening the time between charge and disposition, it enhances whatever may be the rehabilitative prospects of the guilty when they are ultimately imprisoned.”
404 U.S. at 261, 92 S.Ct. at 498, 30 L.Ed.2d at 432. Plea agreements also advance law enforcement efforts by eliminating “many of the risks, uncertainties and practical burdens of trial, permitting] the judiciary and prosecution to concentrate their resources on those cases in which they are most needed.” Brockman, 277 Md. at 693, 357 A.2d at 381. We, therefore, conclude, as we did in Brockman, that “plea bargains, when properly utilized, aid the administration of justice and, within reason, should be encouraged.” Id.
We also note that the Maryland Rules expressly permit plea agreements. Md. Rule 4-243. A plea agreement may be entered between the State and a defendant on “any proper condition, including: (1) That the State’s Attorney will amend the charging document to charge a specified offense or add a specified offense, or will file a new charging document ... [and] (5) That the State’s Attorney will recommend, not oppose, or make no comment to the court with respect to a particular sentence, disposition, or other judicial action.” Md. Rule 4-243.
B.
Having recognized the importance of plea bargaining and that the State may plea bargain based on “any proper condition,” we must analyze Art. 27, § 286 and Md. Rule 4-245 to determine whether bargaining away subsequent offender notice and proof, and thus the mandatory penalties associated with the defendant’s status as a subsequent offender, constitutes a permissible condition for a plea agreement.
Article 27, § 286 is the subsequent offender statute at issue in this case. As discussed above, Art. 27, § 286 calls for a mandatory sentence of ten years without parole for a person who is convicted under certain subsections of Art. 27, § 286 where that person was previously convicted of any of the *124offenses in those subsections of Art. 27, § 286. In order for a defendant to be sentenced as a subsequent offender, the State must give the defendant notice of the prior conviction and, at sentencing, “the burden is on the State to prove, by competent evidence and beyond a reasonable doubt, the existence of all of the statutory conditions precedent for the imposition of the enhanced punishment. Jones, 324 Md. at 37, 595 A.2d at 465. Maryland Rule 4-245(c), which plays a key role here, provides that:
“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.”
We have said: “Whenever the statutory requirements are met and the requisite notice given, a trial court must impose the sentence prescribed in the mandatory sentencing statute; it has no discretion to do otherwise.” State v. Montgomery, 334 Md. 20, 21 n. 1, 637 A.2d 1193 n. 1 (1994)(citing with approval State v. Taylor, 329 Md. 671, 675, 621 A.2d 424, 426 (1993)); Loveday, 296 Md. at 236-37, 462 A.2d at 63. The burden, however, to prove the existence of prior convictions, as with any other aggravating factor, rests with the State to prove beyond a reasonable doubt. Jones, 324 Md. at 37, 595 A.2d at 465 (“Where the General Assembly has required or permitted enhanced punishment for multiple offenders, the burden is on the State to prove, by competent evidence and beyond a reasonable doubt, the existence of all of the statutory conditions precedent for the imposition of enhanced punishment.”); Ford v. State, 73 Md.App. 391, 400-02, 534 A.2d 992, 996-97 (1988); see also Wadlow v. State, 335 Md. 122,132, 642 A.2d 213, 218 (1994)(hoIding that in order for defendant to be sentenced to enhanced penalty under Art. 27, § 286(f), which calls for a specified amount of drugs to have been involved in a violation of § 286(a)(1), the State must prove “the necessary *125fact concerning the amount ... beyond a reasonable doubt”). Where, on the other hand, the State does not meet this burden, the trial judge may not enhance the defendant’s sentence.
Maryland Rule 4-245 was promulgated by this Court to give the defendant the opportunity to make a realistic assessment of the consequences of pleading not guilty and to give the defendant an opportunity to challenge the assertion that the defendant is a subsequent offender, see Montgomery, 334 Md. at 29, 637 A.2d at 1197, and not to remove prosecutorial discretion in plea bargaining. In fact, an examination of the history of Rule 4-245 reveals that the rules committee considered the possibility of removing prosecutorial discretion to present evidence of a defendant’s subsequent offender status; yet, the final version did not do this. In a memorandum discussing proposed changes to the Criminal Rules of Procedure, then-Chairman of the Criminal Rules Subcommittee, Robert J. Ryan, explained the addition of subsection (c) to Rule 4-245:3 *126Robert J. Ryan, Memorandum to Rules Committee Members, Title TV— Consolidated District Court—Circuit Court Rules of Procedure, at 10 (June 2, 1982). Thus, Rule 4-245 did not remove prosecutorial discretion to plea bargain away a mandatory minimum subsequent offender sentence. We believe, therefore, that the prosecutor may validly choose not to meet the statutory conditions by not giving notice and by not presenting evidence sufficient to prove beyond a reasonable doubt that a defendant has a prior conviction. Prosecutors have been plea bargaining to withdraw notices of mandatory penalties for over a decade, at least since the Court of Special Appeals decided Middleton v. State, 67 Md.App. 159, 506 A.2d 1191 (1986), overruled on other grounds by Fairbanks v. State, 331 Md. 482, 629 A.2d 63 (1993). In that case the Court of Special Appeals held that a prosecutor may withdraw a notice of mandatory penalties. Judge Bell (now Chief Judge of this Court), writing for the Court of Special Appeals, stated:
*125“When this rule was drafted, it was the intent to prevent an inadvertent waiver from preventing the imposition of a mandatory penalty for a subsequent offender.
A Legislative committee studied the impact of this rule during the last legislative session. The study was aimed at the situation in which the State’s Attorney withholds the required notice of the subsequent offender status as part of the plea bargaining agreement. Proposed legislation would have required the judge to impose a mandatory penalty based upon information in a pre-sentence report or any other source, without regard to the State’s Attorney’s notice obligations. We do not believe that that legislation came out of committee. This rule does not attempt to correct any State’s Attorney’s abuses which may exist in this area.” (Emphasis added).
*126“At the outset, it is important to understand the nature of the decision to pursue a mandatory sentence. We think it is part of the prosecutorial function, rather than a sentencing function. It is true that the decision has significant, and perhaps paramount, implications as to sentencing since the judge has no discretion as to the sentence once the prosecutor has initiated the process, See Md. Rule 4-245, and the statutory predicate has been proven. But, it is incumbent upon the prosecutor to prove the predicate and only then do the sentencing implications, previously only a possibility, become a reality. Moreover, notwithstanding his or her lack of discretion in that regard, the judge, not the prosecutor, must impose the sentence that the legislature prescribed.” (Emphasis in original).
Middleton, 67 Md.App. at 169, 506 A.2d at 1196.
We also believe that it is proper for the prosecutor to use this discretion as a tool in the plea bargaining process. Furthermore, we see no reason that the filing of notice as required in Rule 4-245 should extinguish prosecutorial discretion in deciding whether to pursue enhanced penalties under a subsequent offender statute. Therefore, we hold today that *127the prosecutor may choose not to give notice or may choose to withdraw the notice once it is given.
Our holding today, however, is limited to circumstances in which the mandatory penalty is under a subsequent offender statute where the State has the obligation to supply notice and proof of subsequent offender status and is not necessarily applicable where the enhanced sentence is due to the nature of the circumstances of the offense itself. Cf. Wadlow, 335 Md. at 128-29, 642 A.2d at 216 (“[W]e have generally drawn a distinction between sentence enhancement provisions that depend upon prior conduct of the offender and those that depend upon the circumstances of the offense.”).
We believe the circumstances of this case require us to remand for a new sentencing because the trial judge failed to recognize that the State should be permitted to withdraw the subsequent offender notice and that she had the discretion to sentence in accord with the plea agreement. “When a court must exercise discretion, failure to do so is error, and ordinarily requires reversal.” Maus v. State, 311 Md. 85, 108, 532 A.2d 1066, 1077-78 (1987)(citing with approval Colter v. State, 297 Md. 423, 427-31, 466 A.2d 1286, 1289-90 (1983)). Rather than being an exercise of judicial discretion, the judge’s decision to reject the plea agreement was a determination that the judge was not permitted to exercise discretion and thus was reversible error.
Although a trial judge may reject a sentencing agreement offered by the State and agreed to by the defendant, the trial judge has no discretion to reject a charge agreement where the State agrees to withdraw or reduce charges. If the State agrees that, in return for a plea of guilty, it will reduce the charges and, thus, bind the trial judge to no more than the statutory maximum for the reduced charges, the judge cannot refuse to accept the charge bargain since the State has absolute discretion to reduce charges. Agreeing to withdraw a notice of mandatory penalties is a form of charge bargaining. The trial court erred in refusing to allow the prosecutor to withdraw the subsequent offender notice served on Beverly *128and in determining that it was bound to sentence the defendant to the mandatory minimum under Art. 27, § 286(c). This error of law may have had a crucial impact on Beverly’s decision not to proceed with a guilty plea and, instead, to proceed to trial. Beverly still seeks the enforcement of his charge bargain with the State which was improperly rejected by the trial judge. The record, however, is unclear as to the terms of the plea agreement, if any, reached before the trial court other than that, if Beverly pleads guilty, the State would withdraw the notice of mandatory penalties. If there was a plea agreement from which Beverly was forced to withdraw because of an error of law, then Beverly should be able to receive the benefits of that bargain. It is clear that Beverly was agreeing to a verdict of guilty, albeit through a guilty plea.
It is perhaps noteworthy that everyone involved in this litigation, except the dissent, is in full agreement that the State has a right to either not send a notice of mandatory penalties or withdraw a notice of mandatory penalties. Throughout these proceedings the State has consistently reaffirmed that it agrees with the defense that the State has discretion not to send notice of mandatory penalties or to withdraw any notice of mandatory penalties. At the sentencing hearing, the trial judge indicated she had probably erred but her mistake was due to the failure of the parties to provide her with authority for their joint position that the State could withdraw its notice of mandatory penalties. The judge stated:
“Because my recollection is that I read the statute saying that the court was required to impose this mandatory sentence based upon a past record and that meant that there was an assumption that the State was required to file the appropriate papers.
My thinking about it afterwards was there was one problem and that problem was whether the court or anyone else could take away the discretion of the prosecutor, that is, of the State’s Attorney, because to require a mandatory sentence in that circumstance would be to take from the *129State’s Attorney his or her discretion to seek the mandatory penalty.
So based on that, I decided to rethink it and leave that in the hands of the State’s Attorney.
But my recollection of the colloquy between me and the lawyers was give me some case law, give me something that swayed me of your point of view. I don’t remember having a closed mind on it. I remember saying help me out here and nobody helped me out until, I helped out myself.
Nonetheless, the offer to Mr. Beverly may have been continued if I had a little help. I mean, I don’t mind doing my own work, but what I do all day the rest of the time is sit in court. So it took me a little while, just a matter of a couple of days, and I finally [discussed the issue with another judge]. But our conversation made me decide that I had no right to take away the discretion, the prosecutorial discretion of the State’s Attorney.” (Emphasis added).
The trial judge apparently believed she could not, or would not, correct her mistake at that stage of the proceedings.
We, therefore, affirm Beverly’s convictions, vacate the sentence, and remand for a new sentencing hearing so that Beverly may establish that there was a charge reduction agreement, as well as the terms of that agreement and whether the court’s erroneous pronouncement that it was bound to impose the mandatory minimum sentence for subsequent offenders prevented Beverly from pleading guilty and forced him to proceed with a trial. If, on remand, the trial judge finds that there was a plea agreement that did not require a plea of guilty to all of the charges, the trial judge may at that time vacate those convictions the State would not have prosecuted under the plea agreement. At the sentencing hearing, the State should abide by any agreement to withdraw the notice of mandatory penalties and the judge should resentence accordingly.
JUDGMENT OF THE CIRCUIT COURT FOR BALTIMORE CITY AFFIRMED, EXCEPTAS TO THE IMPOSITION OF SENTENCES. SENTENCES VACATED AND *130 CASE REMANDED TO THAT COURT FOR FURTHER PROCEEDINGS CONSISTENT WITH THIS OPINION. COSTS IN THIS COURT TO BE PAID BY THE MAYOR AND CITY COUNCIL OF BALTIMORE.
WILNER, J., dissents with an opinion in which RAKER and KARWACKI, JJ, join.
. Unless otherwise provided, all statutory references are to Maryland Code (1957, 1996 Repl.Vol.), Article 27, § 286.
. In fact, Ms. Erisman indicated that "even if [the guidelines for Beverly] came back twelve to twenty, I would still be offering him a cap of ten years.”
. The memorandum actually refers to “Rule 4-405," the original number assigned to current Rule 4-245. The language referred to is clearly the same as the last sentence of Rule 4-245(c).