The broad doctrine prevails in this State, touching the principle of subrogation, that a creditor is entitled to the benefit of all pledges or securities, given to, or in the hands of a surety, for his indemnity. And this is the rule, whether the surety has been damnified or not, inasmuch as such securities are generally regarded as a trust created for the payment of the debt.— Colt v. Barnes, 64 Ala. 108; Saffold v. Wade. 51 Ala. 214; Forrest v. Luddington, 68 Ala. 1, and cases cited.
While this principle is not denied, it is insisted, on the part of the appellees’ counsel, that where a surety holds a mortgage, or other security, merely for his own personal benefit or indemnity, as distinguished from the idea of creating a security for the debt, or of providing means for its payment,' the creditor is not entitled to any greater rights or remedies than the surety; and that the latter’s indemnity is not available to the creditor, unless in the event of the insolvency of both the principal and the surety, which originates a new equity in favor of the creditor. The correctness of this principle may be conceded, in view of the fact that the rights of the creditor must necessarily be measured by those of the surety, and being wrought out through the equity of subrogation, which is but the substitution of one person in the shoes of another, they can be neither increased nor diminished by such act of transfer. — Sheldon on Subrog., §§ 157, 160, 162 ; Brandt on Sur., §§ 282-85; Forrest v. Luddington, supra.
So, the rights of the surety must be determined by the terms of the instrument which creates the indemnity. If the mortgage, or other security, is not given to secure the debt, or to provide a fund for its payment, but merely to save harmless from a contingent liability or loss, the contingency must happen, or the loss be sustained, before a right arises in favor of the creditor to the indemnity, — at least, without the intervening insolvency of both the principal and the surety. In Osborne v. Noble, 46 Miss. 449, we find the general rule succinctly stated as follows: “Where the contract is for the personal benefit of the surety, in opposition to the idea of a pledge for the debt, *570or providing means for its payment, the creditor can claim only such rights and remedies as the surety had. If he has not been damnified, and the conditions of the mortgage, or other contract of indemnity, are unbroken, the surety himself could assert no remedy; nor could the creditor, claiming through him, and in his stead, have substitution.”- — Bibb v. Martin, 14 S. & M. (Miss.) 87; Sheldon on Subrog. §§ 157, 160; Brandt on Sur. § 281.
The mortgage in the present case was executed by the principal in a guardian bond, as an indemnity to the defendant, who was his surety. The condition of the mortgage is, that the mortgagor, as guardian, should well and truly manage his guardianship “in terms of the law”; by which we are to understand, that he would faithfully discharge all the duties of his office which were imposed upon him by law. This included, of course, the payment to his wards of any balance due them on the final settlement of the guardianship, which is shown by the bill to be something over eleven hundred dollars.
The mortgage further provides, that if the guardian, Burnett, failed “to comply with the terms of the law in the said guardianship, and caused loss by the said R. IT. Hunt [the surety],” the latter was authorized to take possession of the land mortgaged, and sell the same for the payment of such loss, and certain expenses. It is objected by demurrer, that the instrument contemplates an actual loss by the surety incurred by his payment of the debt; and that it was therefore intended, not as a security for the payment of the debt, but merely for the personal benefit of the surety himself, upon a contingency which has not yet happened. We do not so construe the instrument. The condition of the mortgage was broken, when the guardian failed to pay over to the complainants the balance which he owed them on final settlement. When this happened, there was, in legal contemplation, a loss to the surety, who was personally bound for the payment of the debt. It is plain that the word “ loss,” here, means nothing more than legal damage, detriment, or forfeiture. We can see nothing in the language of this instrument, which rebuts the view that the security given was intended to attach to the debt as an accessory to it, being held in trust by the mortgagee for the benefit of the creditor, rather than for his own personal indemnity upon the contingency of his paying the surety debt.
It was not necessary that the debt should have been reduced to judgment, or that the creditors should have exhausted their legal remedies, before becoming entitled to the equity of subrogation. The whole equity of the bill is based upon the theory of enforcing a trust, which is claimed to enure to the benefit *571of the complainants by subrogation. — Saffold v. Wade, 51 Ala. 214.
The chancellor erred in sustaining the demurrer to the bill; and his decree is reversed, and the cause remanded.