
919 A.2d 652 (2007)
397 Md. 661
Fausto Ediburto SOLORZANO a/k/a Fausto Ediburto Solarzano
v.
STATE of Maryland.
No. 93, Sept. Term, 2006.
Court of Appeals of Maryland.
March 19, 2007.
*653 John Christopher Belcher, Oxon Hill, for appellant.
Robert Taylor, Jr., Asst. Atty. Gen. (J. Joseph Curran, Jr., Atty. Gen., on brief), for appellee.
Argued before BELL, C.J., RAKER, CATHELL, HARRELL, BATTAGLIA, GREENE and ALAN M. WILNER (Retired, specially assigned), JJ.
RAKER, J.
The issue in this case is whether the Circuit Court imposed an illegal sentence because the sentence was not in accord with the plea agreement. Fausto Ediburto Solorzano, appellant, appeals from the Circuit Court's denial of a motion to correct an illegal sentence for attempted first *654 degree murder on the grounds that the sentence did not conform to the plea agreement. We shall hold that the Circuit Court for Prince George's County imposed an illegal sentence because the sentence exceeded the terms of appellant's plea agreement.

I.
Appellant was indicted by the Grand Jury for Prince George's County for attempted first degree murder, first degree assault, second degree assault, and two counts of carrying a dangerous weapon with the intent to injure an individual in an unlawful manner. He reached a plea agreement with the State in which he agreed to plead guilty to attempted first degree murder. In exchange, the State agreed to dismiss the remaining counts of the indictment and to recommend to the trial court that the sentence not be greater than the upper limit of the recommended range established by the Maryland Sentencing Guidelines. It is the terms of the agreement which are at issue in this appeal.
The plea proceeding took place before the Circuit Court for Prince George's County. The State explained the terms of the plea agreement to the trial court as follows:
"Again, Your Honor, now that the defendant is present in the courtroom, State's understanding is the defendant is going to enter a plea to Count One, attempted murder. Free to allocute. The State will bind itself to the top of the guidelines, which is believed to be twelve to twenty years."
The court informed appellant that he was waiving his right to a jury trial, his right to challenge the form of the indictment, the admissibility of evidence, and the automatic right to appeal by pleading guilty. The State provided a factual basis upon which to accept the plea, followed by a colloquy between the court and appellant:
"THE COURT: You've heard the negotiations between the State's Attorney and your attorney, and that is that you enter a plea of guilty to Count One in this case, which is attempted murder, that we are going to order a pre-sentence investigation to determine your background and any history of criminal involvements or convictions, that at the time of sentencing both sides are free to allocute for what they believe may be an appropriate sentence on your behalf, that the State has agreed to cap its recommendation to what we call the top of the guidelines.
Do you know what the sentencing guidelines are, sir?
[APPELLANT]: Yes.
THE COURT: Okay. And you understand that the State and your attorney believe that those guidelines are somewhere between twelve and twenty years, but we're not sure, which is why we're ordering a pre-sentence investigation. But if it turns out to be twelve to twenty years, the State is free to ask for up to twenty years, and you could receive up to twenty years.

Do you understand that, sir?
[APPELLANT]: Yes.
THE COURT: If your sentencing guidelines come back to be greater than either what the State's Attorney or your attorney anticipated and the top of the guidelines would be higher, you could, in fact, receive a greater sentence than twenty years.
Do you understand that, sir?
[APPELLANT]: Yes.
THE COURT: Okay. Do you still wish to enter a plea of guilty in this matter?
[APPELLANT]: Yes.
* * *

