OPINION OF THE COURT
Saxe, J.The District Attorney of Bronx County brings this CPLR article 78 petition seeking relief in the nature of a writ of prohibition against respondent Supreme Court Justice. The petition challenges a ruling made following the conviction of respondent Scott Ortiz, after a jury trial, of burglary in the third degree. In the context of the People’s application that convicted defendant Ortiz be sentenced as a persistent felony offender, the defendant served opposition challenging the constitutionality of the statutory scheme for the discretionary sentencing of a defendant as a persistent felony offender (see Penal Law § 70.10 [2]; CPL 400.20 [5]), relying on the line of United States Supreme Court cases beginning with Apprendi v New Jersey (530 US 466, 490 [2000]) and culminating with Blakely v Washington (542 US 296 [2004]) and United States v Booker (543 US 220 [2005]). The defendant based his objection on the portion of CPL 400.20 (5) which directs that once the predicate convictions are proven beyond a reasonable doubt, the court may consider “Matters pertaining to the defendant’s history and character and the nature and circumstances of his criminal conduct” which are proved by a preponderance of the evidence. He argued that this provision violates the rule that any fact (other than the fact of a prior conviction) that increases the penalty for a crime beyond the prescribed statutory maximum must be submitted to a jury and proved beyond a reasonable doubt (see Apprendi, 530 US at 490; Booker, supra).
In recognition of the fact that the Court of Appeals has twice upheld the constitutionality of CPL 400.20 (5) (see People v Rosen, 96 NY2d 329 [2001], cert denied 534 US 899 [2001]; People v Rivera, 5 NY3d 61 [2005], cert denied — US —, 126 S Ct 564 [2005]), respondent Justice properly rejected the defendant’s constitutional challenge to the statute. However, he *81then ruled that at the hearing, once the fact of the defendant’s prior convictions was proved beyond a reasonable doubt, any additional facts pertaining to the defendant’s history and character that the People want him to consider must also be proved beyond a reasonable doubt, despite the statute’s directive that a preponderance of the evidence standard be used for such considerations. He explained that this aspect of his ruling was “as a prophylactic against any further refinement of Rivera (and Rosen).” (11 Misc 3d 192, 198 [2005].)
The Bronx District Attorney therefore brings this proceeding, seeking a writ prohibiting respondent Justice from imposing a higher standard of proof than that provided by the direction of CPL 400.20 (5). He argues that the challenged ruling, imposing a heightened standard of proof, is a gross abuse of power, and further, that no remedy will be available through direct appeal. Respondent defendant counters that the article 78 remedy is unavailable in this context, inasmuch as it involves a discretionary ruling.
We agree that the challenged ruling is erroneous, as it is contrary to the Legislature’s specific directive regarding the burden of proof to be applied to evidence of the defendant’s character and history. The court does not have discretion to impose a different burden of proof than that directed by the Legislature.
However, the fact that a ruling is incorrect is not enough to permit article 78 review. “[E]rrors of law . . . are not to be confused with a proper basis for using the extraordinary writ” (Matter of State of New York v King, 36 NY2d 59, 62 [1975]). Even egregious errors in pretrial and trial rulings, such as the erroneous exclusion of important evidence, do not form a proper basis for an article 78 challenge, regardless of the fact that the People have no appellate recourse to correct the ruling. “Prohibition is ‘never available merely to correct or prevent trial errors of substantive law or procedure, however grievous’ ” (Matter of Hirschfeld v Friedman, 307 AD2d 856, 858 [2003], quoting La Rocca v Lane, 37 NY2d 575, 579 [1975], cert denied 424 US 968 [1976]).
Article 78 relief is available, though, “to prevent a court from exceeding its authorized powers in a proceeding over which it has jurisdiction” (Matter of Pirro v Angiolillo, 89 NY2d 351, 355 [1996] [internal quotation marks omitted]; see also People v Dunn, 4 NY3d 495 [2005]). If, and only if, the court has exceeded its authorized powers, does it become relevant whether another available remedy exists; that is, “nonreviewability by way of ap*82peal alone, does not provide a basis for reviewing error by collateral proceeding in the nature either of prohibition or mandamus” (Matter of State of New York v King, 36 NY2d at 63).
“Although the distinction between legal errors and actions in excess of power is not always easily made, abuses of power may be identified by their impact upon the entire proceeding as distinguished from an error in a proceeding itself proper” (Matter of Holtzman v Goldman, 71 NY2d 564, 569 [1988] [citations omitted and emphasis added]). That is, “prohibition is available only when a court exceeds its jurisdiction in a manner that implicates the legality of the proceeding itself ’ (Matter of Hirschfeld v Friedman, 307 AD2d at 858 [emphasis added]).
Therefore, the central issue here is whether the court’s challenged action was simply an error of substantive law or procedure, as opposed to an action taken in the absence of the necessary authority to act, in a manner implicating the legality of the proceeding itself.
A prime example of an unappealable error of substantive law or procedure for which article 78 relief is unavailable can be found in Matter of State of New York v King (supra), where the trial court, contrary to CPL 270.25, improperly afforded defendants in a murder trial 30 peremptory challenges, although the statute prescribed that they be given 20 (36 NY2d at 61). The clear violation of the procedural statute, to the detriment of the People, nevertheless did not implicate the legality of the proceeding itself.
Article 78 relief was also found to be unavailable by this Court in Matter of Hirschfeld v Friedman (supra), where the petitioner claimed that the court lacked personal jurisdiction over him, rendering its contempt determination against him improper. This Court observed that even if the court lacked personal jurisdiction, “[Respondent Justice plainly had subject matter jurisdiction over [the proceeding]” (at 858).
Circumstances in which a court was found to have exceeded its jurisdiction in a manner implicating the legality of the proceeding itself, can be found in Matter of Pirro v Angiolillo (supra). In that case, the trial judge, weeks after the convicted defendant began serving his sentence, granted the defendant’s motion to modify the sentence. The Court of Appeals held that article 78 was the proper vehicle to challenge the court’s action, since the People contended that the judge lacked the statutory power to alter the defendant’s term of incarceration, because *83CPL 430.10 provides that a “sentence may not be changed, suspended or interrupted once the term or period of the sentence has commenced” (89 NY2d at 355). In response to the suggestion that the challenged action was mere legal error, the majority noted that the Court had consistently treated “sentencing dispositions outside the statutory prescriptions as flaws rising to the level of jurisdictional defects” (id. at 356 n 4 [citations omitted]).
A writ of prohibition was also deemed to be the proper relief for a challenge to a trial court’s sua sponte vacatur of a defendant’s conviction, which had been granted in reliance on Judiciary Law § 2-b (3), which was inapplicable (see People v Dunn, supra). The Court explained that a writ was the proper form of relief for the People to seek because the trial court had clearly acted in excess of its authorized powers (4 NY3d at 497).
Similarly, in Matter of Holtzman v Goldman (supra), it was held that a judge who issued a trial order of dismissal although no evidence had been presented had acted in excess of his authority. Although CPL 290.10 (1) (a) authorized the court to issue such an order upon motion of the defendant at the conclusion of the People’s case, the Court explained, the court is not authorized to issue such an order under other circumstances: “[t]he court ‘has power to do for some purposes what it lacks power to do for others’ ” (71 NY2d at 570, quoting Matter of Proskin v County Ct. of Albany County, 30 NY2d 15, 20 [1972]).
Here, unlike the courts’ actions in Matter of Pirro v Angiolillo and People v Dunn, the sentencing court possessed the authority under the Criminal Procedure Law to perform each act: to hold a persistent felony offender hearing, to admit and weigh evidence, and to arrive at a determination, in its discretion, as to whether the defendant should be sentenced as a persistent felony offender, and then to determine the appropriate sentence within the range dictated by the applicable statute. The statute which is being contravened is not one which gives, or relieves the court of, authority. Rather, it is merely one which directs the court in the procedures to employ when undertaking its assigned task. This error of procedure, even if grievous, is comparable to the court’s violation of a statutory procedural directive in Matter of State of New York v King, and is distinguishable from the court’s acting in the absence of statutory authorization to do so, or in violation of a prohibition against taking any such action.
While the error here occurred in the context of sentencing, it did not fall within the category of “sentencing dispositions *84outside the statutory prescriptions” which the Court of Appeals in Matter of Pirro v Angiolillo referred to as “flaws rising to the level of jurisdictional defects” (89 NY2d at 356 n 4). We note that the cases cited by the Court in that matter all involved allegedly illegal sentences which were challenged on direct appeal; none involved article 78 relief {see People v David, 65 NY2d 809 [1985]; People v Morse, 62 NY2d 205, 214 n 2 [1984], appeal dismissed sub nom. Vega v New York, 469 US 1186 [1985]; People v Fuller, 57 NY2d 152, 155 [1982]).
Since the court was not acting in the absence of authority, the question of whether another adequate remedy is available to petitioner may not be reached {see Matter of State of New York v King, supra).
Accordingly, the application pursuant to CPLR article 78 for a writ of prohibition to prevent respondent Supreme Court Justice from imposing an incorrect standard of proof on the People’s evidence in a persistent felony offender hearing, should be denied, and the petition dismissed, without costs.
Buckley, P.J., Tom, Gonzalez and Malone, JJ., concur.
Application for an order pursuant to CPLR article 78 for a writ of prohibition, seeking to prevent respondent Supreme Court Justice from imposing a certain standard of proof on the People’s evidence in a persistent felony offender hearing, denied and the petition dismissed, without costs.