*82The opinion of the court was delivered by
Harvey, J.:This is an action for damages for false imprison-
ment. Defendant’s demurrer to the petition was overruled, and he has appealed. The sole question before us is whether the petition states a cause of action.
The pertinent averments of the petition may be thus stated: The defendant was judge of the court of Topeka. That court has the jurisdiction of justices of the peace in civil and criminal actions (R. S. 20-1902), and the act creating the court gave the judge of the court the power and jurisdiction of justices of the peace in preliminary examinations of persons accused of felony. (State v. Pigg, 80 Kan. 481, 487, 103 Pac. 121.) In November, 1929, H. G. Brown, the plaintiff in this action, filed a complaint in the court of Topeka charging one T. A. Payette with committing a felonious assault upon him with a deadly weapon, with intent to kill or do great bodily harm. On December 10, 1929, that complaint came on for hearing before the defendant, sitting as judge of the court of Topeka. After hearing the evidence the defendant stated that the evidence was hardly sufficient to justify the court to find that there was probable cause to believe T. A. Payette was guilty of a felonious assault, but that he did think that T. A. Payette was guilty of an assault, and made his order that the defendant, T. A. Payette, be discharged and that the costs in that case be taxed to the complaining witness, H. G. Brown, the plaintiff here, and that he be held in custody of the marshal and confined in the j ail of Shawnee county until the costs were paid; and that thereafter, and on the same day, he issued an order of commitment which was placed in the hands of the marshal, who, with the sheriff, arrested H. G. Brown and imprisoned him in the jail for a period of five or six hours, and until he was released by proceedings in habeas corpus. It is alleged that the judgment of the judge of the court of Topeka that H. G. Brown should be committed to jail until the costs were paid, and the issuing of the commitment by which he was placed in jail, were acts not within the jurisdiction of the judge of the court of Topeka, and were without authority in law, and were not justified by the facts, and were wrongfully and maliciously done for the purpose of injury to H. G. Brown, the plaintiff herein, and that he was injured thereby in a sum named, for which plaintiff prayed judgment.
The first question argued is: Did the defendant, as judge of the *83court of Topeka, have jurisdiction to render the judgment that the plaintiff be committed to jail on his failure to pay the costs, and to issue the order of commitment under the authority of which he was placed in jail? This question must be answered in the negative. The statute (R. S. 62-1903) governing the matter reads as follows:
“If a person charged with a felony shall be discharged by th'e officer taking his examination, or if recognized or committed for any such offense and no indictment or information be preferred against him, the costs shall be paid by the proseouting witness, unless the court shall find that there was probable cause for instituting the prosecution, and that -the same was not instituted for malicious motives.”
In In re Heitman, Petitioner, 41 Kan. 136, 21 Pac. 213, on a preliminary examination, a justice of the peace had discharged the defendant and had taxed the costs to the prosecuting witness and adjudged that if he did not pay the costs that he be committed to jail until they were paid, and where the prosecuting witness had been committed to jail for a failure to pay the costs it was held, in the habeas corpus proceeding, that the imprisonment was illegal. In the opinion it was said:
“Imprisonment as a means of enforcing a judgment for costs or for any other purpose cannot be employed or imposed, except the authority therefor is clearly conferred by the statute. (Citing In re Mitchell, Petitioner, 39 Kan. 762, 19 Pac. 1.)” (p. 138.)
This language was quoted approvingly in In re Grinstead, 64 Kan. 780, 781, 68 Pac. 638.
There is a statute (R. S'. 63-310) relating to the trial of misdemeanor cases before a justice of the peace which provides that if the defendant, tried under the provisions of the act, shall be acquitted, he shall be immediately discharged, “and if the justice or jury trying the case shall state in the finding that the complaint was malicious or without probable cause,” the justice shall tax the costs to the complaining witness and commit him to jail until the costs are paid, unless he shall execute a bond for their payment within thirty days. There is a similar statute (R. S. 62-1902) relating to trial of criminal cases in the district court, but neither of these statutes is applicable to a preliminary examination for a felony. Both of them relate to the trial of a criminal charge upon its merits before a court, or a court and jury.
It must be held, therefore, that the defendant, sitting as judge of *84the court of Topeka, and conducting the preliminary examination as stated in the petition in this case, had no power or authority to order the complaining witness committed to jail for the failure to pay costs, or to issue a commitment therefor, and that his acts in doing so are illegal.
We pass now to the more important question of whether the defendant is liable in damages for the judgment and order by which plaintiff was committed to jail. This requires the consideration — in such a way that neither of them will be destroyed — of two principles which are necessarily fundamental in government. The first of these is that no citizen of our government should be imprisoned unless the authority therefor is clearly conferred by statute. This principle is so elemental and so essential to a free government that no authorities in support of it are needed, although many could be furnished. The second principle is that the judges of our courts must be free to exercise their best judgment on any matter pending before them without the fear of being held liable in damages if their ruling should prove to be erroneous. (Bradley v. Fisher, 11 Wall [U. S.] 335, 20 L. Ed. 645.) In 11 R. C. L. 813 it is said:
“It has always been a doctrine of the common law, and seems essential to the maintenance of any system of courts, that the judges whose duty it is to pass on and determine controversies should not be liable to be sued personally for their errors or alleged errors.”
See, to the same effect, 25 C. J. 515. Introducing an annotation on this subject in 13 A. L. R. 1345, it is said:
“The law of the United States and of England with reference to the personal liability of judges and other judicial officers depends, for the most part, on the question of jurisdiction. On the existence or nonexistence of jurisdiction depends immunity from, or liability for, acts done by a person while acting in a judicial capacity. If the jurisdiction of such person is complete, and attaches both to the person and the subject matter, then, no matter how erroneous his judgment may be, so long as he acts within the scope of his. jurisdiction and in a judicial capacity, no personal liability attaches to him. On the other hand, if he acts wholly without jurisdiction, his judicial office can afford him no protection. As to the'se principles there is no conflict among the authorities, but beyond these general statements the formulation of general rules is difficult.”
Based on the question of jurisdiction, it is generally held that, judges of courts of general jurisdiction are immune from personal liability. The reason for this is that the jurisdiction of such courts extends to all matters which may arise in court, and it is practically *85impossible for a question to be presented to the court with respect to which it does not have jurisdiction. This is not true, of course, of courts of limited jurisdiction, such as police courts, examining magistrates, justices of the peace, probate courts, and the like. Within the respective jurisdictions of such inferior courts their judges are immune from personal liability, just as judges of courts of general jurisdiction are, but it is possible for a question to arise before the judges of such courts which is not within their jurisdiction. This necessarily follows from the fact that they are courts of limited jurisdiction.
We deem it unnecessary to quote extensively from the authorities. The general doctrine of liability of judges is discussed in the text above cited, also 33 C. J. 981, and the cases that are collected in 13 A. L. R. 1345; 55 A. L. R. 282; and in the Decennial Digest under the title, “False Imprisonment,” Key number 7 (2). Some of our own cases bearing on the question are as follows: Clark v. Spicer, 6 Kan. 440; Prell v. M’Donald, 7 Kan. 426; Gillett v. Thiebold, 9 Kan. 427; Hauss v. Kohlar, 25 Kan. 640; Connelly v. Woods, 31 Kan. 359, 2 Pac. 773; In re Heitman, Petitioner, 41 Kan. 136, 21 Pac. 213; Harrison v. Redden, 53 Kan. 265, 36 Pac. 325; Smith v. Casner, 2 Kan. App. 591; Sorensen v. Wellman, 69 Kan. 637, 77 Pac. 536; Smith v. Hern, 102 Kan. 373, 170 Pac. 990; Bellport v. Harkins, 104 Kan. 543, 180 Pac. 220.
These authorities are almost unanimously to the effect that when the judge of a court of limited jurisdiction, with respect to a matter not within the jurisdiction of the court, makes an order as the result of which one is unlawfully imprisoned, and especially when he does so willfully and maliciously, as is alleged in the petition in this case, he is personally liable for such false imprisonment. The decisions of this court axe in harmony with that view. The allegations of the petition in this case bring it within that rule.
From what has been said it necessarily follows that it was not error for the court below to overrule the demurrer to the petition. Its judgment is affirmed.