This was an action to recover damages for' an alleged illegal or false imprisonment. The suit was brought in the district court for Webster county, and the allegations of the petition were in substance as follows: That the defendant, Isaac W. Edson, was the county judge of Webster county, Nebraska; that the plaintiffs were, and had been for more than thirty years, husband and wife; that they resided in the vicinity of Inavale, and were well known to the defendants, as well as throughout a large part of Webster county; that on July 12, 1902, the defendant Ayers, as plaintiff, filed his petition and commenced his action in the district court for Webster county against the plaintiffs, and one Adelbert I. Walker, as administrator of the estate of Allen T. Ayers, deceased, and caused a summons to be issued therein for the defendants, the plaintiffs herein, only, and caused the said summons to be served on them, the answer day therein being fixed on August 11,1902; that at the time of the acts complained of, no other summons had been issued in that action, and no appearance or other pleadings of any nature had been filed therein; that the defendant, Ayers, delivered said summons to the sheriff of Webster county for service, and also delivered therewith to the said officer a notice in customary form, stating that on July 15, 1902, the plaintiff in that action would take the depositions of the plaintiffs herein at the office of Fred E. Maurer, in Red Cloud, Webster county, Nebraska, and caused said notice and summons to be served on the plain*19tiffs, and on the 11th day of July caused a subpoena to be issued by the said Fred E. Maurer, as notary public, and served by the sheriff, commanding the plaintiffs to appear and give their depositions in said action before said Maurer as a notary public; that the plaintiffs appeared before said officer and made known to him that they were, and for many years had been, residents of Webster county, and that they had no present intention of absenting themselves therefrom, either permanently or temporarily; that neither of them was aged, sick or infirm so as to interfere with their being present and giving testimony at the trial of said cause; that no order of the district court or a judge thereof, authorizing or permitting the taking of their depositions, had been asked for or obtained; that the attempt to take their said depositions was not in good faith, but for the purpose of harassing and vexing them; that they were husband and wife, and that they each objected, on that ground, to either of them being required to be sworn or affirmed, or become or testify as witnesses on béhalf of the plaintiff in said cause; that they thereupon refused to give their depositions; that the plaintiff Ayers, one of the defendants herein, requested the notary to commit the plaintiffs for contempt, which request was refused; that afterwards, on July 21, 1902, the defendants, Ayers and Edson, agreeing together, and well knowing the facts, maliciously, for the purpose of further harassing the plaintiffs, and illegally compelling them to give their depositions in said cause, caused another notice to be issued and served on them for the purpose of taking their depositions in behalf of said Ayers, in said cause, at the office of the defendant Edson, county judge, who thereupon issued a subpoena requiring the plantiffs to appear and give their testimony by deposition in conformity with such notice, which subpoena was duly served on the plaintiffs who, in obedience thereto, appeared before said county judge and made known to him substantially the same facts which had been made known to the notary public, and which facts and objections were reduced to writing, sworn *20to and filed by each of the plaintiffs with the said county judge; that they thereupon again refused, for said reason, to submit or gire their depositions before said judge as witnesses on behalf of said Ayers; that thereupon the defendant Edson, on the demand of defendant Ayers, knowingly, maliciously, arbitrarily and oppressively, without right, jurisdiction or authority of law, made and entered an order finding the plaintiffs guilty of contempt in refusing to give their depositions, and committed them to the common jail of the county until they should submit to be sworn or affirmed and give their depositions in said cause as witnesses for the plaintiff therein, which order was under the seal of said court, and a copy thereof was delivered to the sheriff of said county, who was the jailer, and by reason thereof the plaintiffs were committed to the common jail of said county and there confined for the space of 6 days, at the end of which time they were discharged upon the writ of habeas corpus by the judge of the district court for said county because said imprisonment was illegal; that by reason of said imprisonment plaintiffs suffered severe pain, anguish of body and mind, shame, humiliation and disgrace; that they also incurred a great expense, to wit, $150 for traveling expenses, attorney’s fees and expense in defending said proceedings and procuring their discharge ; that, by reason of all of which, they had been damaged in the sum of $10,000, for which sum they prayed judgment.
Defendant Nathan A. Ayers was not served with a summons,, and did not appear in the case, so the action proceeded against the defendant Edson, alone. When the case came on to be heard, defendant moved to strike out that part of the petition which recited the proceedings before the notary public, and his motion was sustained. He thereupon filed a general demurrer to the petition, which was also sustained. The plaintiffs elected to stand on their petition, and a judgment of dismissal was entered against them, from which they prosecuted this proceeding in error.
It is contended that the court erred in sustaining de*21fendant’s motion to strike, for tlie reason that the matter stricken from the petition was necessary to show malice, and that it was referred to later on in the pleading as having been substantially stated to the defendant in the plaintiffs’ objections to being sworn. In our view of the case it is unnecessary to determine this question.
It is also contended that the court erred in sustaining the demurrer to the petition and in dismissing the action, and this assignment of error is the vital question presented for our consideration. If the petition stated a cause of action before the motion to strike was sustained, it was error to sustain said motion. On the other hand, if the petition did not state facts sufficient to constitute a cause of action, then the ruling on the motion was error without prejudice. W& will therefore examine the petition as it was filed, and determine whether or not it stated a cause of action. It will be observed that the gravamen of the plaintiffs’ petition was the act of the alleged illegal or false imprisonment on the part of the defendant Edson. It may be stated at the outset that, in order to state a cause of action in such a case, the petition must allege facts, not the conclusions of the pleader, from which it clearly appears that the officer acted without jurisdiction, or that the evidence sought to be elicited from the witness was of such a character as would justify him in refusing to testify. It is a familiar rule that a judicial officer, whether of a court of limited or general jurisdiction, is not liable in a civil action for acts performed in his judicial capacity, if he has acquired and does not exceed the jurisdiction conferred on him by law. He is not liable for a mere error of judgment while acting within his jurisdiction, but he is not protected if he assumes to act beyond the scope of his authority. Atwood v. Atwater, 43 Neb. 147.
Section 373 of the code expressly confers jurisdiction upon probate judges to take depositions. By law, the defendant had the same poAver and jurisdiction in that behalf that is conferred by the statute on a notary public. He therefore had jurisdiction of the subject matter, to wit, the *22taking of the plaintiffs’ depositions. As such officer lie had the power, when the proper notice was produced and delivered to him, showing due and legal service thereof requiring the plaintiffs to appear before him and give their evidence in the form of a deposition, to issue his subpoena demanding their attendance at the time and place specified in said notice. This the petition alleges was regularly done. It is stated therein that Avhen the plaintiffs appeared before the defendant as such officer, they refused to be sworn or testify. The excuse given .for such refusal was that they were husband and wife, and as such could not be compelled to be witnesses one against the other. It was further claimed that the facts authorizing the taking of their depositions did not exist. It appears from the peti-' tion that the action in which they were required to testify was one against themselves and a codefendant of the name of Adelbert I. Walker, as administrator of the estate of one Allen T. Ayers, deceased. It is not alleged that the evidence sought to he elicited from them and preserved in the form of depositions Avas not against their codefendant, or was evidence sought to be elicited from one of the plaintiffs against the other. The proper and orderly thing for them to have done Avas to have taken the oath as witnesses and if, by the questions propounded, it appeared that the ansAvers Avould constitute evidence by the one against the other, to have then made the proper objections which, undoubtedly, Avould have been sustained. The plaintiffs had been duly served Avith a summons in the case in which it Avas sought to take their evidence; notice of the time and place for taking their depositions had been regularly served and returned to the officer before whom they Avere to be taken, and the plaintiffs as the witnesses named in such notice Avere regularly before him at the appointed time and place. In short, all the steps essential to confer jurisdiction on the defendant, as such officer to take their depositions had been duly taken. Plaintiffs’ contention that such jurisdiction Avas ousted by a shoAving that none of the grounds enumerated in section 3T¿ Qf the code for using *23the depositions on the trial of the case existed at the time it was sought to take them, is untenable. That section is not a limitation on the right to take depositions, but on the right to use them on the trial of the case; that it is not essential that the reasons which permit their use at the trial should exist when they are taken, is obvious from the fact that one of such reasons is, that the witness is dead. As bearing on this point see Wehrs v. State, 132 Ind. 157, 31 N. E. 779; In re Aleles, 12 Kan. 451. That the witnesses were parties to the action in which the depositions were sought to be taken does not strengthen the plaintiffs’ case, but rather Aveakens it, Avhen it is remembered that taking the depositions of a party is the only substitute we have for a bill of discovery under our practice. Besides, so far as giving testimony is concerned, parties to the action are on precisely the same footing as other witnesses. Neither was the jurisdiction of the officer ousted by showing that the witnesses were husband and Avife, and that the depositions Avere for use in an action to which they were both parties. It is true, generally speaking, that the husband can not be a witness against the Avife, nor the Avife against the husband, but each may be called as a witness for or against himself or herself; and it may have been the intention of the party taking the depositions to use such evidence against the party giving it alone. No presumption arises from the facts presented by the petition that it was the intention of the party seeking to take the depositions to use the evidence of either of the witnesses against the other. The officer having jurisdiction of the subject matter and of the parties, had full authority to commit the plaintiffs for their refusal to be sworn and give testimony. Dogge v. State, 21 Neb. 272; In re Aleles, supra.
It follows that the petition did not state facts sufficient to constitute a cause of action, and the demurrer thereto was properly sustained. This vícav of the case renders it unnecessary for us to pass on the ruling of the trial court on the motion to strike.
*24For the foregoing reasons, the judgment of the district court is
AFFIRMED.