*655 THE COURT: The Court finds that the State has provided an adequate factual basis for me to accept Mr. Solorzano's plea of guilty to attempted murder, and I find that his plea of guilty is freely, voluntarily and understandingly made. Accept his plea and in fact find him guilty of one count of attempted murder."
The court ordered a pre-sentence report and the sentencing guidelines indicated in the report were twelve to twenty years incarceration. At sentencing, the court engaged in the following dialogue:
"THE COURT: You recall the negotiations about your plea of guilty with the State and [your former defense counsel].[[1]]
[APPELLANT]: Yes, sir.
THE COURT: And those were that the State was free to allocute for up to twenty years in jail if you had no prior record of convictions; do you recall that?
[APPELLANT]: Yes, sir.
THE COURT: And you recall, however, that the State was not bound to that agreement?
[APPELLANT]: Yes, sir.
THE COURT: And you understand, therefore, that you could receive up to lifea term of life imprisonment?
[APPELLANT]: Yes, sir.
THE COURT: You were aware of that on the last occasion as well, sir?
[APPELLANT]: No, sir.
THE COURT: You were not?
[DEFENSE COUNSEL]: I was not aware of that. What he explained to me, Your Honor, he thought there was an agreement, and I saw what was in the file where there was an offer, I think, and there was nothing in there that indicated the completed agreement. He understood that there was an agreement that the parties would allocute within the sentencing range between twelve and twenty years, he thought there was an agreement the State would not ask for more than twenty.
[THE STATE]: I believe you said the State was not bound to it, when I think you meant the Court wasn't bound to it. The State has agreed to cap at twenty years, which is what the agreement was.
THE COURT: I didn't know if you were aware, [defense counsel], because of being new counsel, so I just wanted to make sure that everything was clear. The State has agreed not to recommend more than twenty years in this case but the Court is not bound to that recommendation and could in fact sentence up to life in prison. You are aware of that?
[DEFENSE COUNSEL]: Yes.
THE COURT: And you are aware of that, sir, as well?
[APPELLANT]: Yes, sir.
THE COURT: Okay. We can proceed. Thank you."
The court sentenced appellant to life imprisonment, with all but fifty years suspended. Appellant filed a timely motion to correct an illegal sentence, seeking specific performance of the plea agreement, and a motion to vacate his guilty plea. The court denied both motions. Appellant noted an appeal to the Court of Special Appeals. We granted certiorari on our own initiative prior to decision by that court. Solorzano v. State, 396 Md. 11, 912 A.2d 647 (2006).

