OPINION OF THE COURT
Sweeney, J. P.This is an article 78 proceeding in the nature of prohibition. The facts are not in dispute. Petitioner was charged in a three-count indictment with crimes of burglary in the first degree, grand larceny in the third degree and criminal mischief in the fourth degree. As a result of plea bargaining, petitioner was permitted to plead guilty to the misdemeanor of attempted grand larceny in the third degree in full satisfaction of the indictment. On August 20, 1979, she was sentenced to a term of probation for three years.
Subsequently, the court became aware of section 70.02 of the Penal Law which classifies certain offenses, including burglary in the first degree, as violent felony offenses. Pursuant to the statute, the court is prohibited from accepting a guilty plea to anything less than a class D felony for such an offense (CPL 220.10, subd 5, par [e]). The court ordered a hearing and, thereafter, on September 10, 1979, sua sponte, *159vacated the guilty plea as well as the sentence and ordered petitioner to stand trial on the original indictment. The instant proceeding resulted.
It is petitioner’s contention that the court lacked the authority to vacate her plea without her consent and, in any event, that a second trial would violate the double jeopardy provisions of the Federal and State Constitutions.
We must first dispose of the threshold issue of whether this article 78 proceeding in the nature of prohibition should be entertained. It is an extraordinary remedy issued only in the sound discretion of the court (Matter of B. T. Prods, v Barr, 44 NY2d 226, 231; Matter of Dondi v Jones, 40 NY2d 8, 13). Considering that the defendant is threatened with jeopardy for a second time, we are of the opinion that it is appropriate to consider whether the trial court should be restrained from proceeding with the prosecution of defendant (see Matter of Di Lorenzo v Murtagh, 36 NY2d 306).
We now pass to the merits. Concededly, the Judge, District Attorney and defense counsel were not aware of section 70.02 of the Penal Law at the time of the plea or the time of the imposition of sentence. The plea bargaining was in good faith and defendant believed she was to be permitted to plead guilty to a misdemeanor in full satisfaction of the indictment and receive a sentence of three years’ probation. In spite of this background, the plea was erroneous as a matter of law and the plea bargain a nullity (People v Bartley, 47 NY2d 965). The Legislature had the power to proscribe the acceptance of a guilty plea to anything less than a class D felony whenever a violent felony offense is charged. The court was bound to apply the law as enacted by the Legislature. The same reasoning applies with equal force and effect to the sentence. It was, therefore, erroneous as a matter of law as contrary to existing law (People v Rodriguez, 70 AD2d 509; People v Miller, 38 AD2d 745). Under these circumstances, the court not only had the power, but the inherent duty to correct the error.
It has recently been established that reprosecution is permissible even after jeopardy has attached so long as there is no adjudication as to the factual elements of the charge (United States v Scott, 437 US 82, 92; People v Key, 45 NY2d 111). In the instant case there was no adjudication of factual guilt or innocence and, consequently, defendant’s constitutional right not to be twice put in jeopardy remains una*160bridged (People v Bartley, supra; People v Key, supra). The application for prohibition should be denied.
The petition should be dismissed, without costs.
Staley, Jr., Main, Mikoll and Herlihy, JJ., concur.
Petition dismissed, without costs.