delivered the opinion of the court.
Assuming that the bonds issued and delivered by the county of Clarke to the Alexandria, Loudoun and Hampshire Eailroad Company, in August, 1858, and the contemporaneous bond of indemnity and deed of trust executed by the company to indemnify the county, are valid and binding obligations, the court is of opinion that the complainant in the court below, as the bona fide holder of •certain of the bonds and past-due coupons, is entitled to *748have the deed of trust enforced for her benefit, according-to the prayer of the bill; for by the contract of indemnity the company virtually became a principal debtor, and the-county merely a surety, until performance of the conditions therein mentioned. And those conditions have not been performed, and many of the coupons are due and-unpaid, though payment has been demanded. So that the-complainant, and all persons in like case with her, have-thus become entitled, upon the equitable principle of substitution, to avail themselves of the security given by the principal debtor for the indemnity of its surety—the-county.
Indeed, the principle, as announced by this court, is that “to prevent the surety from being first harrassed for the-debt or liability, and then turning him round to seek redress from the collateral security given by the principal,, a court of equity will authorize, and even encourage, the-creditor to claim, through the medium of the surety, all the rights he has thus acquired to be exercised for his-benefit and in discharge of his obligations.” Hopewell v. Cumberland Bank, 10 Leigh, 214. And the creditor is entitled to the benefit of the security, though he did not-originally rely upon it, or even know of its existence; for this equity of the creditor is not founded upon contract,, but upon a principle of natural justice. Sheld. on Subr., § 154; 3 Pom. Eq., § 1419; Am. Notes to Dering v. Earl of Winchelsea, 1 Lead. Cas. Eq. 173; Roberts v. Colvin, 3 Gratt. 342; Hauser v. King, 76 Va. 731.
It is essential, however, to the right of substitution, inasmuch as the creditor can only claim through the medium of the surety, that the latter be bound for the debt or liability sought to be enforced; and hence it is contended here that the right does not exist, because, as alleged, the instruments above mentioned are valid obligations, and do not bind the county.
*749It would be strange if the appellant company, after having purchased and accepted a conveyance of its property, rights and franchises, subject to the lien of the deed of trust, could now, in a court of equity, successfully resist the claims of creditors secured by that deed, on the ground that the deed itself is void. Yet such, in effect, is its contention, claiming, as it does, that the bonds in question are void as against the county of Clarke, and, therefore, that the deed of trust given to indemify the county, is not enforceable in this suit. But clearly this defence cannot avail, for three reasons: First, because the purchase was made under decrees of the circuit court of the city of Richmond, which adjudged the lien to be valid and subsisting; secondly, because a purchaser who assumes to pay, or who buys subject to a mortgage, cannot afterwards contest its validity. 1 Jones on Mortg., § 744; and thirdly, because the bonds and coupons, which on their face are negotiable, having been transferred for value by the Alexandria, Loudoun and Hampshire Railroad Company, the property encumbered for the indemnity of the county will be treated in equity as in the nature of trust property for the benefit of bona fide holders of the bonds and coupons, without regard to whether the bonds, as against the county, are valid or not. Parkersburg v. Brown, 106 U. S. 487.
This is decisive of the case, so far as the liability of the appellant’s property is concerned. And the case is equally plain as regards the liability of the county of Clarke. The decree appealed from holds that the county is liable, though only secondarily; but the county denies that it is liable at all. It contends, among other things, that the bonds were issued without lawful authority and upon certain conditions which have not been performed, and are, therefore, void, even in the hands of innocent holders.
The bonds were signed by T. P. Pendleton and three others, as agents of the county of Clarke, and they purport *750to have been issued under certain orders of the county court, made “ in conformity with the act of the general assembly in such case made and provided.” They bear upon their face no conditions whatever, and in form are perfect negotiable instruments, as are the coupons attached. They were delivered to the railroad company in consideration of $100,000 of its capital stock, which the county got. They were subsequently transferred by the company, and thus have found their way into the channels of commerce and into the hands of bona fide holders for value. We do not propose, however, to consider whether or not they were lawfully issued, or what were the circumstances under which they were issued, since that matter, as well as-every other defence now set up by the county, is res judicata.
The bonds and coupons were audited in the suit of Lewis v. The Washington and Ohio Railroad Company (ante, p. 246), in the circuit court of the city of Eichmond, and. were recognized by decrees in .that suit, not only as valid obligations but as secured by a first lien on the property of the defendant company. To that suit the county was-a party, and although the case has been twice brought to this court on appeal, no objection to - those decrees, on the part of the county, has ever been made. The decrees in both instances were affirmed, and the county is now concluded by them.
The rule is that a decree affirming a decree of a lower-court finally settles, as between the parties to the appeal, all questions which were or might have been raised in the-appellate court. This is a well established rule, perfectly understood, and upon which this court, at almost every term, is called upon to act. It is undoubtedly a wise one,, because without it litigation would be endless, and it ought,, therefore, to be enforced whenever the occasion requires. The latest case on the subject is Findlay v. Trigg’s Adm’r *751{ante, p. 539). There an exception was taken to a commissioner’s report, on the ground that an administrator, a party to the suit, had been improperly credited by the commissioner with certain payments. The report, however, was confirmed, and subsequently an appeal was taken in the case, the exceptor being an appellee. The decrees appealed from were affirmed. Afterwards, the exceptor, in an independent suit, sought to hold the administrator .liable for the moneys with which he had been credited as aforesaid. But this court held that the administrator was protected by the decree of affirmance,, without regard to whether or not the exception in the former suit was well taken, and notwithstanding it did not affirmatively appear that the exception had been formally brought to the attention of the appellate court.
In the course of its opinion the court said: “ The cases in support of the proposition that a decree of this court affirming a decree of a lower court is a final determination between the parties and their privies of all questions which were or might have been raised on the appeal, are numerous and familiar. In Price v. Campbell, 5 Call, 115, it was held that the law in such a case supposes everything-contained in the record to have been decided on, and that a contrary doctrine would violate the wisely established rule, that interest reipublicae res judicatas non rescindí„ Following this and other previous decisions, the court in Campbell’s Ex’ors v. Campbell’s Ex’or, 22 Gratt. 649, used this language: ‘An appeal from a decree brings up the whole proceedings in the case prior to the decree; and either party can have any error against him in those proceedings corrected without the necessity of a cross-appeal in any case. If a party fail to complain of any such error, and a decree be made upon the appeal without correcting or noticing the error, such party will be concluded by the decree from appealing afterwards;’ ” citing New York Ins. *752Co. v. Clemmitt, 77 Va. 366; Effinger v. Kenney, 79 Id. 551; Stuart v. Preston, 80 Id. 625.
Nor is this the only ground upon which the doctrine of res judicata is applicable here. The county of Clarke appeared in the above mentioned suit in the circuit court of the city of Richmond, and filed a cross-bill, a copy of which is filed with the record before us. And in that bill it was admitted that the bonds were valid, yet on the ground that the railroad company had not fulfilled its contract with the county in respect to the construction of its road, and for other reasons set forth, the court was asked to decree that the county was no longer bound, except to bona jide holders of the bonds and coupons for value and without notice. Comparing the cross-bill with the answer of the county in the present suit, we find that the allegations of the one are substantially the same as those of the other, except that the answer, having less regard for the rights of innocent holders, avers that the bonds are absolutely void. There was a demurrer to the cross-bill, which was sustained, and the cross-bill was dismissed by a decree absolute in its terms.
Now, here was not only a solemn admission that the bonds were valid, but the effect of the decree, although rendered on a demurrer, was to adjudge that the county was bound. That was the precise question raised, and necessarily determined. Upon that point the record leaves nothing in doubt. For it is not and cannot be contended that the cross-bill was defective in form, or that the court was without jurisdiction; nor does it appear that the cross-bill was dismissed on any ground not going to the merits, so that the decree must be held to have been rendered on the merits, and not now to be questioned in a subsequent -controversy upon the same subject-matter between the same parties. Goodrich v. The City, 5 Wall. 566 ; Aurora City v. West, 7 Id. 82; Freeman on Judgments, §§ 267, 270.
*753In Durant v. Essex Company, 7 Wall. 107, a bill was in general terms dismissed, and afterwards the plaintiff filed another bill praying for the same relief. It was held that the suit was not maintainable. In delivering the opinion of the supreme court, Mr. Justice Field said: “ The decree dismissing the bill in the former suit, being absolute in its terms, was an adjudication of the merits of the controversy, and constitutes a bar to any further litigation of the same subject between the same parties. A decree of that kind, unless made because of some defect in the pleadings, or for want of jurisdiction, or because the complainant has an adequate remedy at law, or upon some other ground which does not go to the merits, is a final determination. Where words of qualification, such as ‘without prejudice/ or other terms indicating a right or privilege to take further legal proceedings on the subject, do not accompany the decree, it is presumed to be rendered on the merits.” See also Hughes v. United States, 4 Wall. 237; Russell v. Place, 94 U. S. 606; Cromwell v. County of Sac, Id. 351; Wilson’s Ex’or v. Deen, 121 Id. 525; Chrisman’s Adm’x v. Harman, 29 Gratt. 494; Blackwell’s Adm’r v. Bragg, 78 Va. 529; Wilcher v. Robertson, Id. 602; Withers’ Adm’r v. Sims, 80 Id. 651.
It only remains to notice an assignment of error in the petition for appeal, to the effect that it was error to decree a sale of the property before the ownership of certain of the bonds, as to. which there was a controversy, had been determined. There is nothing, however, in this objection. The controversy, since this appeal was taken, has been settled by this court on an appeal from a decree of the circuit court of the city of Richmond, and thus the objection, if ever valid, had been obviated. But the objection was never valid; for it appears that after the present suit was commenced, the said circuit court, in whose custody the bonds were, appointed special commissioners to audit *754them in this suit, which was done, and they are reported in the names of the said special commissioners. So that the case is not within the principle decided in Ogden v. Brown, ante, p. 670.
We. find no error in the decree appealed from, and the same must be affirmed.
Fauntleroy, J., dissented as to liability of Clarke county,, but concurred in other respects.
Degree affirmed.