
643 S.W.2d 243 (1982)
Ruben ESCOBEDO, Appellant,
v.
The STATE of Texas, Appellee.
No. 3-82-062-CR.
Court of Appeals of Texas, Austin.
December 1, 1982.
*244 Tom E. Garner, San Marcos (appointed), for appellant.
William Rugeley, Crim. Dist. Atty., Philip Michael Grazier, Asst. Crim., Dist. Atty., San Marcos, for appellee.
Before SHANNON, POWERS and GAMMAGE, JJ.
GAMMAGE, Justice.
This is an appeal from a conviction for the offense of theft under $10,000. Punishment is ten years imprisonment.
Appellant argues that the trial court erred in failing to follow a plea-bargain agreement or to allow the withdrawal of the plea in violation of Tex.Code Cr.P.Ann. art. 26.13 (1981), that the conviction was void because of ineffective assistance of counsel, and that the trial court erred in failing to allow appellant ample time and opportunity for allocution. We deal only with the first of these grounds. The judgment of the trial court will be reversed.
Pursuant to a plea agreement on June 12, 1981, appellant entered a plea of guilty to the offense of theft under $10,000. Under the agreement, the State was to recommend that appellant receive 120 days shock-probation on a ten-year sentence and make restitution. The court entered a finding of guilty, ordered a pre-sentence report to be prepared, continued appellant on bond, and set a hearing on punishment for July 27, 1981. Prior to appellant entering his plea, the trial court advised both appellant and his counsel that if the court should decide not to grant either straight probation or shock-probation and instead sentence appellant to serve a period of time in excess of the "jail-shock program," appellant would "be able to withdraw his plea."
On July 27, appellant failed to appear for sentencing and his bond was forfeited and a capias issued for his arrest. Appellant was later found in custody of authorities in Comal *245 County where he was under indictment for an unrelated offense.
On December 15, 1981, the trial court sentenced appellant to ten years in the Texas Department of Corrections, purportedly taking into consideration pursuant to Tex. Pen.Code Ann. § 12.45 (1974) the unrelated and unadjudicated offense in Comal County.
Tex.Code Cr.P.Ann. art. 26.13, provides:
(a) Prior to accepting a plea of guilty..., the court shall admonish the defendant of:
(1) the range of the punishment attached to the offense;
(2) the fact that the recommendation of the prosecuting attorney as to punishment is not binding on the court. Provided that the court shall inquire as to the existence of any plea bargaining agreements between the state and the defendant and, in the event that such an agreement exists, the court shall inform the defendant whether it will follow or reject such agreement in open court and before any finding on the plea. Should the court reject any such agreement, the defendant shall be permitted to withdraw his plea of guilty.... (emphasis added)
The record reflects the following exchange between the trial court and appellant's counsel prior to the court's acceptance of appellant's guilty plea:
MR. MAJOR: Your Honor, may I say, is that not also with the understanding that if you cannot take the recommendation, that he will be able to withdraw his plea?
THE COURT: If I should decide to sentence him to a straight ten years or any straight period of time two years or more beyond the jail-shock program, yes.
In effect, the trial court told appellant that if it was not going to abide by the plea bargain, appellant could withdraw his plea of guilty.
The State argues in substance that the plea was renegotiated during the sentencing hearing based on changed circumstances and intervening facts under the trial court's consideration.[1] However, the record reflects only confusion on appellant's part as to the state of such negotiations during the punishment hearing. The following exchange occurred between appellant, his defense counsel and the trial court immediately prior to pronouncement of sentence:
MR. MAJOR: ... [w]hat is your understanding of the number of years the Judge would give you for doing this at this time?
THE DEFENDANT: Well ...
MR. MAJOR: Did you have an understanding?
THE DEFENDANT: Three different ones. First of all, if I remember right you were the one that told me five yearsand your assistant went with youif I would plead guilty. I told you yes.
MR. MAJOR: Okay, let me ask you a question. Did I tell you that I would try to get five years, or did I say I had five years?
THE DEFENDANT: You told me that the District Attorney was recommending five years T.D.C. if I would accept it and they would drop the charges. Your assistant was with you, that's the one and only time that you went to see me in jail. Then I came back to court and I told you that I wasn't ready to plead guilty because they hadn't dropped the charges in Lockhart, and you told me you were going to ask the Judge for some extra time. And now I'm here today and now you tell me ten years.
MR. MAJOR: I see. What I told you was that because you ran they were willing to give you five years
THE DEFENDANT: Yes, sir.
THE COURT:without considering anything else?

