OPINION OF THE COURT
Alexander, J.Where a witness is called before a Grand Jury and, *351without having executed a waiver of immunity, gives testimony concerning the truthfulness of a prior sworn statement and disavows that prior statement as having been false when given, transactional immunity resulting from the compelled testimony is acquired with respect to that prior statement, and the witness may not thereafter be prosecuted for perjury based upon the inconsistency between the prior sworn statement and the Grand Jury testimony. Where such prosecution is threatened, a writ of prohibition under CPLR article 78 will lie to raise the claim of immunity and interdict the prosecution.
I
While standing outside a liquor store in Syracuse with two other men, petitioner Anthony Rush heard shots ring out. He was questioned by the police during the ensuing investigation and told them he saw one of the men, Lucas Bouges, shoot the victim, Leroy Johnson. He signed a sworn statement to that effect, which was the basis for the subsequent issuance of a felony complaint (CPL 100.20) and the arrest of Bouges. In the course of seeking an indictment against Bouges, the People called Rush to testify before the Grand Jury. Rush, without executing a waiver of immunity, told the Grand Jury he had lied in his sworn statement to the police; that in fact he never had seen Bouges shoot Johnson. Thereafter, a separate Grand Jury indicted Rush for the crime of second degree perjury (Penal Law § 210.10) charging that he swore falsely either when he gave his sworn statement to the police, or when he testified before the Grand Jury, because the statements were so inconsistent that one of them was necessarily false (Penal Law § 210.20). Rush moved to dismiss the indictment claiming that because he was granted transactional immunity in exchange for compelled testimony, he could not be prosecuted for any crime (including perjury) on the basis of his sworn police statement, nor could the People use the police statement as evidence against him in a prosecution for perjury allegedly committed before the Grand Jury. Trial court denied the motion but found that although the evidence was insufficient to support a charge of perjury in the second degree, it was sufficient to support the lesser included crime of perjury in the third degree. Trial court also rejected Rush’s immunity claim, holding that a Grand Jury witness has no immunity against a charge of perjury knowingly and intentionally com*352mitted before the same body. Rush then commenced a CPLR article 78 proceeding in the nature of prohibition at the Appellate Division seeking to enjoin his prosecution under the perjury indictment.
The Appellate Division granted Rush’s petition and dismissed the indictment, concluding that a proceeding pursuant to article 78 seeking a writ of prohibition is available to assert a claim of immunity from prosecution, and that, because Rush had acquired immunity from prosecution for and therefore could not be convicted of perjury as to the sworn statement given to the police, an indictment that would permit the jury to return a perjury conviction based on that sworn statement was fatally defective, and the court was without jurisdiction to try him thereunder. We granted leave to appeal (67 NY2d 604).1
II
The initial question we consider is whether the remedy of prohibition under CPLR article 78 is available to a petitioner to raise a claim of immunity from prosecution. We again observe that although CPLR 7803 (2) authorizes a proceeding under article 78 to test "whether the body or officer proceeded, is proceeding or is about to proceed without or in excess of jurisdiction”,2 the extraordinary remedy of prohibition lies only where there is a clear legal right, and only when a court (if a court is involved) acts or threatens to act either without jurisdiction or in excess of its authorized powers in a proceeding over which it has jurisdiction (Matter of Steingut v Gold, 42 NY2d 311, 315; Matter of Dondi v Jones, 40 NY2d 8, 13; La Rocca v Lane, 37 NY2d 575, 578-579; Matter of State of New York v King, 36 NY2d 59, 62; Matter of Proskin v County Ct., 30 NY2d 15, 18; Matter of Lee v County Ct., 27 NY2d 432, 436-*353437).3 Use of the writ is, and must be, restricted so as to prevent incessant interruption of pending judicial proceedings by those seeking collateral review of adverse determinations made during the course of those proceedings. Permitting liberal use of this extraordinary remedy so as to achieve, in effect, premature appellate review of issues properly reviewable in the regular appellate process would serve only to frustrate the speedy resolution of disputes and to undermine the statutory and constitutional schemes of ordinary appellate review (Matter of Dondi v Jones, supra, at p 21 [Breitel, J., dissenting]; La Rocca v Lane, supra, at p 579; Matter of State of New York v King, supra, at pp 63-64).
While we have heretofore allowed use of this extraordinary remedy in respect to pending criminal proceedings, we have stressed it should be available only when a court exceeds its jurisdiction or authorized power in such a manner as to implicate the legality of the entire proceeding, as for example, the prosecution of a crime committed beyond the county’s geographic jurisdiction (see, e.g., Matter of Steingut v Gold, 42 NY2d 311, supra). This type of error is to be distinguished from errors of substantive law or procedure committed within a proceeding which is properly maintainable, even though concededly "there is no sharp line between a court acting in error under substantive or procedural law and a court acting in excess of its powers, if only because every act without jurisdiction or in excess of [authorized] powers * * * of necessity involves an 'error of law’ ” (La Rocca v Lane, supra, at p 580). Notwithstanding the difficulty in drawing subtle distinctions, we have said, and now reiterate with emphasis, that prohibition will not lie as a means of seeking collateral review of mere trial errors of substantive law or procedure, however egregious the error may be, and however cleverly the error may be characterized by counsel as an excess of jurisdiction or power (Matter of Steingut v Gold, supra, at p 315; Matter of State of New York v King, supra, at p 62).
*354Even in those rare circumstances where an arrogation of power would justify burdening the judicial process with collateral intervention and summary correction, the writ of prohibition nonetheless does not issue as of right, but only in the sound discretion of the court (Matter of Dondi v Jones, supra, at p 13; La Rocca v Lane, supra, at p 579; see also, Matter of Culver Contr. Corp. v Humphrey, 268 NY 26, 39). In exercising that discretion, a court must weigh a number of factors: the gravity of the harm caused by the act sought to be performed by the official; whether the harm can be adequately corrected on appeal or by recourse to ordinary proceedings at law or in equity; and whether prohibition would furnish "a more complete and efficacious remedy * * * even though other methods of redress are technically available” (Matter of Dondi v Jones, supra, at p 14; La Rocca v Lane, supra, at pp 579-580; Matter of State of New York v King, supra, at p 62; Matter of Lee v County Ct., supra, at p 437; Matter of Culver Contr. Corp. v Humphrey, supra, at p 40).
Generally, the ordeal of a criminal trial and the possibility of conviction, by themselves, are insufficiently harmful to warrant use of the writ (Matter of Dondi v Jones, supra, at p 14). Moreover, the fact that the harm sought to be redressed implicates a constitutional right, does not necessarily command availability of the writ, for not all constitutional claims are cognizable by way of prohibition (see, e.g, Matter of Blake v Hogan, 25 NY2d 747 [prohibition does not lie where claim is denial of right to speedy trial]). Prohibition may lie, however, where the claim is substantial, implicates a fundamental constitutional right, and where the harm caused by the arrogation of power could not be adequately redressed through the ordinary channels of appeal. (La Rocca v Lane, supra, at pp 579-581.) Thus, for example, when a defendant is about to be prosecuted in violation of his constitutional right against double jeopardy, we have concluded that the harm that he would suffer — prosecution for a crime for which he cannot constitutionally be tried — is so great and the ordinary appellate process so inadequate to redress that harm, that prohibition will lie to raise the claim (see, e.g., Matter of Kraemer v County Ct., 6 NY2d 363).4
*355Here, petitioner raises a claim of similar magnitude. Although his claim of immunity from prosecution arising out of compelled testimony before a Grand Jury is grounded in a statutory grant of immunity (CPL 190.40), the statute grants such immunity in recognition of the fundamental constitutional privilege against self-incrimination.5 If petitioner is correct in his assertion of immunity, the prosecution threatened here would proceed in violation of his Fifth Amendment privilege, and the harm he would suffer would be — as in the case of double jeopardy — prosecution for a crime for which he cannot constitutionally be tried. Furthermore, the prosecution of a crime foreclosed by the protection of immunity implicates the propriety of the entire proceeding (accord, Matter of Brockway v Monroe, 89 AD2d 771, affd on other grounds 59 NY2d 179; Matter of Carey v Kitson, 93 AD2d 50). Consequently, we conclude that in the circumstances of this case, an article 78 proceeding in the nature of prohibition may properly be utilized to assert a claim of immunity from prosecution arising out of compelled testimony before a Grand Jury.
Ill
Turning to the merits, we conclude that the Appellate Division correctly determined that petitioner received immunity relating to his sworn statement to the police, and that therefore he may not be prosecuted for perjury based upon that sworn statement or through the use of that sworn statement. In our State, a witness at a Grand Jury proceeding is compelled to give any evidence legally requested (CPL 190.40 [l]).6 In exchange for that compelled testimony and in recognition of the witness’s constitutional privilege against self-incrimination, CPL 190.40 (2) confers automatic immunity from prosecution of any offenses concerning the compelled testi*356many, with exceptions not relevant here.7 CPL 50.10 (1), defining the scope of the conferred immunity, provides that a person who has been a witness in a legal proceeding8 cannot be prosecuted for any offense "on account of any transaction, matter or thing concerning which he gave evidence therein”, and we have interpreted this as a grant of full "transactional” immunity for any topic discussed by the witness within the scope of the proceeding (Matter of Brockway v Monroe, 59 NY2d 179, 189, supra; see also, People v Chin, 67 NY2d 22, 33, n 4, and cases cited therein).
The People argue that Rush was not called before the Grand Jury to ascertain whether he lied to the police, but to recount his observations at the scene of the homicide. Consequently, they contend, the immunity that Rush received does not extend to the truth or falsity of his statement to the police, but only to crimes relating to the transaction under investigation — the homicide. This record conclusively demonstrates, however, that petitioner’s statements that he lied to the police and never saw Bouges shoot Johnson were in direct response to the prosecutor’s questions concerning the veracity of the sworn statement petitioner had given to the police.9 *357Although this portion of petitioner’s testimony does not relate to the underlying transaction for which he was called to testify, the instant offense for which he was indicted was charged "on account of’ the prior sworn police statement, the veracity of which in fact became a subject of the prosecutor’s inquiry, no matter that it was not initially so intended (Matter of Brockway v Monroe, supra). Thus petitioner received full transactional immunity from prosecution of any offense "on account of any transaction, matter or thing concerning which he gave evidence”, including the truth or falsity of the sworn statement given to the police.
CPL 50.10 (1) provides further that a person who possesses transactional immunity by virtue of having been a witness in a legal proceeding "may nevertheless be convicted of perjury as a result of having given false testimony in such legal proceeding”.10 Petitioner’s transactional immunity, therefore, does not foreclose a prosecution for any perjury allegedly committed before the Grand Jury, and petitioner concedes as much.
Here, however, the People have charged petitioner with perjury in reliance on Penal Law § 210.20 which provides that "[w]here a person has made two statements under oath which are inconsistent to the degree that one of them is necessarily false * * * the inability of the people to establish specifically which of the two statements is the false one does not preclude a prosecution for perjury [and] the indictment * * * may set forth the two statements and, without designating either, charge that one of them is false and perjuriously made”. Under an indictment drafted pursuant to Penal Law § 210.20, the jury is not called upon to determine on which occasion the petitioner lied. Any guilty verdict would be based on the jury’s conclusion that he lied in either the one statement or the other. Therefore, this indictment permits the jury to consider *358the prior sworn police statement in order to reach a conclusion that petitioner committed perjury before the Grand Jury, or to find that petitioner told the truth to the Grand Jury, but lied in his sworn statement to the police. Conviction based upon the falsity of the sworn statement given to the police, however, is precluded by the immunity conferred upon petitioner when he testified before the Grand Jury regarding that statement. And, although the possibility of a conviction for perjury committed before the Grand Jury would not be precluded, the sworn statement given to the police may not be used to prove that perjury. Because this indictment would permit the jury either to convict petitioner of the very crime for which he has been granted immunity, or to use evidence of that crime to convict him of perjury committed before the Grand Jury, and because prosecution thereunder necessarily implicates a violation of petitioner’s privilege against self-incrimination, it is fatally defective.
The People argue that under Penal Law § 210.20, the offense of perjury does not arise until the second, and inconsistent, sworn statement is made. This argument is specious. Penal Law § 210.20 does not define a substantive offense, it merely provides a method of pleading and proving the already defined offense of perjury (Penal Law § 210.10). The People’s remaining arguments have been considered and found to be without merit.
Based upon the foregoing, the judgment of the Appellate Division should be affirmed.
Chief Judge Wachtler and Judges Meyer, Simons, Kaye and Titone concur; Judge Hancock, Jr., taking no part.
Judgment affirmed, without costs.
. By stipulation of the parties, the underlying criminal case (People v Rush) has been stayed pending determination of this appeal.
. For historical perspective, we note that originally, the English Kings issued writs of prohibition to restrict the powers of ecclesiastical courts over temporal matters and the remedy has since evolved into a basic means of protection for the individual in his relations with the State (Matter of Dondi v Jones, 40 NY2d 8, 12; La Rocca v Lane, 37 NY2d 575, 578). The remedy of prohibition is firmly rooted in our common law and has been codified in this State for many years (see, CPLR art 78; Civ Prac Act art 78; see also, Matter of Dondi v Jones, supra, at p 12; La Rocca v Lane, supra, at pp 578-579; see generally, Comment, Writ of Prohibition in New York — Attempt to Circumscribe an Elusive Concept, 50 St John’s L Rev 76, 76-84; Wolfram, "Ancient and Just” Writ of Prohibition in New York, 52 Colum L Rev 334, 338-353).
. Furthermore, in order for prohibition to lie, the writ must be directed to some inferior judicial tribunal or officer and must seek to prevent or control judicial or quasi-judicial action only as opposed to legislative, executive or administrative acts (Matter of Steingut v Gold, 42 NY2d 311, 315; Matter of Dondi v Jones, 40 NY2d 8, 13). There is no dispute here that "[a] public prosecutor is a quasi-judicial officer, who performs important duties within our judicial system, and is subject to prohibition under proper circumstances” (Matter of Dondi v Jones, supra, at p 13; see, e.g., Matter of Simonson v Cahn, 27 NY2d 1, 2 [article 78 proceeding brought to prohibit prosecution of a felony absent indictment by a Grand Jury]).
. We have permitted an article 78 proceeding in the nature of prohibition to interrupt pending criminal proceedings on other rare occasions. In La Rocca v Lane (37 NY2d 575), we permitted petitioner, a catholic priest and defense attorney, to use prohibition to vindicate a claimed violation of *355his First Amendment right of freedom of religion, and in Matter of Lee v County Ct. (27 NY2d 432), we permitted defendant-petitioner to use prohibition to vindicate a claimed violation of his Fifth Amendment privilege against self-incrimination.
. The United States Supreme Court has characterized the privilege against self-incrimination as " 'the hallmark of our democracy’ ” and "the essential mainstay of our adversary system” (Miranda v Arizona, 384 US 436, 460). See, Miranda, supra, at pp 458-466, for a comprehensive review of the roots, historical development and fundamental nature of the Fifth Amendment’s privilege against self-incrimination.
. CPL 190.40 (1) provides: "Every witness in a grand jury proceeding must give any evidence legally requested of him regardless of any protest or belief on his part that it may tend to incriminate him.”
. CPL 190.40 (2) provides that "[a] witness who gives evidence in a grand jury proceeding receives immunity unless * * * [h]e has effectively waived such immunity * * * or [s]uch evidence is not responsive to any inquiry and is gratuitously given or volunteered by the witness with knowledge that it is not responsive.”
. "Legal proceeding” is defined in CPL 50.10 (2) as "a proceeding in or before any court or grand jury, or before any body, agency or person authorized by law to conduct the same and to administer the oath or cause it to be administered”.
. The Grand Jury testimony in pertinent part was as follows:
"Q. [T]his is your statement you gave to the police that night?
"A. Yes.
"Q. Did you tell the truth to the police that night?
"A. No.
"Q. You lied to the police that night?
"A. I lied to the police.
"Q. Doesn’t it say in your statement, T have read this statement which consists of one page and the facts contained therein are true and correct to the best of my knowledge. I have also been told that swearing to a false statement can make me guilty of perjury.’ Did the cop—
"A. Didn’t I just tell you I lied to you?
"Q. So you lied under oath to the policemen?
"A. Right.
* * *
*357"Q. Why did you lie to the police?
"A. Because I lied.”
. The Appellate Division based its determination in part upon its reading of this second sentence of CPL 50.10 (1), concluding that because petitioner’s sworn statement to the police was not given, in "a legal proceeding”, the CPL 50.10 (1) exception does not apply and the People may not charge petitioner with perjury based on that statement. This analysis implies that had petitioner’s prior sworn statement been made in "a legal proceeding” as that term is defined in CPL 50.10 (2), the instant perjury charge might have fallen within the statutory exception and been permissible. We find it unnecessary to consider that possibility since we conclude • that this indictment must, in any event, be dismissed.