delivered the opinion of the court.
Action for money had and received. The complaint is in the ordinary form, alleging that the defendant, a corporation organized under the laws of Montana, is indebted to the plaintiffs in the sum of $140,000 for money had and received for the use and benefit of plaintiffs. Judgment is demanded for that amount and costs.
The answer presents six separate defenses. The first is a denial of all' allegations contained in the complaint. The second, third, fourth and fifth allege, respectively, that the cause of action is barred by the provisions of subdivision 1 of section 514 of the Code of Civil Procedure, subdivision 1 of section 513 as amended by Session Laws of 1903, page 292, subdivision 3 of section 514 as amended by the same Act, and by section 512 of the same Code. The sixth defense alleges, in substance, that heretofore, on August 21, 1901, in an action then pending in the district court of the fifth judicial district of the state of Montana, in and for the county of Jefferson, between the plaintiffs herein as plaintiffs and the defendant herein as defendant, being the same parties as are parties to this cause, and for the same cause of action, there was interposed by defendant a motion for judgment on the pleadings, which, upon consideration by the court, was sustained and a final judgment rendered and entered for defendant dismissing the action.
The amended replication denies that the cause of action is barred by any of the provisions relied upon by the defendant in the second, third and fifth defenses, or otherwise, or at all, and alleges by way of avoidance of the sixth defense that in the month of February, 1900, the plaintiffs began an action against the defendant in the district court of the fifth judicial district upon the same cause of action as stated in the complaint herein; that judgment was rendered and entered therein in favor of the defendant as alleged; that the plaintiffs thereupon appealed to the supreme court; that such proceedings were had in the cause in the supreme court that the judgment was. on June 27, 1904, *93affirmed on the ground that the complaint therein did not state a cause of action, but that said judgment was not a judgment upon the merits.
It is further alleged by way of avoidance of the defense of the statutes of limitation that since the accrual of the cause of action stated in the complaint each and all of the officers and agents of the defendant upon whom service of process could be had, had been absent from the state, except for a period of about two years and eight months prior to the commencement of this action.
Upon these pleadings the defendant moved for judgment, on the ground that no issue of fact is presented upon the fourth defense pleaded in the answer, for that the same is not denied in the amended replication, and for the reason that the avoidance thereof pleaded in said replication is contrary to the laws of the state of Montana, and for the further reason that there is no issue of fact to be tried on the sixth defense pleaded in the answer, the same being admitted in the amended replication, and the avoidance thereof pleaded in the replication is contrary to the laws of the state of Montana. This motion was, after argument, granted and judgment entered for the defendant. The appeal is from the judgment.
The judgment referred to in the pleadings was affirmed in 31 Mont. 21, 77 Pac. 302, under the title of Glass et al. v. Basin & Bay State Min. Co. In this case two questions are submitted for decision: (1) Whether the right to maintain this action is barred by the judgment in the former action; and (2) whether upon the face of the proceedings it is apparent that the cause of action is barred by any of the limitations pleaded. It is contended by appellants that upon the face of the pleadings both of these questions should have been answered in the negative and that the motion for judgment should have been denied.
1. Does it appear that the former judgment was upon the merits of the controversy? Section 1007 of the Code of Civil Procedure declares that “a final judgment dismissing the complaint, either before or after a trial, does not prevent a new *94action for the same cause of action, unless it expressly declares, or it appears by the judgment-roll, that it is rendered upon its merits.” The appellants’ position is that the judgment pleaded does not expressly declare that it was rendered on the merits; and, since the judgment-roll was not before the district court, it could not tell on the trial of the motion what its effect was. The argument of respondent is that section 1004 of the Code of Civil Procedure enumerates the cases in which an action may be dismissed or judgment of nonsuit entered; that section 1005 declares that in all other cases than those mentioned in section 1004 the judgment must be rendered on the merits; and that, since the judgment in controversy does not fall within the cases enumerated in section 1004, the presumption must be indulged that it was rendered on the merits. Hence it is said that the judgment of the district court, since it is aided by this presumption, must be deemed correct. In this contention we think respondent is in error.
The rule contended for by respondent is recognized by the supreme court of the United States in United States v. Parker, 120 U. S. 89, 7 Sup. Ct. 454, 30 L. Ed. 601. In that case the court had under consideration the statutes of Nevada, which are nearly identieál with sections 1004 and 1005, supra/ but that decision has no application to this case, for the reason' that the Code of Nevada contains no such provision as section 1007. Furthermore, this court in Kleinschmidt v. Binzel, 14 Mont. 31, 43 Am. St. Rep. 604, 35 Pac. 460, held under an identical statute (Compiled Statutes, 1887, Div. 1, sec. 243) that a judgment rendered on demurrer did not estop the plaintiff in the action from asserting his claim in a subsequent action, nothing appearing upon the face of the pleadings to show that the judgment went to the merits, rather than to some defect of form. A judgment on the pleadings is the same as a judgment on demurrer. (Power et al. v. Gum, 6 Mont. 5, 9 Pac. 575.)
Judgments on demurrer or on the pleadings which result in the dismissal of the action are not enumerated in section 1004. As will be seen by an examination of the ease of Kleinschmidt v. Binzel, supra, and the authorities cited, it was a matter of dis*95pute when that decision was made, as to what presumption should attach to them when pleaded in bar. That case declared the rule which controlled in this state until the adoption of the Code in 1895, which, besides bringing forward in sections 1004 and 1005 the provisions of the Compiled Statutes, supra, added section 1007. This provision, construed with the others, means nothing more nor less than that judgments of dismissal, whether included in the enumeration in 1004 or not, shall not be a bar to another action upon the same cause of action, unless rendered on the merits, which fact must be expressly declared upon the face of the judgment or appear from the judgment-roll. In other words, such a judgment must show of itself, or by aid of the judgment-roll, that it concludes the merits of the controversy, or it is no defense. The judgment relied on here shows upon its face that it belongs to the class referred to in section 1007. It does not declare that it adjudicates the merits, and, since the judgment-roll was not before the district court, no presumption can be indulged that it was rendered on the merits. In so far, therefore, as the action of the district court was based upon such presumption, it was erroneous.
2. This being so, the question whether this action is barred by the provisions of any of the statutes pleaded depends for its answer upon the further inquiry whether section 547 of the Code of Civil Procedure applies to the circumstances of this case. That section reads: “If an action is commenced within the time limited therefor, and a judgment therein is reversed on appeal, without awarding a new trial, or the action is terminated in any other manner than by a voluntary discontinuance, a dismissal of the complaint for neglect to prosecute the action, or a final judgment upon the merits, the plaintiff, or, if he dies, and the cause of action survives, his representative, may commence a new action for the same cause, after the expiration of the time so limited, and within one year after such a reversal or termination.”
There is no question that the first action was begun within the time limited therefor. The judgment of dismissal was affirmed by this court. The action was, therefore, not voluntarily *96discontinued, nor was it dismissed for want of prosecution, nor, so far as the record before us shows, was the judgment rendered upon the merits. It was terminated by the judgment of affirmance in a manner other than those which do not toll the statute. It was commenced within one year from the termination of the former action. It therefore falls within the provisions of the statute, and none of the limitations pleaded apply so far as the pleadings show. If on the trial, and upon inspection of the judgment-roll in the former action, it is manifest that the former judgment was upon the merits, this will be conclusive of the case, and the inquiry as to whether the limitations apply will become immaterial.
The view we have thus taken of the case renders it unnecessary to consider whether the absence from the state of all of the agents of a domestic corporation upon whom process may be served tolls the statute of limitations during the time of such absence.
The judgment of the district court was erroneous, and must be reversed.
Reversed.
Mr. Justice Milburn and Mr. Justice Holloway concur.