
448 N.W.2d 546 (1989)
STATE of Minnesota, Respondent,
v.
Corey E. TYSKA, Appellant.
No. C7-89-783.
Court of Appeals of Minnesota.
December 5, 1989.
*547 Hubert H. Humphrey, III, Atty. Gen., Tom Foley, Ramsey County Atty., Steven C. DeCoster, Asst. County Atty., St. Paul, for respondent.
C. Paul Jones, Public Defender, Marie L. Wolf, Minneapolis, for appellant.
Considered and decided by WOZNIAK, C.J., and SCHUMACHER and GARDEBRING, JJ., without oral argument.

OPINION
SCHUMACHER, Judge.
Appellant pleaded guilty to second degree murder pursuant to a plea agreement which provided that appellant would be sentenced pursuant to the Minnesota Sentencing Guidelines. At the sentencing hearing, the trial court declared its intention to depart upward and, appellant then moved to withdraw his guilty plea. The trial court denied appellant's motion.

FACTS
On July 19, 1988, appellant Corey Tyska was at his home caring for his nine-week-old son. In response to the child's continued crying, appellant shook the child, causing the child's head to rock back and forth, and then struck the child above his right eye. Appellant then laid the boy in his crib. Hours later, appellant's wife returned home, observed the child and called the paramedics. The child died the next day as a result of a skull fracture. Appellant was charged with murder in the second degree in violation of Minn.Stat. § 609.19(2) (1988), felony murder.
Appellant pleaded guilty to the charge on October 21, 1988.
The Petition To Enter Plea, (petition), signed by appellant, provided in pertinent part as follows:
20. I have been told by my attorney and understand:
a. That he discussed this case with one of the prosecuting attorneys, and that my attorney and the prosecuting attorney agreed that if I entered a plea of guilty, the prosecutor will do the following:
Defendant to plead guilty to complaint as charged. State agrees to sentencing pursuant to Minnesota Sentencing Guidelines. (i.e., no departure). (Typewritten on form).
b. That if the court does not approve this agreement:
i. I have an absolute right to then withdraw my plea of guilty and have a trial.
*548 The petition was based on Appendix A to Minn.R.Crim.P. 15.
The case was called to trial on October 21, 1988 and the following exchange took place.
THE COURT: Good afternoon. This matter is on the calendar, court calendar, Monday for trial, and I've been informed by the attorneys, that a plea agreement has been reached; is that correct?
MR. McGEE: That's correct, Your Honor.
THE COURT: If you'd like to state then that, Mr. McGee, state the plea agreement for the record.
MR. McGEE: Yes, Your Honor. It is my understanding, Your Honor, that Mr. Tyska will enter a plea of guilty to the Complaint as charged, that being murder in the second degree. In exchange for that plea, the State will agree with the defense to a sentencing pursuant to Minnesota Sentencing Guidelines, in other words, that neither side will be moving for a departure.
Is that your understanding Mr. Tyska?
MR. TYSKA: Yes, it is.
THE COURT: Mr. Zdrazil, does that reflect your understanding of the plea agreement?
MR. ZDRAZIL: Yes, it does, Your Honor.
Appellant thereupon entered a plea of guilty to the charge and was questioned by his attorney about his understanding of the petition. The relevant testimony is as follows:
Q: Mr. Tyska, I'm showing you a document; it's a one-page document. It has writing on both sides, and it's entitled a Petition to Enter a Plea of Guilty in a Felony Case, and I would ask you if this is the petition that we went over today?
A: Yes, it is.
* * * * * *
Q: Now, I would ask if we've gone over everything on both sides of this petition?
A: Yes.
* * * * * *
Q: Now, I'd like to direct your attention to the back side of this petition, No. 20. It states the plea agreement, the plea agreement which was just stated before Her Honor, Judge Smith, and I would just read it to you, and it states as follows: That you would be pleading guilty to the Complaint as charged and the State agrees to sentencing pursuant to the Minnesota Sentencing Guidelines, that is, no departure.
Now, is that your understanding of the plea agreement?
A: Yes.
A PSI was ordered and a sentencing date set. At the sentencing hearing the trial court announced that it was going to depart from the guideline sentence. Appellant's attorney thereupon requested a continuance and subsequently filed a motion and supporting memorandum requesting that appellant be granted leave to withdraw his guilty plea. At a later date, the trial court heard argument on the motion. The prosecuting attorney did not oppose the motion. The trial court denied the motion and sentenced appellant to 175 months, an upward departure of 69 months.

ISSUE
Did the negotiations between the prosecuting attorney and defense attorney constitute a plea agreement or only an agreement that the prosecution would recommend a particular sentence?

