*281The opinion of the court was delivered by
Smith, J.:This is an action for a writ of mandamus to compel the presiding judge of the Labette county district court to grant a jury trial in two consolidated actions pending before him in which petitioners herein are defendants and the Federal Deposit Insurance Corporation is plaintiff. We issued an alternative writ. The defendant made his return thereto, whereupon the plaintiffs filed a motion for judgment on the ground that the answer stated no defense as a matter of law.
The petition for a writ of mandamus stated that two replevin actions were brought in the district court of Labette county. There is no dispute as to the allegations in the pleadings. The actions sounded in replevin or trover. One of them was based upon a promissory note and chattel mortgage on shop equipment and was for recovery of the specific property or for a money judgment against the defendants. The other action was upon another promissory note and chattel mortgage upon certain automobiles given to secure it. These actions were consolidated and one answer filed to each of them.
In the answer one of the defendants denied the execution of the notes sued upon; alleged he had paid the note with certain checks described in his answer; denied that he was indebted to the plaintiff in any sum and alleged that plaintiff was indebted to him on account of overpayment that he had made on a running account.
The plaintiff in its reply denied that the notes were delivered conditionally and that certain checks referred to in the answer were payments upon the notes.
Upon these pleadings a trial was had and the issues submitted to a jury. Separate verdicts were submitted in each case. In one of them a verdict in favor of the defendants was returned and in the other against the defendants but for a lesser amount than was sued upon. Certain post-trial motions were filed by both parties. These motions included one by each party for a new trial. After hearing the court granted a new trial.
The plaintiff in those two cases thereupon filed a motion stating that the pleadings in the action made necessary the taking of an account for the information of the court before judgment might be determined and asked that a referee be appointed to hear and determine all the issues of fact involved. The defendants objected *282to the court making any order of reference or to the appointment of a referee and renewed their demand for a jury and alleged they were entitled to a trial by jury as a matter of right under the constitution of the state.
The motion asking for the appointment of a referee for the determination of the issues was sustained, whereupon the defendants in those two cases filed this action.
The answer of the defendant district judge in this action set out certain features of the two cases whereby the district judge alleged that the pleadings showed that the parties had mutual accounts each against the other of such a nature that it would require an extensive accounting of the books, papers and records of a defunct bank involved in the litigation. Pie alleged that the right of trial by jury, a matter of constitutional right, was qualified by our statute, G. S. 1935, 60-2923, which provides that when the parties do not consent, the court or judge may upon application or its own motion direct a reference in any of the following cases: Where the trial of an issue of fact shall require the examination of mutual accounts or when the account is long and on one side only, or where the taking of account shall be necessary for the information of the court.
We see nothing in these pleadings that takes this case out of the rule announced in Estey v. Holdren, 126 Kan. 385, 267 Pac. 1090. The actions were to recover upon notes and to recover possession of certain personal property that had been given to secure the payment of these notes. While it does appear that considerable evidence was necessary to be taken as to transactions between the parties, the actions were not essentially for an accounting. It is the substance of the pleadings, not what the parties choose to call them, that determines the character of an action. In Estey v. Holdren, supra, it was said:
“When a cause is properly justiciable before a jury such a trial may not be denied without the assent of parties. (Kansas Bill of Rights, §§ 5, 18; Kimball and others v. Connor, Starks and others, 3 Kan. 414; Atchison Street Rly. Co. v. Mo. Pac. Rly. Co., 31 Kan. 660, syl. ¶ 1, 3 Pac. 284; 34 Cyc. 778, 779; 23 R. C. L. 288.) . . . It is not enough to justify a compulsory reference that a jury trial would be protracted and tedious, or that a mass of technical or complicated facts constitute the evidence. While these conditions might make a reference desirable (23 R. C. L. 284), it could only be had by assent of parties.” (p. 387.)
See, also, Hasty v. Pierpont, 146 Kan. 517, 72 P. 2d 69, where we *283again reviewed the authorities and adhered to the rule announced in Estey v. Holdren, supra, also Nuss v. Nuss, 155 Kan. 699, 127 P. 2d 441. Defendant cites a number of cases where we have held that unless there is a clear legal duty on the part of an officer to perform a certain act we will not issue a writ of mandamus to compel the performance of that act. We are not inclined to question the rule announced in those cases. However, it is well settled that where a jury trial is demandable as a matter of right and that right is withheld mandamus may properly be invoked. See Estey v. Holdren, supra, where the court stated:
“It seems, also, that where a jury trial is demandable as a matter of right and that right is withheld, mandamus may properly be invoked. In this case, that point is not disputed.” (p. 389.)
See, also, Ex Parte Simons, 247 U. S. 231, 62 L. Ed. 1094; McKee et al., v. DeGraffenreid et al., 33 Okla. 136; Nichols v. Cherry, 22 Utah 1; and State, ex rel., v. Hart, 26 Utah 229, 72 Pac. 938.
Moreover, it is difficult to see what can be gained by compelling the defendants in the two actions in the district court, plaintiffs here, to try their case before a referee when it is clear that the order of reference was erroneous. Defendant cites Sawyer v. Ryan, 141 Kan. 368, 41 P. 2d 740, on the question that mandamus will not lie to compel a district judge to call a jury. That case, however, turned upon the fact that the action in which the parties demanded a jury was clearly equitable in character, hence the parties were not entitled to a jury as a matter of right. That is not the case here.
In Estey v. Holdren, supra, following Bishop v. Fischer, 94 Kan. 105, 145 Pac. 890, we settled the legal question against the contention of the judge and held that he should grant the parties a jury as a matter of right. We quote the following:
“If the order of reference be set aside within ten days of the filing of this opinion and an order granting a jury trial be awarded, this proceeding will be dismissed without costs to either party.” (p. 389.)
We think a similar disposition may well be made of the present proceeding. Therefore, judgment will be for the plaintiffs in this action. A peremptory writ will not issue, however, if the order of reference is set aside within ten days of the filing of this opinion. If it is not set aside, however, the peremptory writ will issue.