II.
Before this Court, appellant argues that the sentence imposed by the trial *656 court was an illegal sentence because it was not in accordance with the terms of his plea agreement. The State argues that the sentence conformed to the plea agreement and was a legal sentence because the court did not bind itself to a sentence of twelve to twenty years incarceration at the plea proceeding.
In Santobello v. New York, 404 U.S. 257, 92 S.Ct. 495, 30 L.Ed.2d 427 (1971), the Supreme Court noted two options available to a defendant who has not received the benefit of a plea bargain. The defendant can either (1) have the bargain specifically enforced, or (2) withdraw his plea of guilty. Id. at 263, 92 S.Ct. at 499. Since Santobello, the rule is that "when a plea rests in any significant degree on a promise or agreement of the prosecutor, so that it can be said to be part of the inducement or consideration, such promise must be fulfilled." Id. at 262, 92 S.Ct. at 499. This principle is based upon the Due Process Clause and the recognition that, to be valid, a guilty plea must be knowing, voluntary, and intelligent. Mabry v. Johnson, 467 U.S. 504, 508-09, 104 S.Ct. 2543, 2546-47, 81 L.Ed.2d 437 (1984); Boykin v. Alabama, 395 U.S. 238, 242, 89 S.Ct. 1709, 1711-12, 23 L.Ed.2d 274 (1969). See also Metheny v. State, 359 Md. 576, 601, 755 A.2d 1088, 1102 (2000); Miller v. State, 272 Md. 249, 255, 322 A.2d 527, 530 (1974). Thus, when either the prosecution breaches its promise with respect to a plea agreement, or the court breaches a plea agreement that it agreed to abide by, the defendant is entitled to relief. Mabry, 467 U.S. at 509, 104 S.Ct. at 2547; Miller, 272 Md. at 255, 322 A.2d at 530. Since Santobello, we have held that where the plea agreement is breached, and it was not caused by the defendant, the general remedy for the breach is to permit the defendant to choose either specific performance or withdrawal of the plea. Tweedy v. State, 380 Md. 475, 488, 845 A.2d 1215, 1222 (2004); Jackson v. State, 358 Md. 259, 278, 747 A.2d 1199, 1209 (2000); Miller, 272 Md. at 255, 322 A.2d at 530.
Whether a trial court has violated the terms of a plea agreement is a question of law which we review de novo. Tweedy, 380 Md. at 482, 845 A.2d at 1219. We construe the terms of a plea agreement according to the reasonable understanding of the defendant when he pled guilty. Id. See also United States v. Scott, 469 F.3d 1335, 1338 (10th Cir.2006); United States v. Farias, 469 F.3d 393, 397 n. 4 (5th Cir.2006); United States v. Williams, 444 F.3d 1286, 1305 (11th Cir.2006); United States v. Cimino, 381 F.3d 124, 127 (2d Cir.2004); United States v. Andis, 333 F.3d 886, 890 (8th Cir.2003); State v. Bethel, 110 Ohio St.3d 416, 854 N.E.2d 150, 167 (2006); State v. Bisson, 156 Wash.2d 507, 130 P.3d 820, 830 (2006). Because plea bargains are similar to contracts, "contract principles should generally guide the determination of the proper remedy of a broken plea agreement." State v. Parker, 334 Md. 576, 604, 640 A.2d 1104, 1118 (1994). Contract principles alone, however, are not enough to resolve disputes over the proper interpretation of a plea bargain. See Jackson, 358 Md. at 275, 747 A.2d at 1207. Due process concerns for fairness and the adequacy of procedural safeguards guide any interpretation of a court approved plea agreement. See Santobello, 404 U.S. at 261-62, 92 S.Ct. at 498-99.
The trial court may accept a guilty plea only after it determines, upon an examination of the defendant on the record in open court, that (1) the defendant is pleading voluntarily, with an understanding of the nature of the charge and the consequences of the plea, and (2) that there is a factual basis for the plea. Rule 4-242(c). Rule 4-243 sets forth the procedures to be followed when the State and a defendant *657 have entered into a plea agreement. The Rule states, in pertinent part, as follows:
"(c) Agreements of sentence, disposition, or other judicial action.
(1) Presentation to the court. If a plea agreement has been reached pursuant to subsection (a)(1)(F) of this Rule for a plea of guilty or nolo contendere which contemplates a particular sentence, disposition, or other judicial action, the defense counsel and the State's Attorney shall advise the judge of the terms of the agreement when the defendant pleads. The judge may then accept or reject the plea and, if accepted, may approve the agreement or defer decision as to its approval or rejection until after such pre-sentence proceedings and investigation as the judge directs.
(2) Not binding on the court. The agreement of the State's Attorney relating to a particular sentence, disposition, or other judicial action is not binding on the court unless the judge to whom the agreement is presented approves it.
(3) Approval of plea agreement. If the plea agreement is approved, the judge shall embody in the judgment the agreed sentence, disposition, or other judicial action encompassed in the agreement or, with the consent of the parties, a disposition more favorable to the defendant than that provided for in the agreement."
Rule 4-243(c).
Rule 4-243(c)(1) makes clear that a trial court is under no obligation to accept any particular sentence agreed upon by the State and a defendant. Rule 4-243(c)(3), however, makes equally clear that if the trial judge "approves" a plea agreement, the trial court is required to fulfill the terms of that agreement if the defendant pled guilty in reliance on the court's acceptance. See also Santobello, 404 U.S. at 262, 92 S.Ct. at 499. To be sure, the implementation of the prosecutor's and the defendant's expectations, as a result of their agreement, depends upon the approval of the trial court. Neither party could, or should, contemplate any benefit from the bargain unless the trial judge approves and agrees to the conditions and accepts the guilty plea.
In this case, it is the terms of the agreement which are at issue. We must determine whether the trial court, in accepting appellant's guilty plea, agreed to impose no more than a term of incarceration of twelve to twenty years, if that term was within the range of the sentencing guidelines. If the court agreed to impose the sentence agreed upon by appellant and the State, the trial judge was bound to impose a sentence no greater than twenty years. See Tweedy, 380 Md. at 485, 845 A.2d at 1221 (stating that once a plea bargain is accepted, a court is "required to impose the agreed upon sentence, assuming that all the conditions imposed upon the defendant were fulfilled"); State v. Poole, 321 Md. 482, 497, 583 A.2d 265, 272 (1991) (holding that once a court accepts a guilty plea, it is bound by the provisions contained in the plea agreement). If, in the alternative, the court did not agree to impose a particular sentence, it acted within its discretion to impose a term of life, all but fifty years suspended. We hold that the trial court accepted the terms of the plea agreement, that appellant pled guilty in reliance of the court's acceptance, and that as such, he is entitled to specific performance of the terms of that agreement.
Prior to appellant entering his guilty plea, the trial court made statements which, at a minimum, created an impression that it had accepted the sentencing range agreed upon by the State and appellant. The court told appellant as follows:

*658 "If your sentencing guidelines come back to be greater than either what the State's Attorney or your attorney anticipated and the top of the guidelines would be higher, you could, in fact, receive a greater sentence than twenty years."
Although the trial court indicated that it could sentence appellant to a term of incarceration greater than twenty years if the sentencing guidelines were greater than the recommendation, the court never indicated that if the agreement was within the guidelines that the sentence could be greater. The court, at one point, specifically informed appellant that if the sentencing guidelines recommended "twelve to twenty years, the State is free to ask for up to twenty years, and you could receive up to twenty years." The obvious interpretation of the judge's remarks is that if the guidelines were greater than twenty years, then and only then, the defendant could receive a greater sentence. It would be reasonable for a layperson to believe, from the colloquy, that he would receive no more than twenty years in jail, so long as that was the top of the sentencing guidelines for the crime to which he pled guilty. As indicated, the guidelines supported the agreement.
Appellant reasonably expected that the terms of his plea agreement would be honored when he entered his guilty plea. As he told the court at his sentencing proceeding, "Your Honor, what I understood was that the plea was for twelve to twenty." Defense counsel noted this impression as well, stating as follows:
"[Appellant] thought there was an agreement, and I saw what was in the file where there was an offer . . . He understood that there was an agreement that the parties would allocute within the sentencing range between twelve and twenty years . . . "
Appellant's understanding was reasonable, and he is entitled to the benefit of his bargain. When the pre-sentence investigation indicated that the sentencing guidelines recommended twelve to twenty years, the court was bound to impose a sentence within that range.
Tweedy v. State, 380 Md. 475, 845 A.2d 1215, supports this conclusion. In Tweedy, the defendant was told at his plea proceeding that unless he did "certain things" before sentencing, he "would receive a sentence of five years, suspend all but six months with two years probation." Id. at 480, 845 A.2d at 1218. The court did not specifically identify these "certain things" prior to accepting Tweedy's guilty plea. Id. at 480-81, 845 A.2d at 1218. After Tweedy pled guilty, however, the trial court warned him that if he did not show up at sentencing, "the sentence will be five years." Id. at 481, 845 A.2d at 1218. When Tweedy failed to appear at his sentencing proceeding, the court fulfilled its promise, and sentenced him to a term of five years incarceration.
We reversed and remanded for resentencing in accordance with the terms of Tweedy's plea agreement. We held that a sentencing court cannot modify a plea agreement unilaterally after a defendant has entered a guilty plea in reliance on the terms of that agreement. Id. at 486, 845 A.2d at 1221. We stated that, "the condition providing for an increase in the sentence must be an express term of the plea bargain, clearly agreed upon before the guilty plea is accepted." Id. at 487, 845 A.2d at 1222 (emphasis in original).
In the case sub judice, the trial court found that Tweedy did not control. We disagree. It is clear from the record that the court accepted the terms of the plea agreement prior to appellant entering his guilty plea. Based on the record before us, we believe the trial court made statements *659 from which the defendant could reasonably have believed a commitment had been made to impose a sentence within the range of twelve to twenty years, contingent on the sentence falling within the sentencing guidelines. The trial court declined to correct the sentence, however, reasoning that it had never accepted the terms of the plea agreement. The court stated as follows:
"It was not until the Court began discussing the sentencing guidelines that the Court ever even implied that the State's recommendation would be binding on the Courtleading to the unfortunate ambiguity now at issue. This apparent ambiguity, however, makes this case wholly unlike Tweedy, in which the trial court unequivocally added an additional term to the plea agreement after accepting the Defendant's plea."
The court erred in determining that its "implied" acceptance would not be binding on the court. Once a defendant enters a guilty plea and the plea is accepted by the court, due process requires the plea bargain be honored. Santobello, 404 U.S. at 262, 92 S.Ct. at 499.
Assuming that the agreement was ambiguous, the ambiguity should have been construed in favor of the defendant. See Scott, 469 F.3d at 1338 (noting that it is "well settled that we must interpret the agreement according to the defendant's reasonable understanding of its terms"); Farias, 469 F.3d at 397 n. 4 (noting that in construing a plea agreement, "courts should look to the nature of the agreement and the defendant's `reasonable understanding' of it, and any ambiguity must be resolved against the Government" (internal citations omitted)); Williams, 444 F.3d at 1305 (noting that plea bargains are to be read in favor of the defendant); Andis, 333 F.3d at 890 (noting that where "a plea agreement is ambiguous, the ambiguities are construed against the government" (internal citations omitted)); Bisson, 130 P.3d at 830 (stating that it "is axiomatic that due process requires courts to construe any ambiguity in a plea agreement against the government and in accordance with the defendant's reasonable understanding of the agreement"). Therefore, even if the court had only "implied" that it would accept the terms of the plea bargain, appellant was entitled nonetheless to the sentence contemplated in his agreement. Appellant relied upon the court's acceptance of his plea agreement, on terms he understood to be based upon a twelve to twenty year sentence. He waived his right to a trial on this basis. As such, he is entitled to the sentence within the range of the guidelines.
It is clear that appellant did not get that for which he bargained. Relief is either specific enforcement of the agreement or withdrawal of the plea, depending on the circumstances in each case. Appellant does not wish to withdraw his guilty plea; he seeks specific performance of his plea agreement. His agreement with the State specified a term of twelve to twenty years if it fell within the sentencing guidelines, and the trial court specifically told him that "you could receive up to twenty years." The agreed upon sentence did fall within the sentencing guidelines. Appellant is therefore entitled to specific performance of his agreement.[2]
*660 SENTENCE VACATED. CASE REMANDED TO THE CIRCUIT COURT FOR PRINCE GEORGE'S COUNTY FOR RESENTENCING IN ACCORDANCE WITH THIS OPINION. COSTS TO BE PAID BY PRINCE GEORGE'S COUNTY.
NOTES
[1]  Between the plea proceeding and sentencing, appellant retained new counsel.
[2]  At oral argument, the question arose whether, if appellant were to be resentenced, a sentence of life, suspend all but twenty years, would conform with the twelve to twenty year sentence agreed upon between appellant and the State. The State argued that any portion of a sentence which is suspended is not considered when determining whether a sentence falls within the guidelines range. See Maryland State Commission on Criminal Sentencing Policy, Maryland Sentencing Guidelines Manual, § 12. 1, p. 42 (2005) (stating that "[s]uspended time is not considered in determining whether the sentence falls within the recommended guidelines. The guidelines range represents only non-suspended time." (emphasis in original)). Whether a life sentence, suspend all but twenty years (carrying parole conditions not applicable to the twenty year sentence), is the same as a sentence of twelve to twenty years, was not explicitly raised on appeal, and was not briefed by either party. Nonetheless, appellant in the case sub judice was never advised by the trial court that he was facing a life sentence. Assuming, without deciding that the State is correct, if the State is relying on the guidelines provision, the State must make absolutely clear, on the record, that it is doing so, and the defendant must be fully advised as such. For these reasons, we do not address the issue.
