Opinion
—Defendant, Jose Rivera, was convicted by the trial court of one count of possessing marijuana for sale. (Health & Saf. Code, § 11359.) He was placed on three years probation on condition, among others, that he spend the first 90 days in county jail. Execution of the jail sentence was stayed pending appeal.
Defendant contends that the trial court erred in allowing him to withdraw his plea of nolo contendere.1 We affirm the judgment.
Procedural Background
Defendant initially pled not guilty to the charge against him. He personally withdrew that plea and entered a plea of nolo contendere. He then *926moved to withdraw his plea of nolo contendere. The trial court granted that motion and the case proceeded to trial without jury.
At the time defendant entered the nolo contendere plea, the court promised to place defendant on felony probation with the understanding that he might not have to serve any jail time. After entering his plea, however, defendant told his probation officer that he was not guilty of the charge and wanted to withdraw the plea and go to trial. He also told the probation officer that his attorney would not listen to him and that he had pleaded nolo contendere because he was afraid of going to jail. Defendant’s attorney confirmed defendant’s desire to withdraw his plea and the court granted the motion, stating that “any plea bargain is called off.”
Discussion
Defendant contends, and the People concede, that the defendant did not personally withdraw his nolo contendere plea. Penal Code section 1018 provides in relevant part that “[ujnless otherwise provided by law every plea must be entered or withdrawn by the defendant himself in open court.” In the instant case, we find that an exception to the requisites of section 1018 exists in the language of Penal Code section 1192.5. That section governs the approval and withdrawal of guilty and nolo contendere pleas and frames the parameters of plea bargains.
Among its various provisions, section 1192.5 states that a court’s approval of a plea is not binding and may be withdrawn in light of further consideration of the matter and that a defendant shall be permitted to withdraw a plea if he so desires. Further, the court shall “cause an inquiry to be made of the defendant to satisfy itself that the plea is freely and voluntarily made . . . .” If a plea is not accepted by the court, the plea is deemed withdrawn and defendant may enter such plea as would otherwise have been available.
Here, the trial court ordered that defendant’s nolo contendere plea be withdrawn essentially because defendant represented to his probation officer that he had not freely and voluntarily entered his plea. He stated that his plea was made because his counsel would not listen to him and because he feared a jail sentence. He specifically told the probation officer that he was not guilty, wanted to withdraw his plea and wished to have a trial.
Since the court became convinced that defendant’s plea had not been voluntarily and freely made, it had no choice but to withdraw his plea regardless of whether defendant withdrew his plea in open court. We find that the withdrawal of a plea of nolo contendere, like the withdrawal of a guilty plea, is within the sound discretion of the trial court after due *927consideration of the factors necessary to bring about a just result. (See People v. Harvey (1984) 151 Cal.App.3d 660, 666-667 [198 Cal.Rptr. 858].) Accordingly, we do not find that the court abused its discretion.
The judgment is affirmed.
Boren, J., and Hastings, J.,* concurred.