In this CPLR article 78 proceeding petitioner, on behalf of George Morris, a defendant in a criminal proceeding, seeks, inter alia, to compel respondent, an acting Justice of the Supreme Court of the State of New York, to sentence Morris (hereinafter defendant) to a three-year term of probation in accordance with a plea bargain entered into with respect to defendant’s plea of guilty of criminal possession of a weapon in the fourth degree, a misdemeanor, the surviving charge in an indictment. After respondent had orally dismissed the only other count, the felony of criminal possession of a weapon in the third degree, and defendant had pleaded guilty to the remaining charge, respondent realized that he had ruled in error, reinstated the dismissed felony charge, and afforded defendant an opportunity to withdraw his plea.
After being indicted for both offenses, defendant was arraigned and entered a plea of not guilty. He thereafter, as part of an omnibus motion, sought inspection of the Grand Jury minutes and dismissal of the indictment on the basis of legal insufficiency. After submission of the motion, the court, at a May 10, 1994 calendar call, orally dismissed the felony weapon charge without comment or assigning any reason therefor. At the next calendar call, on June 7, 1994, when petitioner, defendant’s attorney, asked for a copy of respondent’s decision she was advised that a decision had "probably” been filed with the clerk. The matter was adjourned to August 1, 1994 for a suppression hearing as to the surviving charge.
When the prosecutor appeared before respondent on August 1, 1994, she was informed that defendant was going to plead guilty to the remaining misdemeanor charge and, in response *285to a request for respondent’s written decision, was told that she should have obtained a copy of it. Defendant then, without any objection of record from the prosecutor, withdrew his previously entered not guilty plea and, in exchange for a promised sentence of probation, pleaded guilty to criminal possession of a weapon in the fourth degree, admitting that, on November 9, 1993, he possessed a loaded gun in his waistband.
On the same date, when the prosecutor called respondent’s law secretary, asking for a copy of the decision, she was told that the decision was still being prepared but that it would reflect that the evidence before the Grand Jury was sufficient to sustain the indictment. In fact, in the decision the prosecutor subsequently received, dated July 29, 1994, respondent found the evidence to be sufficient to sustain the indictment and that the Grand Jury proceedings were not, in any manner, defective.
At the scheduled sentencing on October 21, 1994, respondent, sua sponte and over defendant’s objection, reinstated the previously dismissed count charging criminal possession of a weapon in the third degree, explaining that the previous dismissal was "incorrect” and that "[w]hen the matter was reduced to the written decision, [he] realizing [his] own error, corrected [him]self.” Respondent then withdrew his earlier decision dismissing the felony count and reaffirmed his July 29, 1994 decision.
Petitioner thereupon commenced this article 78 proceeding to prohibit respondent from vacating defendant’s plea of guilty of the misdemeanor of criminal possession of a weapon in the fourth degree and to compel respondent to sentence defendant in accordance with the terms of the plea bargain. Since petitioner fails to state a cause of action cognizable under CPLR article 78, the petition should be dismissed.
Analyzing the essence of petitioner’s complaint—that the court cannot reinstate the previously dismissed felony count and vacate defendant’s misdemeanor guilty plea—it is clear that the court acted within its power and that therefore the petition should be dismissed in its entirety. As this record discloses, when defendant pleaded guilty on August 1, 1994 it was on respondent’s mistaken belief that the indictment’s felony count had been properly dismissed. On that same date, respondent’s law secretary informed the prosecutor that a formal decision, the writing of which was still in progress, would find the evidence before the Grand Jury legally sufficient to sustain the indictment. That decision, dated July 29, *2861994, stated, "The credible evidence adduced before the Grand Jury is legally sufficient to sustain the indictment.” On October 21, 1994, the date set for sentence, respondent acknowledged, in open court, his mistake in dismissing the criminal possession of a weapon in the third degree charge, characterizing the previous dismissal of the felony count as "incorrect” and describing his actions in reinstating the charge as the court’s correction of "its own error.”
It is well settled that a trial court, prior to the commencement of sentence, has the inherent power to vacate an illegal or invalid plea. (See, People v Bartley, 47 NY2d 965; People v Pena, 169 AD2d 392, Iv denied 78 NY2d 957; cf., Matter of Campbell v Pesce, 60 NY2d 165, 167.) Thus, since respondent had, in his own words, ruled in error, he has the inherent power to vacate the plea, which would have been improper, prior to the imposition of sentence and to correct his own error and reinstate the previously dismissed charge (see, People v Bartley, supra, at 966; People v Pena, supra, at 393; People v Minaya, 54 NY2d 360, 364, cert denied 455 US 1024).
In that regard, this case is not similar to Matter of Crooms v Corriera (206 AD2d 275, Iv denied 84 NY2d 809), where the trial court vacated a guilty plea mistakenly negotiated by a prosecutor who had not properly communicated with his superiors. This Court took care to note, "The matter at bar clearly involves no error on the part of the court”. (Supra, at 278.) Here, as noted, the issue revolves around the court’s correction of its own error.
Nor, as petitioner argues, does Matter of Helbrans v Owens (205 AD2d 775, appeal dismissed and Iv denied 84 NY2d 861) dictate a different result. There, the Court improperly vacated, sua sponte, guilty pleas where the defendants apparently balked as the court, at sentence, offered defendants the choice of accepting enhancement of the promised sentences or withdrawing the pleas and proceeding to trial. Here, as respondent took pains to make clear, the guilty plea was the product of his own erroneous dismissal of a more serious charge, which dismissal respondent had the inherent power to correct. (See, People v Bartley, 47 NY2d, supra, at 966.)
Since respondent has the power to vacate the plea and restore the action to its pre-plea status, further proceedings are not barred by double jeopardy considerations. (See, Matter of Kisloff v Covington, 73 NY2d 445, 449.) In such circumstances there is no double jeopardy violation, since a vacatur of a guilty plea is not "the equivalent of an acquittal based on *287an adjudication as to the factual elements of the charge.” (People v Bartley, supra, at 967.) Moreover, since the proceeding did not "terminate” in a "judgment”—a conviction and the sentence imposed thereon (see, CPL 1.20 [15])—but only in a "conviction” by virtue of a guilty plea (see, CPL 1.20 [13]), the Double Jeopardy Clause of the United States Constitution is not offended. (Cf., People v Moquin, 77 NY2d 449, 455.)
Accordingly, the petition brought pursuant to CPLR article 78 to prohibit respondent from vacating defendant’s guilty plea with respect to the charge of criminal possession of a weapon in the fourth degree and to compel respondent to sentence him in accordance with the terms of a plea bargain, should be denied and the petition dismissed.