[7] 5. We recognize the oft-repeated rule that a writ of prohibition is not a writ of right, but instead, is one of sound judicial discretion that is issued or withheld according to the circumstances of each particular case, and which is used with great caution in the furtherance of justice, where it is plain that the court, officer, or person against whom it is sought is about to exercise some judicial or quasi judicial power; the exercise of which is clearly unauthorized by law and will result in injury for which no other adequate remedy exists. State ex rel. Harvey v. Medler, 19 N. M. 252, 142 Pac. 376; Crist v. Abbott, 22 N. M. 417, 163 Pac. 1085; and State ex rel. Parks v. Ryan, 24 N. M. 176, 173 Pac. 858.
[8] All of these elements, however, are present in this case. As we have previously determined, the trial court was proceeding in a judicial capacity without jurisdiction; the injury that petitioners might suffer was the imposition of a fine or a jail sentence for contempt; it appears that an appeal from such a judgment and sentence would necessarily involve a great expense, as a large amount of testimony has already been taken with a very large number of written exhibits introduced, and there would make the cost of appeal almost prohibitive. Under such circumstances, the remedy by appeal is not an adequate one. In Crist v. Abbott, supra, Judge Parker, speaking for the court, said:
“In this case, however, taking into consideration the fact that an election contest necessarily involves a long trial, the taking of a large amount of testimony at a great expense to the parties, and where, as we hold, it is plain that the district court has absolutely no jurisdiction of the contest proceeding, the remedy by appeal is not such an adequate remedy as should move our discretion to refuse the writ of prohibition.”
The language there used is peculiarly applicable here, and, for the reasons stated, we think our discretion should be exercised in favor of the issuance of the writ.