*246 THE DEFENDANT: Yes, sir.
MR. MAJOR: Okay, I may have told him that, Your Honor.
THE COURT: All right.
It is the judgment and sentence of this Court that you be confined in the Texas Department of Corrections for ten years.
There is nothing in the record to show that the appellant was ever advised of his right to withdraw his earlier plea because of the court's intention to reject the original recommendation upon which the plea was based.
Where an accused has been assured by the court that he will have the opportunity to withdraw his plea of guilty if the court is going to reject the State's recommendation which was an inducement to enter the plea, the court is obligated to so advise the accused and afford him that opportunity.[2] A guilty plea entered under one set of circumstances cannot serve as the basis for sentencing under another set of circumstances unless the accused is advised of the court's intention to consider the new circumstances and is given the opportunity to either withdraw his plea or to knowingly and voluntarily affirm his plea and consent to consideration of the new circumstances. Cf. McGuire v. State, 617 S.W.2d 259 (Tex. Cr.App.1981).
From this record, it cannot be said that appellant knowingly and voluntarily waived his rights and entered or affirmed a plea of guilty under the changed circumstances considered by the court in arriving at the sentence imposed in this case.
Furthermore, Tex.Pen.Code Ann. § 12.45 (1974) provides:
(a) An individual may, with the consent of the attorney for the state, admit during the sentencing hearing his guilt of one or more unadjudicated offenses and request the court to take each into account in determining sentence for the offense or offenses of which he stands adjudged guilty.
(b) Before a court may take into account an admitted offense over which exclusive venue lies in another county or district, the court must obtain permission from the prosecuting attorney with jurisdiction over the offense.
(c) If a court lawfully takes into account an admitted offense, prosecution is barred for that offense. (emphasis added)
In the instant case, the record does not reflect any admission of guilt was ever solicited from or made by appellant for the unadjudicated offense in Comal County. Neither does the record show that the court obtained permission, either in writing or through direct oral communication, from the prosecuting attorney in Comal County to consider such offense in determining sentence for the offense of which appellant was adjudged guilty in Hays County. And, although the transcript reflects that the trial court considered the Comal County offense in its imposition of sentence in this case, the written judgment does not reflect such consideration.
Article 12.45, supra, specifically requires an admission of guilt from an accused for any unadjudicated offense to be considered for sentencing under its provisions. See Wilkins v. State, 574 S.W.2d 106 (Tex.Cr. App.1978). It also clearly requires that the sentencing court have permission from the prosecutor with jurisdiction over the unadjudicated offense, and does not permit reliance upon the mere oral representations of either counsel for the accused or the prosecuting attorney of the court's own jurisdiction.
Since the unadjudicated offense in this case was not lawfully taken into account in *247 determining sentence in Hays County and was not reflected in the court's written judgment, such consideration could not serve as a bar to prosecution for the offense in Comal County.
Appellant's first ground of error is sustained, therefore we need not deal here with the other grounds.
The judgment of the trial court is reversed and the cause remanded for trial.
NOTES
[1]  It is to be noted that there is no bifurcated trial where a defendant pleads guilty. Thom v. State, 563 S.W.2d 618 (Tex.Cr.App.1978). In the instant case, the trial court had already found appellant guilty without any indication that it would not approve the plea bargain.
[2]  Cf. Santobello v. New York, 404 U.S. 257, 92 S.Ct. 495, 30 L.Ed.2d 427 (1971). In Santobello, the Supreme Court held that a prosecutor's agreement, made as an inducement to a plea of guilty, to make no recommendation on sentence to the trial court was binding, and that when the prosecutor failed to keep the bargain, defendant should have been permitted to withdraw his plea. The trial court in the instant case is no less bound by its promise than was the prosecutor in Santobello.
