delivered the opinion oe the court.
The appellee, Charles Donnelly, in 1876, became the surety of the administrator of John Pepper. In 1880 the appellant, William Pepper, as the distributee, brought an action upon the bond. A general demurrer to the petition having been overruled, the appellee relied upon the execution of a new bond in June, 1879, with other surety, as releasing him from all liability. The answer presented nothing else as a defense, and its averments in no way aided the petition. A demurrer to it was also overruled, and a reply then filed, denying that the *261execution of the new bond, which contained a covenant of indemnity to Donnelly as to his suretyship, operated to release him, or that this was its legal effect. An amended reply, averring that the administrator had received the assets before the execution of the new bond, was tendered and rejected. By agreement the law and facts were submitted to the court; and it, after hearing the testimony, dismissed the action as to Donnelly. The judgment does not show the ground upon which it was based. A motion for a new trial was overruled; a bill of exceptions filed, showing that all the assets came to the hands of the administrator prior to the execution of the new bond; an appeal was then taken, and the judgment affirmed by the Superior Court. Its opinion, fairly interpreted, put the affirmance upon the ground that the petition was defective. It substantially, if not in so many words, says so. After this, the appellant proceeded against Donnelly again in this action. The answer relies upon the former suit and judgment therein as a bar. It contains no averment that issue was joined in the former suit, or that it was heard upon the merits. There was no demurrer to it, however, and it was aided by the reply, which substantially avers that the first action was dismissed upon the ground that the petition did not state a cause of action, and could not, therefore, have been tried upon the merits. A properly certified copy of the record of the original suit was referred to in the reply, and by agreement made a part of the record. A demurrer having been sustained to the reply, the plea in bar was held good, and the action dismissed as to Donnelly.
*262The question presented upon this appeal is, what effect is to be given to the judgment in the former action? In rendering it the court did not state its conclusions of law and fact; and there is no averment that the record of that suit does not show all that occurred. We must, therefore, look to it alone to determine whether it was considered upon the merits or disposed of upon technical grounds.
An estoppel by a former judgment is based upon public policy. It demands that when a fact has been judicially and finally determined between the same parties', it shall be at rest. Interest reipubticce ut sit finis, litium. It is, however, equally well settled that a former judgment, to be a bar, must have been a decision upon the merits. Thus a judgment for want of jurisdiction, or by reason of a technical defect in the pleadings, or as to parties, or upon any ground not going to the merits, will not prevent a second action. It does not determine the rights of the parties. This is true of a judgment of non-suit. (Hughes v. United States, 4 Wall., 232; Smith v. McNeal, 109 U. S., 426; Kendal v. Talbot, 1 A. K. M., 321; Insurance Company v. Broughton, 109 U. S., 125.) Were it otherwise, one would be deprived of his “day in court,” and justice be defeated; and while rules are necessary to the administration of law, they should not be so technical, or procrustean, as to deform it, and hamper justice by a sort of judicial jugglery.
Where a party relies upon a former judgment as a bar, the burden is upon him to show that the merits of the case were considered. This must appear from the record, or by evidence aliunde, where it is ad*263missible. (Vaughan v. O’Brien, 39 Howard Pr. Rep., 515.) In a case like this one, where the record shows that a demurrer to the petition was overruled, and the case then heard by the court upon the law and the facts, this might be presumed, in the absence of any rebutting -circumstance. In such a case these facts would purport a trial upon the merits. They would not be conclusive, however. A ruling upon a demurrer does not prevent the court from again considering the legal question presented by it. (Post v. Pearson, 108 U. S., 418.) It may hear- the entire case, •and then dispose of it upon some technical question, as, for instance, a defect in the pleadings.
In this instance, it is manifest that the defense presented in the former suit was not a valid one. The execution of the new bond with a covenant of indemnity did not, under the then and now existing law, release Donnelly from liability for any act theretofore done by his principal. Formerly, the county ■court had the power by its order to accept one bond in lieu of another, and thus release the sureties upon the first bond of an administrator in toto. This left the question to the order and action of the'court. It was too varying and uncertain. The law was, therefore, changed, and provides: “If a personal representative shall give a new bond when ruled to do so by the court, on motion of a surety, his former surety shall not be bound for any act of his doue after the •execution.” (General Statutes, chapter 39, article 2, section 13.) In another chapter the statute also provides for the release of the surety from future, and indemnity as to past, liability.
*264It says: “If anew bond be given, it shall operate a discharge of all the sureties making the motion, from all liability from the acts of the principal thereafter done; and if the object be so specified the bond shall contain a stipulation or covenant to indemnify the said sureties against any loss, cost or damage,,' legally incurred by reason of such suretyship.” (Gen. Stat., ch. 104, sections 1, 3, 6.)
The surety under these statutory provisions cannot be released from responsibility for the acts of the principal done prior to the execution of a new bond. If it contain a clause of indemnity, he may look to it to reimburse himself. In this instance the appellant’s, petition averred the execution of the bond by the appellee as surety. It set forth when the assets were received by the administrator, to-wit: prior to the change of surety; and the only fact presented by way of defense was the execution of the new bond. It was claimed that it operated to release the appellee from all claim by the heir or distributee for the acts of the administrator theretofore done. Under this state of case, to presume that the judgment of dismissal was rendered upon the merits, is to convict the lower court of error. We are unwilling, therefore, to so suppose, if the record authorizes any other conclusion. It is clear that the judgment did not necessarily involve a determination of the merits of the case. The Superior Court, upon appeal, affirmed it, because the petition (as it held) failed to state a cause of action. It would be improper now to-inquire whether it was right or wrong in this opinion. It was final, and must now be regarded as correct. It *265did not affirm the judgment upon the 'merits of the case, but upon a ground that did not constitute a bar to another action. If the judgment of the lower court was rendered upon technical grounds, then it was correct, according to the opinion of the Superior Court. We are inclined to think its opinion must control. Suppose the conclusion of the lower court be correct, but based upon improper grounds that will bar another action. Upon appeal the judgment is affirmed, but upon other grounds that do not constitute a bar; which is to prevail ? An affirmance by the appellate court is, of course, not necessarily an affirmance of the grounds upon which the lower court bases its judgment. If they are incorrect, and yet must prevail, although the appellate tribunal in affirming the judgment has assigned the true grounds, then it follows that the inferior court is in effect the superior one. The judgment is valid by reason of the affirmanoe. It should, therefore, be governed in its effect by the extent of the affirmance, or the opinion delivered upon the appeal. It certainly is the law of the case, and should control in construing the judgment below. In another action the ground of the affirmance must be taken as the ground upon which the judgment was rendered; and resort must be had to the opinion of the appellate court as to its extent and limitation. We think this the true rule, and in harmony with the reason and theory of our court system.
In any event, however, where the judgment of the lower court is silent as to the ground upon which it is based, it should be presumed that it was founded upon the reason given for its affirmance upon appeal; *266and especially so when a different conclusion will convict the lower court of error.
According to the presumption which, under such circumstances, should exist as to the judgment below; according to the opinion also of the appellate tribunal, the appellant has never had a trial upon the merits of his case. If he attempts to look to the. surety in the second bond, he will doubtless respond, that the act of which you complain occurred during the existence of the first one ; and although the bond, to which I am a party, contains a clause of indemnity'to the surety in the former one, yet he has not been damnified, and I am not, therefore, liable. If this be true, it results that, unless the appellant can have a trial upon the merits of his case as to the appellee, he is remediless.
The demurrer to the reply related back to the answer, and raised the question of its sufficiency. Considered in connection with the exhibit of the former suit, it did not present a defense, and the demurrer to the reply should have been sustained to the answer.
Judgment reversed, and cause remanded for further proceedings consistent with this opinion.