after staling the case as above, delivered the opinion of the court.
The objection to the jurisdiction of the circuit court in the first case is grounded on the alleged fact that the petition for the removal of the cause did not’ disclose the requisite diverse citizenship of the parties to authorize its removal. Assuming this to he so, the validity of the judgment is not affected thereby. We have twice decided that, if the record fails to show the facte on which the jurisdiction rests (as, tor instance, that the plaintiff and the defendant are citizens of different states, or, where the plaintiff sues as assignee, that his assignor might have maintained the suit), the judgment may he reversed for error upon a direct proceeding for that purpose, hut it is not void, and cannot he collaterally attacked by one who is a party to the *76suit in which it was rendered. Skirving v. Insurance Co., 19 U. S. App. 442, 8 C. C. A. 241, 59 Fed. 742; Rice v. Commission Co., 36 U. S. App. 266, 18 C. C. A. 15, 71 Fed. 151. And to the same effect is the later decision of the supreme court. Dowell v. Applegate, 152 U. S. 327, 14 Sup. Ct. 611, 38 L. Ed. 463. The record shows no consent of parties to remand the case, as counsel for the plaintiff in error seems to suppose.
The order of the court in the first case, made on the defendant’s motion for judgment on the pleadings, was, under the practice of North Dakota, a final judgment, and cannot be collaterally attacked, however erroneous it may be. A motion for judgment on the pleadings is in fact a demurrer, and if sustained by the court, and final judgment entered thereon, it has the same effect as if the demurrer to the complaint had been sustained, and final judgment entered in favor of the. party demurring. Taylor v. Palmer, 31 Cal. 241; Cameron v. Railway Co. (N. D.) 77 N. W. 1016; 2 Black, Judgm. § 707; De Toro v. Robinson, 91 Cal. 371, 27 Pac. 671. When a final judgment is rendered for the defendant on a demurrer to the complaint, or to material pleadings in chief, the plaintiff can never maintain against the same defendant or his privies any similar or concurrent action for the same cause and upon the same grounds as were disclosed in the first complaint. Gould v. Railway Co., 91 U. S. 522, 23 L. Ed. 416; Bissell v. Spring Valley Tp., 124 U. S. 225, 8 Sup. Ct. 495, 31 L. Ed. 411. If a plaintiff fails on demurrer in his first action by reason of the omission of an essential allegation in his declaration, which is supplied in his second suit, the judgment in the first suit is no bar to the second, although the actions were instituted to enforce the same right, for the reason that the merits of the case as disclosed in the second complaint were not heard and decided in the first action. Gould v. Railway Co., supra. In this case there is no ground for the contention that the. complaint in both cases did not set forth the same cause of action. There is no essential allegation omitted in the first complaint which is included in the second. There are slight variations in narrating immaterial or evidentiary facts, but the legal effect of the complaint of the two cases is identical. . All evidence going to the merits of the action, competent under one, would have been competent under the other. It clearly appearing from an inspection of the pleadings and judgment in the first action that a final judgment has been rendered on the merits by a court of competent jurisdiction in a suit between these parties for the very same cause of action for which this suit is brought, the circuit court rightly rendered judgment for the defendant on the pleadings, and its judgment is affirmed.