Mitchell, J.
By Sp. Laws 1889, c. 403, the legislature established a justice’s court in the sixth Ward of the city of St. Paul, and provided for the election of such justice at the next general city election, and every two years thereafter. By the fourth section of the act the mayor of the city was authorized to appoint the first justice, who should hold the office until the next city election, and until his successor should be elected and qualified. The respondent McMartin is occupying the office and performing its duties, under appointment by the mayor, pursuant to the provisions of this act. A civil action, within the jurisdiction of justices of the peace, was commenced against the relator before the respondent as such justice, in which a summons has been issued. The relator asks for a writ of prohibition to restrain and prevent the respondent from proceeding further in the action, on the ground that he is not a justice of the peace, and has no authority to act as such, for the reason that the provision of the act in question, assuming to confer upon the mayor the power to fill the office by appointment, is unconstitutional. This part of the act is entirely separate and distinct from the provisions creating the court or office, and hence, even assuming that the former is invalid, the latter are valid. We have, then, a case where the court or office was legally created, and the illegality, if any, consists in an attempt to fill it by appointment, for the period indicated, in a way not authorized by the constitution. On these facts, *31according to all the authorities, the respondent is a justice de facto. That his title to the office cannot be tried on a writ of prohibition, but only on information in the nature of quo warranto, is too well settled to' require discussion. The office of the writ of prohibition is to prevent inferior tribunals from usurping a jurisdiction with which they are not legally vested. It may also issue to a person or body of persons assuming to exercise the functions of a pretended court, when in fact no such court had ever been constitutionally established, for as is said in State v. Young, 29 Minn. 474, 523, (9 N. W. Rep. 737,) the same reasons might exist for arresting their action as in the case of a court exceeding its jurisdiction. In both cases there is the exercise of unauthorized judicial power, which is regarded as a contempt of the sovereign. But in the present case neither of these conditions exists, for it is conceded that the-court was lawfully established, and it is not pretended that respondent has done or is threatening to do anything in excess of the jurisdiction of that court. Counsel argues that relator has no other available remedy for the wrong that is about to be done to him, and that, inasmuch ‘as there must be a remedy for every wrong, therefore a writ of prohibition will lie. But the fallacy consists in the assumption that relator is threatened with any wrong. Respondent being a justice de facto, his acts are as valid as if he was a justice de jure. In fact, as to everybody except the state in proceedings by quo warranto to test his right to the office, he is, in effect, a justice de jure.
Rule discharged.