
201 S.E.2d 594 (1974)
William Edward JOHNSON
v.
COMMONWEALTH of Virginia.
Supreme Court of Virginia.
January 14, 1974.
William B. O'Connell, Jr., Arlington, for plaintiff in error.
Gilbert W. Haith, Asst. Atty. Gen. (Andrew P. Miller, Atty. Gen., on brief), for defendant in error.
Before SNEAD, C. J., and I'ANSON, CARRICO, HARRISON, COCHRAN, HARMAN and POFF, JJ.
*595 HARMAN, Justice.
Here we must determine whether the prosecuting officer failed to comply with a plea bargain agreement[1] and, if so, whether the defendant had a right to withdraw his guilty plea which was induced, in part at least, by such agreement.
William Edward Johnson (defendant) was arrested in a narcotics raid in Arlington County on June 12, 1972, and charged with possession of heroin with the intent to distribute the same under Code § 54-524.101:1(a). He was subsequently indicted for this offense on August 14 by the Arlington County Grand Jury.
When arraigned before the trial court on August 23, he entered a plea of not guilty to the indictment and the case was set down for a jury trial on October 3.
Discussions between Johnson's attorney and Brian C. Shevlin, an Assistant Commonwealth's Attorney, resulted in a plea bargain agreement in which the defendant concurred. The agreement was: (1) the indictment which charged possession of heroin with the intent to distribute the same, an offense for which the maximum punishment fixed by Code § 54-524.101:1(a) was 40 years in the penitentiary, would be amended to charge the lesser offense of possession of heroin, an offense punishable by a maximum of ten years in the penitentiary under Code § 54-524.101:2; (2) the defendant would enter a guilty plea to the amended indictment; (3) the prosecutor would recommend a penitentiary sentence of five years with two years suspended; and (4) neither the defendant nor the prosecutor would request the court to obtain a presentence investigation and report prior to sentencing.
While this does not appear in the transcript, it is apparent from subsequent proceedings that the court was advised by counsel that there was an agreement prior to the hearing of October 3. When the case was called on that day, the indictment was amended upon the Commonwealth's motion to charge possession of heroin under Code § 54-524.101:2 and the defendant tendered a plea of guilty to the indictment as amended. The trial court examined the defendant to ascertain that his plea was voluntarily and intelligently tendered and advised him that the court was not bound by any recommendation as to sentencing made by the prosecutor.
After ascertaining that the defendant fully understood that the court was not so bound, the court heard evidence of guilt and found the defendant guilty as charged. After the Assistant Commonwealth's Attorney had recommended the agreed upon punishment, i. e., five years with two years suspended, the trial court declined to act on the recommendation without a presentence investigation and report and ordered such a report prepared.
When the case was again called on January 12, 1973, it appears that both the trial judge and prosecutor failed to recall the plea bargain agreement and the October 3 recommendation of the Assistant Commonwealth's Attorney. The probation officer testified and the presentence report was filed.[2] When asked by the court for a recommendation, Shevlin, the Assistant Commonwealth's Attorney, recommended a sentence of ten years with four years suspended.
Defense counsel promptly called the prior proceedings and plea bargain agreement to the attention of the court and the prosecutor and asked leave to withdraw the guilty plea, to enter a plea of not guilty and to proceed with a jury trial.
*596 The Commonwealth's Attorney, who made his first appearance of record in the case on January 12, first denied the existence of an agreement. This denial was subsequently withdrawn and the agreement was acknowledged by Shevlin, who first took the position that the Commonwealth had lived up to its agreement by making its original recommendation. He subsequently withdrew the later recommendation, acknowledging ". . . I feel I cannot increase it [the recommendation] as I did. I leave the court no recommendation at all except the presentence report . . . ."
The trial court, after denying the defendant's motion to withdraw his guilty plea and observing that the court was not influenced by the later recommendation, imposed a maximum sentence of ten years in the penitentiary with four years of this sentence suspended.
In Virginia, as well as in our sister states, the system of criminal justice cannot function promptly and effectively unless the vast majority of all criminal cases are disposed of on pleas of guilty.[3] Plea bargaining, when properly pursued, is a legitimate means of arriving at a plea of guilty, but it is a practice which should not be abused. Hobson v. Youell, 177 Va. 906, 15 S.E.2d 76 (1941).
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 pretrial 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 release; 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. Santobello v. New York, 404 U.S. 257, 261, 92 S.Ct. 495, 30 L.Ed.2d 427 (1971).
It is of the utmost importance that the integrity of the plea bargaining process be assured because any failure in this regard would result in making this most desirable process less useful and productive than in the past.
Here a plea bargain agreement was made and defendant, who had complied with the agreement, was entitled to have the agreement strictly complied with by the prosecutor until the sentencing process was completed. Any deviation from the agreement by the prosecutor, whether inadvertent or not, should not have been countenanced. Here the defendant promptly elected to withdraw his guilty plea entered pursuant to the agreement and he should have been permitted to do so.[4]
In so holding we accept the trial judge's observation that he was not influenced by the prosecutor's January 12 recommendation. Nor do we mean to indicate that there was bad faith on the part of the Office of the Commonwealth's Attorney, for the inadvertent noncompliance with the agreement was frankly disclosed in the later proceedings before the trial court. But the fact remains that the agreed recommendation was withdrawn, which was a violation of the plea bargain agreement.
Nor do we mean to imply that the trial court should, in any way, be bound by a recommendation of the prosecutor. The judge should exercise his discretion and *597 best judgment in arriving at a fair disposition of the case, giving due consideration to any recommendation made by the prosecutor as well as all other relevant factors with particular consideration of the public interest.
When there is noncompliance, whether intentional or inadvertent, by the prosecutor with the plea bargain agreement as the defendant understands it, the defendant must promptly call such noncompliance to the court's attention and request that he be allowed to withdraw his guilty plea, otherwise it will be deemed to have been waived. When such a prompt request is made to the court prior to the conclusion of the sentencing process, the court should permit the plea of guilty to be withdrawn. It should also vacate all action and proceedings taken pursuant to the agreement. In the case under review the court should restore the indictment to its original form.
Reversed and remanded.
NOTES
[1]  Use of the term "plea bargain" has been avoided by many authorities who seem to prefer the less descriptive and more delicate term "plea discussion."
[2]  The presentence report shows that the defendant had a long criminal record, was reputed to be a dealer in narcotics, was a narcotics addict and was on probation in the District of Columbia upon a conviction there for violation of the drug laws.
[3]  In some localities as many as 95 per cent of the convictions in criminal cases are upon pleas of guilty. A.B.A. Standards Relating to Pleas of Guilty, 1, 2 (Approved Draft, 1968). In fiscal 1971, of 32,703 convictions in the United State District Courts, 27,544 were upon pleas of guilty or nolo contendere. Report of Director of Administrative Office of U. S. Courts, 1971, Table D-4-1971, p. 340.
[4]  The remedy granted here is the one sought by the defendant who did not request specific performance of the agreement, an alternate remedy suggested by Santobello.
