delivered the opinion of the court.
The relief sought in this action is damages for an alleged violation and restraint of plaintiff’s personal liberty. A demurrer to the complaint on the ground that it did not state facts sufficient to constitute a cause of action was sustained. Plaintiff suffered judgment of dismissal, from which she appeals.
The complaint alleged the official capacity of defendant as police magistrate of a town in this state; that on August 13, *1181925, at this town, defendant wilfully, wrongfully, maliciously and unlawfully, and without any legal justification, violated and restrained plaintiff’s personal liberty by exceeding his jurisdiction during and at the conclusion of an alleged trial of defendant in which the town was plaintiff and she was defendant, as follows: By not informing her of her right to counsel; not requiring her to waive time to plead; not ascertaining if she required witnesses on her behalf; not setting the case for trial (the trial being for the violation of Ordinance No. 28 of the town, being an ordinance prohibiting the sale of intoxicating liquors); in sentencing her to pay a $500 fine or to serve a term of ninety days in the county jail, and in issuing and placing a mittimus in the hands of an officer for execution; that plaintiff was, pursuant to the terms of the commitment, placed in the county jail, where she remained until released by order of the district court; that the mittimus or commitment was in the disjunctive or alternate form; that plaintiff’s detention was illegal, the ordinance void; and that defendant exceeded his jurisdiction in sentencing her to a term of ninety days in jail, when the maximum sentence imposed by the ordinance was sixty days. General and special damages are alleged.
As error, plaintiff specifies the sustaining of the demurrer and the failure to give her time to amend her complaint.
The allegation that defendant was acting as a town magistrate, in the trial of an action in which the town was plaintiff and the plaintiff herein was defendant, raises a presumption that his acts were prima facie judicial.
This court, in the case of Grant v. Williams, 54 Mont. 246, 169 Pac. 286, speaking through Mr. Chief Justice Brantly, said: “The rule is well established by the current of authority that a judicial officer cannot be held liable for damages in a civil suit for any act of his in that capacity, if he had jurisdiction of the subject matter and of the persons whose rights were affected by the particular proceeding. In this respect no *119distinction is made between judges of courts of general and those of inferior and limited jurisdiction. The immunity is not extended to these officers to protect them as individuals, but for the protection of society, upon the theory that the interests of society are best served if the judicial officer is left entirely free to act upon his independent convictions, uninfluenced by fear or apprehension of consequences personal to himself. The rule extends even to acts grossly erroneous or prompted by corrupt or malicious motives, provided only they are done within jurisdiction clearly conferred.”
The above language has since been quoted by this court in the ease of State ex rel. Loundagin v. Tattan, 56 Mont. 211, 181 Pac. 984. We take this occasion to again expressly approve the same.
Police courts are established under sections 8843 and 5087, Revised Codes of 1921, and have the jurisdiction provided by sections 5088, 5089, Id. There is, moreover, a presumption that official duty has been regularly performed. (Sec. 10606, Rev. Codes 1921.) If this presumption is to be indulged in favor of the defendant, the fact that he entertained the action for a violation of the town ordinance, coupled with the fact that he was a police magistrate of the town, warrants the prima facie conclusion that he was acting within his jurisdiction. (Grant v. Williams, supra.)
We are not concerned with the question of the validity of the ordinance for the violation of which the prosecution was brought, in that the act of determining this was within the jurisdiction of the magistrate. (Bohri v. Barnett (C. C. A.), 144 Fed. 389; Hayes v. Hutchinson & Shields, 81 Wash. 394, 142 Pac. 865.)
Having judicially determined that his authority extended over the particular offense, and jurisdiction being prima facie presumed, the defendant is protected in such act, as well as his subsequent judicial acts, against civil liability under the rule of judicial immunity. (State ex rel. Loundagin v. Tattan, supra; Grant v. Williams, supra.)
*120To make out a cause of action it was necessary for the plaintiff to state facts sufficient to overcome this presumption and to disclose wherein the magistrate was without jurisdiction. In this connection this court has held that “the most extravagant use of the terms ‘wrongfully’ and ‘unlawfully’ will not serve to relieve the pleader of the necessity of stating facts upon which issue may be joined.” (Grant v. Williams, supra.) The facts pleaded, rather than showing that the defendant acted without jurisdiction, show merely that he acted in excess of his jurisdiction, and as such were insufficient to overcome the presumption that the defendant. did not act without jurisdiction. (State ex rel. Loundagin v. Tattan, supra; Bradley v. Fisher, 13 Wall. 335, 352, 20 L. Ed. 646.)
No necessity arises for passing upon whether or not the issuance of the mittimus was a nonjudieial act, in that it is not alleged that it did not conform to the judgment. A defendant is detained by virtue of the judgment, the mittimus serving merely to carry it out. (Comstock v. Eagleton, 11 Okl. 487, 69 Pac. 955; Criminal Law, 16 C. J., sec. 3119.)
Under section 9186, Eevised Codes of 1921, a plaintiff has the right to amend his complaint once, without leave of court after a demurrer is filed to it, provided he does so before the demurrer is presented to the court for decision. But if the demurrer is sustained, the defendant is entitled to judgment forthwith, unless the court in its discretion gives the plaintiff leave to amend. The plaintiff does not have a positive right to amend his pleading after a demurrer to it has been sustained. His right to amend afterward is always a matter of grace, not of right, unless the circumstances are such that it would be an abuse of discretion to refuse to allow the amendment. Ordinarily, however, the trial court should be liberal in allowing amendments where the defect in the complaint is one of form only. (Secs. 9187 and 9189, Rev. Codes 1921; Billesbach v. Larkey, 161 Cal. 649, 120 Pac. 31; Galusha v. Fraser, 178 Cal. 653, 174 Pac. 311.) The refusal to grant such permission will not be disturbed upon appeal, In *121the absence of a showing of abuse of that discretion. (Kleinclaus v. Dutard, 147 Cal. 245, 81 Pac. 516; Stewart v. Douglass, 148 Cal. 511, 512, 83 Pac. 699; Hansen v. Carr, 73 Cal. App. 511, 238 Pac. 1049.)
Rehearing denied January 20, 1927.
In the instant case the record does not disclose that plaintiff ashed leave to amend, or that permission was denied her by the trial court. The order sustaining the demurrer merely omits to include a grant of leave to amend. The judgment of dismissal, which is dated over three months after the decision upon the demurrer, affirmatively discloses in its recitals a failure of the plaintiff to apply for leave to amend.
Upon this record we must assume that no offer of amendment was made; accordingly, the plaintiff is confronted with the difficulty of asking this court to hold that there was an abuse of discretion on the part of the trial court in denying something that was never sought until after the appeal was taken. (Hansen v. Carr, supra.)
The judgment is affirmed.
Affirmed.
Mr. Chief Justice Callaway and Associate Justices Galen, Stark and Matthews concur.