
11 Cal.3d 793 (1974)
523 P.2d 636
114 Cal. Rptr. 596
THE PEOPLE, Petitioner,
v.
THE SUPERIOR COURT OF THE CITY AND COUNTY OF SAN FRANCISCO, Respondent; JOSE R. GIRON, Real Party in Interest.
Docket No. S.F. 23084.
Supreme Court of California. In Bank.
June 25, 1974.
*795 COUNSEL
Evelle J. Younger, Attorney General, Edward A. Hinz, Jr., Chief Assistant Attorney General, Doris H. Maier, Assistant Attorney General, William D. Stein and Sanford Svetcov, Deputy Attorneys General, for Petitioner.
No appearance for Respondent.
Douglas P. Haffer for Real Party in Interest.
OPINION
WRIGHT, C.J.
On application of the People we issued our writ mandating the respondent superior court to set aside, or in the alternative to show cause why it should not set aside, an order granting a motion of Jose R. Giron, the real party in interest herein, to withdraw his plea of guilty and enter a plea of not guilty to a violation of Health and Safety Code section 11530 (now § 11357, possession of marijuana). Pursuant to stipulation the offense was deemed to be a misdemeanor.[1] The principal issue raised is whether, in the circumstances of this case, the trial court was vested with discretion and, if so, whether it abused such discretion in granting the motion. We conclude that the court had such discretion which it properly exercised and accordingly, discharge the alternative writ and deny the petition.
In 1970, following his plea of guilty, the imposition of judgment was suspended and Giron was placed on probation for three years. In 1971, while still on probation, Giron moved to withdraw the plea "and to vacate the judgment of guilty." In support of the motion it was alleged that Giron, a citizen of the Republic of El Salvador, was a lawfully admitted permanent resident of the United States, and that following his guilty plea the United States Immigration and Naturalization Service served him with an order to show cause why he should not be deported. The stated ground for deportation was that Giron had been convicted of the offense of possession of marijuana.[2] Giron also alleged that at the time he entered his plea of *796 guilty and accepted probation neither he nor the other parties involved, including the respondent court, were aware that his plea would subject him to deportation.
In granting Giron's motion and ordering the vacation of his guilty plea, the court also purported to vacate "the judgment of guilty ... and the sentence imposed pursuant thereto." It does not appear, however, that the court had ever entered judgment or imposed sentence after placing Giron on probation.
(1) We consider first the status of criminal proceedings wherein the imposition of sentence has been suspended and probation granted. Although such an order granting probation is "deemed to be a final judgment" for the limited purpose of taking an appeal therefrom (Pen. Code, § 1237, subd. 1), it does not have the effect of a judgment for other purposes. (See Stephens v. Toomey (1959) 51 Cal.2d 864, 871 [338 P.2d 182]; 2 Witkin, Cal. Crimes, §§ 1066, 1067, pp. 1007-1008.) As expressly provided in such an order, the criminal proceedings have been "suspended" prior to the imposition of judgment and pending further order of the court.
In the instant case proceedings continued in the suspended state until reactivated by Giron's motion to set aside his guilty plea. Although the court, perhaps in response to Giron's motion which erroneously suggested that judgment had been entered, also erred in purporting to set aside the nonexistent judgment and sentence, the error is of no moment. There was, of course, an outstanding order granting probation and we view the motion and order thereon as directed not only to the withdrawal of the plea of guilty and the entry of a plea of not guilty, but also to the setting aside of the order granting probation, all of which took place prior to the entry of any judgment.
As no judgment had been entered Giron's motion is governed by Penal Code section 1018, which provides that a guilty plea may be withdrawn before judgment and for good cause shown.[3] (2) The granting of such an application is within the sound discretion of the trial court and must be upheld unless an abuse thereof is clearly demonstrated. (In re Brown (1973) 9 Cal.3d 679, 685 [108 Cal. Rptr. 801, 511 P.2d 1153]; People v. Dena (1972) 25 Cal. App.3d 1001, 1008 [102 Cal. Rptr. 357]; People v. Barteau (1970) 10 Cal. App.3d 483, 486 [89 Cal. Rptr. 139].) Trial courts are expressly *797 directed to give a liberal construction to the provisions of section 1018 in the interest of promoting justice. (Fn. 3, supra.)[4]
Giron's motion was presented to the court on the ground that at the time he entered a plea of guilty he, his attorney, the prosecutor and the court were all unaware that deportation would be a collateral consequence of his plea, and that had he been aware of that consequence he would not have bargained for his freedom on probation in exchange for his concession of guilt. We do not deem the thrust of the argument to be that Giron was entitled as a matter of right to be advised of such collateral consequences prior to the acceptance of his plea nor do we so hold. (See In re Yurko (1974) 10 Cal.3d 857, 864-865 [112 Cal. Rptr. 513, 519 P.2d 561]; United States v. Sambro (1971) 454 F.2d 918, 922 [147 App.D.C. 75].)
A trial court, nevertheless, in the exercise of its discretion directed to the promotion of justice may take into consideration such material matters with which an accused was confronted and as to which he made erroneous assumptions when he entered a guilty plea. The court might consider that justice would not be promoted if an accused, willing to accept a misdemeanor conviction and probationary status, cannot by timely action revoke his election when he thereafter discovers that much more serious sanctions, whether criminal or civil, direct or consequential, may be imposed. (3) As a general rule, a plea of guilty may be withdrawn "for mistake, ignorance or inadvertence or any other factor overreaching defendant's free and clear judgment." (People v. Butler (1945) 70 Cal. App.2d 553, 561 [161 P.2d 401]; see also In re Brown, supra, 9 Cal.3d 679, 686, fn. 10.)[5]
The situation here is unlike that wherein the accused enters a guilty plea hoping for leniency which is not forthcoming. Such situation has traditionally *798 been held not to constitute a ground for the court to exercise its discretion in allowing the withdrawal of a guilty plea. (See People v. Burkett (1953) 118 Cal. App.2d 204 [257 P.2d 745].) In the present case, however, Giron was not gambling on the severity of possible penalties for all parties were unaware that dire consequences, in addition to any punishment the court might impose, could result from a plea of guilty.
(4) The situation in the instant case is one in which the court was properly vested with discretion to grant or to deny the motion after considering all factors necessary to bring about a just result. We would not necessarily conclude that a court abused its discretion if it either granted or denied a motion to set aside a plea of guilty on evidence that an accused was or was not aware of the possibility of deportation; the test of abuse in such circumstances is whether after consideration of all relevant factors there was good cause shown for granting the motion and whether justice would be promoted thereby. (Pen. Code, § 1018; see People v. Flores (1974) 38 Cal. App.3d 484, 488 [113 Cal. Rptr. 272].) When, as here, the accused entered his plea of guilty without knowledge of or reason to suspect severe collateral consequences, the court could properly conclude that justice required the withdrawal of the plea on motion therefor. (Cf. People v. Coley (1968) 257 Cal. App.2d 787 [65 Cal. Rptr. 559].)
Accordingly, we conclude that the respondent court had discretion to permit Giron to withdraw his plea and that there was no abuse in exercising such discretion. The alternative writ of mandate heretofore issued is discharged and the petition for a peremptory writ of mandate is denied.
McComb, J., Tobriner, J., Mosk, J., Burke, J., Sullivan, J., and Clark, J., concurred.
NOTES
[1]  The People previously appealed from the order granting the motion. It was held that the order was nonappealable and the appeal was dismissed. (People v. Giron (Jan. 16, 1974) 1 Crim. 11029.) That judgment is now final.
[2]  8 United States Code section 1251 in part provides: "(a) Any alien in the United States ... shall, upon the order of the Attorney General, be deported who ... (11) is, or hereafter at any time after entry has been, a narcotic drug addict, or who at any time has been convicted of a violation of ... any law or regulation relating to the illicit possession of or traffic in narcotic drugs or marihuana...."
[3]  Penal Code section 1018 provides in pertinent part: "On application of the defendant at any time before judgment the court may ... for good cause shown, permit the plea of guilty to be withdrawn and a plea of not guilty substituted.... This section shall be liberally construed to effect these objects and to promote justice."
[4]  We do not hold, however, that although a trial court may entertain such a motion prior to judgment, it will always have jurisdiction to do so. Thus when the court has made some appealable order prior to judgment and an appeal therefrom has been taken, the trial court would lack jurisdiction in the matter during pendency of the appeal.
[5]  In granting the motion the court purported to rely on People v. Savin (1940) 37 Cal. App.2d 105 [98 P.2d 773]. That case dealt with an order made after judgment (an appeal from an order granting a petition for a writ of error coram nobis). Such reliance was consistent with the view of respondent court that a judgment had been entered. However, the critical factor in the court's reliance on Savin is that it makes clear that the court acted in the exercise of its discretion with the view of promoting justice. It was held in Savin that where an extrinsic fact operated so as to cause an over-reaching of the free will and judgment of the accused so as to deny him a trial on the merits, on motion seasonably made and properly supported, the court may even after judgment, permit him to withdraw the plea and stand trial. Savin also stated the general rule that "In a case of this kind a trial judge should be given the opportunity to exercise a sound discretion so that justice may be done." (Id., at p. 108.)