ANALYSIS
Appellant brought the motion to withdraw pursuant to Minn.R.Crim.P. 15.05, subd. 2, which provides as follows:
Before Sentence. In its discretion the court may also allow the defendant to withdraw his plea at any time before sentence if it is fair and just to do so, giving due consideration to the reasons advanced by the defendant in support of his motion and any prejudice the granting of the motion would cause the prosecution by reason of actions taken in reliance upon the defendant's plea.
Appellant also argues that he should be allowed to withdraw his guilty plea based *549 on the provisions of paragraph 20 of the petition and also pursuant to Minn.R. Crim.P. 15.04, subd. 3(1), which provides as follows:
Subd. 3. Responsibilities of Trial Court Judge.
(1) Disclosure of Plea Agreement. If a plea agreement has been reached which contemplates entry of a plea of guilty, the trial court judge may permit the disclosure to him of the agreement and the reasons therefor in advance of the time for tender of the plea. When such plea is tendered and the defendant questioned, the trial court judge shall reject or accept the plea of guilty on the terms of the plea agreement. The court may postpone its acceptance or rejection until it has received the results of a pre-sentence investigation. If the court rejects the plea agreement, it shall so advise the parties in open court and then call upon the defendant to either affirm or withdraw his plea. (Emphasis added).
In denying appellant's motion, the trial court did not address appellant's right to withdraw pursuant to paragraph 20 of the petition, or Minn.R.Crim.P. 15.04, subd. 3(1), but used the "fair and just" test as provided in Minn.R.Crim.P. 15.05, subd. 2. The trial court apparently concluded that the agreement only provided that the prosecution would make a recommendation as to sentencing. Unfortunately, the matter of whether appellant would be allowed to withdraw his plea should the court not follow the sentencing agreement was never brought up. The question presented, therefore, is whether the agreement was a plea agreement as envisioned by Rule 15.04, subd. 3(1), and paragraph 20 of the petition, or merely a recommendation as to a sentence.
It is apparent from a reading of the record that this was an agreement as to sentencing between the prosecuting attorney, the defense attorney and appellant. The agreement was referred to as a "plea agreement" in the questioning of the appellant at the time the plea of guilty was entered and also referred to as a "plea agreement" by the trial court. The word "agree" is used by the prosecuting attorney in the petition rather than the word "recommend." We can only conclude that the prosecuting attorney felt this was a plea agreement within the meaning of Rule 15.04, subd. 3(1), and paragraph 20 of the petition since he declined to oppose appellant's motion to withdraw the plea.
We conclude therefore that the agreement entered into by the attorneys and appellant constituted a plea agreement within the meaning and purview of Rule 15.04, subd. 3(1) and paragraph 20 on the petition.
The law is well settled in this state that if the trial court rejects an agreement as to sentence, the defendant is entitled to withdraw his plea; but if the trial court rejects a recommendation made pursuant to an agreement, the defendant is not automatically entitled to withdraw the plea. State v. DeZeler, 427 N.W.2d 231, 234 (Minn. 1988).
In Kim v. State, 434 N.W.2d 263 (Minn. 1989), the defendant pleaded guilty in return for the dismissal of one count and a gross misdemeanor sentence. Defendant understood that if the trial court did not agree to the gross misdemeanor sentencing, he could withdraw his plea. While defendant received all for which he bargained, he nonetheless moved to withdraw his plea. The supreme court used a rule 15.05 analysis and held that appellant was not entitled to withdraw his plea. Id. at 266.
Thus, if the trial court in the present case rejected the joint agreement as to sentence, appellant should have been able to withdraw his plea. See DeZeler, 427 N.W.2d at 234. On the other hand, the matter of withdrawal of the plea was discretionary if the trial court accepted the plea agreement, Kim, 434 N.W.2d at 266, or if the agreement was only for a recommendation. DeZeler, 427 N.W.2d at 234.
We note that the Federal Rules of Criminal Procedure draw a distinction between an agreement to a sentence and a recommendation, and in both cases allow a defendant *550 to withdraw a plea if the court does not follow the agreement or recommendation.[1]
In the final analysis, it is the responsibility of the trial court to sufficiently clarify the terms and conditions of a plea agreement, so that the defendant, as well as the attorneys, clearly understands defendant's rights thereunder.

DECISION
We hold that there was a plea agreement between the prosecutor and defense attorney and appellant. The trial court did not accept the agreement and therefore appellant should have been allowed to withdraw his plea.
Reversed and remanded.
NOTES
[1]  Rule 11(e) reads in pertinent part:

(1) In General. The attorney for the government and the attorney for the defendant * * * may engage in discussions with a view toward reaching an agreement that, upon the entering of a plea of guilty * * * to a charged offense * * *, the attorney for the government will do any of the following:
(A) move for dismissal of other charges; or
(B) make a recommendation, or agree not to oppose the defendant's request, for a particular sentence, with the understanding that such recommendation or request shall not be binding upon the court; or
(C) agree that a specific sentence is the appropriate disposition of the case.
* * * * * *
(2) Notice of Such Agreement. * * * If the agreement is of the type specified in subdivision (e)(1)(A) or (C), the court may accept or reject the agreement, * * *. If the agreement is of the type specified in subdivision (e)(1)(B), the court shall advise the defendant that if the court does not accept the recommendation or request the defendant nevertheless has no right to withdraw his plea.
(emphasis added).
The notes to Rule 11 state that:
A (B) type of plea agreement is clearly of a different order than the other two, for an agreement to recommend or not to oppose is discharged when the prosecutor performs as he agreed to do. By comparison, critical to a type (A) or (C) agreement is that the defendant received the contemplated charge dismissal or agreed-to sentence. Consequently, there must ultimately be an acceptance or rejection by the court of a type (A) or (C) agreement so that it may be determined whether the defendant shall receive the bargained-for concessions or shall instead be afforded an opportunity to withdraw his plea. * * *. Because a type (B) agreement is distinguishable from the others in that it involves only a recommendation or request not binding upon the court, it is important that the defendant be aware that this is the nature of the agreement into which he has entered.
