On Motion for Rehearing.
Judgment on Merits — When Error. 3. Held, that while it was not error to grant a motion for judgment on the pleadings under the circumstances referred to in paragraph 1, supra, the court did err in entering judgment on the merits, whereas it should have directed a dismissal of the action, thus enabling plaintiff to further prosecute his rights in the premises. MR. CHIEF JUSTICE BBANTLYdelivered the opinion of ■the conrt.
The judgment of the district court recites on its face that it was rendered on the merits. Counsel for plaintiff have filed a petition for rehearing, their purpose being to secure a modification of the judgment so that it will be in form one in abatement only. No reference was made at the hearing to this feature of the ease. Nevertheless, after further consideration we think the modification should be made, though a formal rehearing will not be necessary.
The defense of another action pending, being matter merely in abatement, is joined in the answer with two defenses in bar, viz., the statute of limitations and res judicata. It is therefore [1] apparent that the judgment as it stands would be a bar to another action even though the court, as it evidently did, erroneously resolved the questions arising upon the latter defenses, in favor of the defendant. (23 Cyc. 1151; Dunseth v. Butte Electric Ry. Co., 41 Mont. 14, 108 Pac. 567.) Since this is so, the plaintiff is entitled to have the modification asked for, bo that he may not be obstructed in a further effort to enforce his rights, if he has any. The propriety of the modification will be made clear by a brief reference to the issues presented upon the first and third defenses alleged in the answer.
As to the defense of the statute of limitations: In his reply plaintiff alleges by way of avoidance, that on May 31, 1905, he commenced his action against the defendant for and on account of the same damages to his property set forth in his complaint herein; that the action was numbered 11,699 in the files of the *136district court of Silver Bow county; that the cause being at issue, came on for trial on February 26, 1909; that thereupon a jury having been impaneled and the plaintiff having offered testimony in support of the allegations of his complaint, the defendant interposed an objection thereto, which was by the court sustained; that the court.thereupon nonsuited plaintiff; that the said cause remained pending in said court until January 26, 1911, when judgment was duly entered dismissing it without prejudice, and that the present action was thereupon commenced within one year, the time limited by law, said former action having been terminated in a manner • other than by a voluntary discontinuance or by a dismissal of the complaint for neglect to proceed with the action, or by a final judgment upon the merits. If these allegations are true, — and their truth can be ascertained only by a hearing of evidence, — the cause of action stated was not barred by either section of the statute upon which defendant relied in its first defense; for if cause 11,699 was pending until January 11, 1911, by commencing this action on January 28, 1911, within a year after the former was dismissed without prejudice, plaintiff brought himself within the [2] privilege accorded by section 6464, Revised Codes. (Glass v. Basin & Bay State Min. Co., 34 Mont. 88, 85 Pac. 746; Id., 35 Mont. 567, 90 Pac. 753; Wilson v. Norris, 43 Mont. 454, 117 Pac. 100.) The district court therefore could not propérly have determined the merits of this defense on the motion for judgment on the pleadings.
As to the defense of res judicata: As pointed out in the original opinion, the judgment relied on by defendant to support this defense, was rendered in its favor on March 14, 1910, in cause numbered A-2026. So far as appears from this record, this cause is still pending, and the judgment rendered therein is the one pleaded by defendant in abatement of this action. Assuming, without deciding, that a judgment which has not become final by reason of the fact that the cause in which it was rendered is still pending may be pleaded in bar of a second action for the same cause, and that the judgment *137in cause A-2026 is properly pleaded by the defendant, we do not think that in view of the character of the reply the court should have assumed to determine the merits of this defense without at least an inspection of the judgment-roll, which it could make only upon a hearing of evidence upon a trial. It [3] is alleged in the reply that the court directed a verdict for the defendant in cause A-2026, not upon the merits, but solely on the ground that eause 11,699 was still pending, and that by bringing that action, — that is, A-2026, — while 11,699 was still undisposed of, plaintiff could not avail himself of the exception provided by section 6464, Revised Codes, supra, and. hence could not avoid defendant’s plea of the statute of limitations. If these allegations are true, the judgment in A-2026 is not, under the changed conditions brought about by the dismissal of cause 11,699, a bar to the present action. The result is that the judgment in this case should be amended so as to direct a dismissal of the action, instead of determining the controversy on the merits.
The cause is therefore remanded with directions to the district court to modify the judgment in accordance with the suggestions herein made. The motion for rehearing is denied.
Judgment modified.
Mr. Justice Smith and Mr. Justice Holloway concur.