¶1*259Messrs. Paul H. Ray and John Jensen, with whom Messrs. Emmett M. Bagley, Robert' L. Judd, A. M. Cheney, and Harold M• Stephens were on the brief, for petitioners.
¶2To allow the National to recover anything on its indemnity agreement until Groesbeck has been made whole, is to violate the plain terms of the National’s guaranty to him and to reduce its liability as guarantor of his entire deposit, a liability which continued “ as well after as before ” the payment of the penalty of its bond.
¶3The bond stands not behind any particular part of Groesbeck’s deposit, but behind all of it so as to be a guaranty against ultimate loss — a guaranty of the last $125,000.00, or any part of it.
¶4The fact that the National paid Groesbeck the penalty of its bond before the receiver ceased to pay dividends, does not entitle the National to compete with Groesbeck in receiving dividends from the Bank. Groesbeck did not need protection against loss of that part of his deposit which the Bank could repay by way of dividends in the event of failure. By its bond the National agreed to stand between Groesbeck and ultimate loss on his deposit. As long as any part of his deposit remains unpaid, *260Groesbeck holds the National’s agreement to protect him to the extent of $125,000.00. Maryland Casualty Co. v. Fouts, 11 F. (2d) 71; Knaffl v. Knoxville Banking & Trust Co., 133 Tenn. 655; Buffalo, etc., Co. v. Title Guaranty & Trust Co., 99 N. Y. S. 883; Merrill v. Nat’l Bank of Jacksonville, 173 U. S. 131; U. S. F. & G. Co. v. Carnegie Trust Co., 164 N. Y. S. 92; Illinois Surety Co. v. United States, 226 Fed. 665; Columbia Finance & Trust Co. v. Kentucky Union Ry., 60 Fed. 794; U. S. F. & G. Co. v. Union Bank & Trust Co., 228 Fed. 448; Peoples v. Peoples Bros., Inc., 254 Fed. 489; N. J. Midland Ry Co. v. Wortendyke, 27 N. J. Eq. 658; Featberstone v. Emerson, 14 Utah 12; American Surety Co. v. Nat’l Bank of Barnesville, 17 F. (2d) 942; In re Daily and Ivins, 19 F. (2d) 95.
¶5The lower court’s, decision will result in unfair distribution of the Bank’s assets' among its creditors in violation of the National Banking Act.
¶6Mr. Bynum E. Hinton, with whom Messrs. A. E. Moretón and Edwin G. Davis were on the brief, for respondent.
¶7The surety’s right to subrogation as against the . debtor does not arise until and “ unless he pays the whole debt or it is otherwise satisfied,” United States v. Nat’l Surety Co., 254 U. S, 73; Mellette Farmers Elevator Co. v. H. Poehler Co., 18 F. (2d) 430; whereas, under a contract of indemnity, the surety can proceed against the principal even though he has paid only a part of the debt. In re Kimbrough-Veasy Co., 292 Fed. 757.
¶8The claim sued upon in this case was not res judicata by reason of the decision in the first case, and must be determined on its merits.
¶9If the principal be insolvent, this right of the surety to indemnity makes him, as a creditor of his insolvent principal, a. general, claimant against his estate, with the right to file a claim and to be paid dividends thereon in common *261with other general creditors. U. S. F. & G. Co. v. Centropolis Bank, 17 F. (2d) 913, and cases there cited; Stearns, Suretyship, 3d ed., § 279; 1 Brandt, Suretyship, 3d ed., § 226; Newman v. Goza, 2 La. Ann. 643; Ritenour v. Matthews, 42 Ind. 7.
¶10The respondent was the creditor of the Báhk from the date of the indemnity agreement, by reason of having loaned the Bank its credit. Schwartz v. Siegal, 117 Fed. 13.
¶11No new contract was made when it paid the penalty of its bond. The payment merely fixed the amount of damages for which the bank was liable under its indemnity agreement. Payment matured and fixed the amount of the debt and gave rise to a right of action at law for reimbursement. This debt owing by the Bank was entirely new and distinct. It was in no sense the debt, or any part of the debt, which the Bank originally owed Groesbeck and the County. Being a separate and distinct claim, and a valid and binding obligation of the bank, it should have been allowed by the Receiver and dividends paid thereon. Townsend v. Sullivan, 3 Cal. App. 115; Yndo v. Rivas, 107 Tex. 408; Hill et al. v. Wright, 23 Ark. 530; Ryland v. Commercial, etc., Bank, 127 Cal. 526.
¶12The contract of indemnity was not in contravention of any provision of law or of the public policy of the State of Utah, nor was it in contravention of any Act of Congress relating to the conduct of national banks. It was therefore a legal and enforceable contract and no contention is made to the contrary. Nat'l Surety Co. v. Blaumauer, 247 Fed. 937; Western Surety Co. v. Kelly, 27 S. D. 465; U. S. F. & G. v. Centropolis Bank, 17 F. (2d) 913; 31 C. J. 424, § 16.
¶13There is^ nothing in the bond which indicates any agreement as between the Bank, the respondent and Groesbeck that the claim of the County upon its con*262tract of deposit should be given any priority over the .claim of- the Surety Company upon its contract. This being true, there is no reason in law or in equity why the contract of indemnity upon which this action is based should not be enforced..
¶14The decision of the Court of Appeals in the case at bar was based largely upon its own decision in the case of U. S. F. & G. Co. v. Centropolis Bank, 17 F. (2d) 913. Other cases supporting the view for which we contend are: U. S. F. & G. Co. v. Carnegie Trust Co., 177 App. Div. (N. Y.) 176; American Surety Co. v. Nat’l Bank of Barnesville, 17 F. (2d) 942; In re Dailey et al., 19 F. (2d) 96; Mellette Farmers Elevator Co. v. H. Poehler Co., 18 F. (2d) 430; Title Guaranty & Surety Co. v. Shattuck et al., 224 Fed. 401; Tenant v. U. S. F. & G. Co., 17 F. (2d) 38. '
¶15The National’s liability was limited to the penalty of its bond. When it paid this penalty, its bond was exon-, erated. It no longer continued liable as a guarantor of the entire deposit, nor did its liability continue “ as well after as before ” payment, except in the' sense that until the deposit, which it guaranteed in part, was paid in full the surety could assert no claim to be subrogated to the rights of; the Treasurer against the bank, or to any collateral which he may have held.
¶16“ Sureties are never held responsible beyond the clear and absolute 'terms and meaning of their undertakings.” Leggett v. Humphreys, 21 How. 66.
¶17, Let us suppose that the National had required collateral security and that the Bank had given it sufficient to fully protect it against loss. This fact would not háve made necessary any change whatever in the language of the depository bond. Under such circumstances there could be no doubt of the National’s right to retain and to realize on its collateral, and it might very well have happened that the National, oh the failure of the Bank, would have *263been the only creditor who was in position to realize dollar for dollar on its claim and escape without loss.
¶18The National may enforce a claim against the Bank springing from contract, notwithstanding the fact that it is not entitled to immediate subrogation to the rights of its obligee against the Bank. If- the contract was in all respects legal and valid, and its enforcement not limited or restrained, why should it not be enforced? Can any good reason be found for destroying a right acquired by one surety through contract in order that the benefits -expected by another surety from subrogation might be perhaps increased?
¶19Mr. George P. Barse filed the brief of Mr. Joseph W. McIntosh, Comptroller of the Currency of the United States, as amicus curiae, by special leave of Court.
¶21delivered the opinion of the Court.
¶22The petitioner Jenkins was appointed receiver of the National City Bank of Salt Lake City, an insolvent national bank, by the Comptroller of the Currency, under the provisions of § 5234, R. S. The respondent National Surety Co. brought this action against the receivér to compel the allowance of and payment of dividends on its claim upon an indemnity agreement executed by the bank. The agreement was contained in the bank’s application for a bond by which the bank as principal and the respondent company as surety undertook that the official deposits of the treasurer of Salt Lake County, Utah, up to a named sum, would be repaid on demand. The deposits at the time of the insolvency exceeded the amount of the bond. The district court directed that dividends on the claim for indemnity be postponed until the county treasurer should have been repaid the full balance of his deposit. The court of appeals for the eighth circuit reversed the decree with instructions that the respondent *264be paid dividends on an equal basis with, other creditors, including the treasurer. National Surety Co. v. Jenkins, 18 F. (2d) 707. This Court granted certiorari, 275 U. S. 515, to remove a conflict alleged to exist between the decision below and rulings by the courts of appeals in' other circuits. Maryland Casualty Co. v. Fonts, 11 F.(2d) 71, Springfield National Bank. v. American Surety Co., 7 F. (2d) 44.
¶23In his answer the receiver prayed that Groesbeck, the county treasurer, and the American Surety Co. be required to interplead. An order issued and they filed a joint answer, from which it appeared that Groesbeck, as principal, and the American Surety Company, as surety, had given to Salt Lake County an official fidelity bond in the sum of $200,000. The treasurer deposited the county funds in his custody in the bank and took. as security the respondent’s bond in the sum of $125,000, bonds of other surety companies, executed, to. him as obligee, in the total sum of $100,000, and from the bank a certain amount of apparently doubtful collateral.
¶24When the batik failed his official deposit amounted to $643,094.29. Salt Lake County was paid in full — $200,000 by the American Surety Co. as surety of the treasurer’s fidelity bdnd; $125,000 by the respondent National Surety Co., the balance by the other surety companies'and by dividends paid by the receiver. When the second dividend was paid it was sufficient to pay the final balance due from the treasurer to the county and leave a surplus of over $9(000; but there remained an unpaid balance of the deposit due from the bank to the treasurer.
¶25The claim of the respondent company is’for its pro rata share of this surplus and of all dividends paid or to be paid by the receiver as well as of the collateral given to the treasurer by the bank.. Thé claim.is resisted by the interpleaded petitioners, the treasurer and the American Surety Co., on two grounds; first, that the right of. the *265treasurer and his surety to full repayment of his deposits before any dividends are paid the respondent is in this case res judicata; second/ that the respondent is not entitled to share in the estate of the insolvent debtor until the balance of the creditors’ claims have been fully satisfied. On both grounds the circuit court of appeals ruled against the petitioners.
¶26The plea of res judicata was based' on the decree in an earlier suit brought in the district court by the county treasurer and the American Surety Co. against the receiver to determine their right to the excess of the sedond dividend over .the county’s claim, to all future dividends and to the collateral. The National Surety Co., the respondent here, was interpleaded and answered. A decree in favor of the American Surety Co. was affirmed by the court of appeals for the eighth circuit. National Surety Co. v. Salt Lake County, 5 F. (2d) 34. We think the court below was right in holding that the earlier litigation had determined only that the National Surety Co. was not entitled to be subrogated to the treasurer’s claim and remedies against the insolvent bank until he had been paid in full, and in no way involved the National Surety Company’s present separate claim on its contract of indemnity, and that the plea of res judicata was consequently ineffective. But as the certiorari was granted to review the other branch of the case, and as the view we take of it makes unnecessary an extensive consideration of the first question, we pass at once to the second.
¶27The right now asserted by the respondent arises, not from subrogation to the rights of the treasurer but upon its independent' agreement with the bank for indemnity. The bank’s undertaking was to indemnify respondent for liability which it might “ sustain or incur ” by reason of its having given its surety bond, which was conditioned on the bank’s keeping its deposits “ subject at all times to the check and order of the treasurer.” So long as the bank *266remained solvent respondent would have been entitled to immediate indemnity from the bank even though that payment neither satisfied the treasurer’s claim non exhausted the surety’s own liability. Davies v. Humphreys, 6 M. & W. 153; Ex parte Snowden, 17 Ch. D. 44. As between itself and its principal the surety should not have been required to make any payment at all, and to allow it prompt reimbursement would in no way impede the creditor so long as the principal remained solvent. But if, as here, the principal is insolvent, any dividends paid the surety on its claim for indemnty before the creditor’s whole claim has been satisfied would decrease the creditor's dividends by his proportionate shard of the payments to the surety. They would also result in a species of double proof, detrimental to the principal’s other creditors, for the secured creditor would, under the applicable “ chancery rule,” still be entitled to dividends on his entire original claim. Compare Merrill v. National Bank of Jacksonville, 173 U. S. 131.
¶28Respondent, in insisting on the letter of its agreement, talles a position in effect inconsistent with its obligation to secure to the treasurer the repayment of his deposits to the extent of $125,000. If after paying that amount to the treasurer it may then compete with him in the distribution of the insolvent’s assets, the treasurer’s recovery on the balance of-his claim is reduced accordingly and the benefit of the surety bond to the treasurer is diminished pro tanto. By the expedient of. taking a separate indemnity agreement from the debtor the surety would be enabled to deprive the creditor of the full benefit of the security he had demanded.
¶29The established rule that the surety may not claim subrogation against an insolvent debtor until the creditor is paid in full is a recognition of the inconsistency of that position. United States v. National Surety Co., 254 U. S. 73, 76; Peoples v. Peoples Bros., 254 Fed. 489; United *267States Fidelity & Guaranty Co. v. Union Bank & Trust Co., 228 Fed. 448, 455. The rule would go for naught if, by claiming indemnity instead of subrogation, the surety could achieve the same result. The same policy against permitting a surety to compete with the creditor for the insolvent debtor’s assets requires that the surety be denied subrogation to security given to a creditor for several debts for only one of which the surety is obligated. National Bank of Commerce v. Rockefeller, 174 Fed. 22. Similar reasoning underlies the requirement of equity that the surety who holds the security of an insolvent debtor must give the benefit of it to the creditor for whom he is surety, until the debt is fully paid. See Keller v. Ashford, 133 U. S. 610; Hampton v. Phipps, 108 U. S. 260; Chamberlain v. St. Paul, 92 U. S. 299, 306; 2 Pomeroy, Equitable Remedies (2d ed.) § 925.
¶30Wherever equitable principles are called in play, as they preeminently are in determining the rights and liabilities of sureties and in the distribution of insolvents’ estates, they likewise forbid the surety to secure by independent contract with the debtor indemnity at the expense of the creditor whose claim he has undertaken to secure.
¶31Reversed.