after stating the case: There are two questions presented in this ease, one arising out of the equitable principle of subrogation and the other out of the law of agency. Defendant Mrs. Moore contends that the plaintiff has not brought itself within the protection of the doctrine of subrogation, because, first, her husband was not authorized to contract with plaintiff in respect to the sale of the Mergenthaler linotype so as to bind her; second, that the full amount of the debt owing by her to the Mergenthaler Company was not paid from the proceeds of plaintiff’s discounted note, but only a part thereof, and, third, that plaintiff was a mere volunteer and under no legal obligation to pay the debt, even pro tanto. She also contends that plaintiff did not pay the note given to Mr. Moore until after the commencement of this action; and, lastly, that she is a necessary party to this suit to protect her interests.
We are satisfied, from Mrs. Moore’s own testimony, that there was sufficient evidence of her husband’s agency to be left to the jury. It appears therefrom that she knew he was assuming to act for her in the pending negotiations for the sale 'of the linotype to plaintiff, and being aware of this fact, if she had not consented to his doing so, it was her plain duty to disavow his act, in order that the plaintiff would not be prejudiced by his false assumption of authority. But there is additional proof that he was so acting, not only with her knowledge, but with her express consent. This being so, it is clearly established that, where an agent exceeds his authority, his principal must either wholly ratify or wholly repudiate the transaction. He cannot accept the beneficial part and reject what is left of it. 31 Cyc., 1257, 1258; Rudasill v. Falls, 92 N. C., 222.
In the case just cited, Chief Justice Smith says:
“ ‘The principal cannot, of his own mere authority, ratify a transaction in part and repudiate it as to the rest,’ is the language of Mr. Justice Story in section 250 of his work on *483Agency. ‘He must either adopt'the whole or none.’ Another recent author lays down the same doctrine thus: ‘A nullification must extend to the whole of a transaction.’ • So well established is this principle, that if a party is treated as an agent in respect to one part of a transaction, the whole is thereby ratified. From this maxim results a rule of universal application, that where a contract has been entered into by one man as agent for another, the person on whose behalf it has been made ‘cannot take the benefit of it without bearing its burdens. The contract must be performed in its ’ entirety.’ Ewell’s Evans’ Agency, 70 (Ed. of 1879, p. 95). The rule rests upon sound reason and abundant authority. Crawford v. Barkley, 18 Ala., 270; Hodnett v. Tatum, 9 Ga., 270; Bank v. Hanner, 14 Mich., 208; Coleman v. Itache, 1 Ore., 115.” See, also, Christian v. Yarborough, 124 N. C., 72.
Mrs. Moore and her assignee, the defendant E. F. Barber, have received the benefit of the reduction in the mortgage indebtedness by the payment thereon of the proceeds of the discounted note given by plaintiff to Mr. Moore, agent of his wife, but they now insist upon retaining the same, and have made no offer to return the amount thereof to plaintiff, so that the parties can be placed in statu quo.
Plaintiff was not a volunteer.' It acted upon the bona fide belief, and had the right to do so, that Moore either owned the machine himself or had authority from his wife to sell it, if she owned it. There is no evidence that plaintiff did not act honestly in the transaction. ’ It was attempting in good faith to protect its own interests in what it believed to be a rightful sale of the property to it. The fact that it may have been mistaken in this belief does not make it a volunteer, while it is true that a mere' volunteer or intermeddler who, having no interest to protect and without any legal or moral obligation, pays the debt of another, is not entitled to subrogation without an agreement to this effect, or an assignment of the debt, and that the payment by him absolutely extinguishes the debt. It always requires something more than the mere payment of a debt in order to entitle the person paying the same to be substituted in *484tbe place of the original creditor. There must be the discharge of a legal obligation for another who is under a 'primary obligation, for no man can make another his debtor without his consent, and on]y a creditor or person under liability can invoke the doctrine, there being no debt, there can be no .ground for subrogation. Furthermore, the payer must have acted on compulsion to save himself from loss, and it is only in cases where the person paying the debt of another stands in the relation of a surety, or is compelled' to pay in order to protect his own interests or by virtue of legal process, that equity substitutes him in the place of the creditor without any agreement to that effect; in other cases the debt is absolutely extinguished. 37 Cyc., 375.
Volunteers, in the absence of some special circumstance upon which they can base their claims, can obtain the equal right to be subrogated only by virtue of an agreement, express or implied, or by request from the debtor to pay, which is in effect an implied contract, or by ratification, or by taking an assignment of the debt. But payments made in ignorance of the 'real state of facts cannot be said to be voluntary, and a person who has paid a debt under a colorable obligation to do so, that he may protect his own claim, or under an honest belief that he is bound, will be subrogated; and a person who mistakenly, but in good faith, believes that' he has an interest in property, to protect which he discharges a lien, is subrogated to the lien for his repayment; and subrogation is sometimes extended to cases of payment by persons not legally bound to pay, but who do so, not as volunteers, but with a well-founded expectation, justified by the conduct or the contract of the debtor, that they will be entitled to hold the securities for their indemnity which the creditor had against the debtor; and in one jurisdiction it has been held that a stranger who pays a debt without request by the debtor, when his payment is not ratified by the debtor, may bring a suit in equity, praying relief in the alternative, that if the debtor do not ratify such payment the debt may be enforced in his favor as its equitable assignee, or, if so ratified, that' he. be decreed repayment of the *485amount paid for tbe use of tbe debtor. “Payment under a’ moral obligation is not voluntary.” 37 Cyc., 376 to 379 and notes.
Mr. Sbeldon, in bis standard treatise on tbe Law of Subro-gation, states tbe rule clearly, with apt illustrations and examples, in section 36: “Tbe right of subrogation does not depend upon tbe validity of tbe title of tbe person claiming to be reimbursed for bis payment in discharge of a prior encumbrance. It is merely necessary that bis payment should have been made in good faith for tbe protection of an interest which be believed himself to have in tbe estate, and in discharge of a burden actually resting upon tbe property, so that bis payment has increased tbe value of tbe estate for tbe benefit of those who turn out subsequently to be owners of title. Tbe benefit of subrogation has accordingly been allowed to one who held merely an invalid or a verbal contract for tbe conveyance of tbe land which be has freed from an encumbrance; to tbe assignee of one who held such a contract; to one whose Only title was under an- invalid mortgage, or under a voidable decree; to one who claimed only under a void or a voidable sale, even after tbe avoidance of tbe sale by order of court; to an unsecured creditor who has paid off a mortgage debt in compliance with an erroneous order of court; to a devisee who has only a contingent remainder in tbe. encumbered estate, and to one who bolds merely an equitable lien upon tbe property. If be bona, fide claims an interest, be is not a mere volunteer, and may be subrogated, but be must show that be bad or supposed be bad some interest to be protected.”
And again, at section 247: “One who pays' a debt at tbe instance of tbe debtor, under such circumstances that it appears to have been contemplated by tbe parties that be should become entitled to tbe benefit of tbe security for tbe debt held by tbe creditor from tbe debtor, may, as against tbe debtor and tbe debtor’s estate, be subrogated to tbe benefit of such security and of tbe debt which be has discharged. And a party who has paid a debt at tbe request of tbe debtor, under circumstances which would operate. a fraud upon him if tbe debtor *486were afterwards allowed to insist that the security for the debt was discharged by his payment, may also be subrogated to the security, as against the debtor.” He then-adds that while the right will not be enforced in favor of a mere volunteer or stranger, who was under no obligation to pay the debt, or any part of it,.yet if it may be gathered from the circumstances attending the transaction that it was not intended to extinguish the debt, but the payment was made in reliance upon the security, a species of conventional subrogation arises by implication. One who had paid off a mortgage debt under the mistaken belief that the title to the land was in his wife, while it really belonged to her daughter by a previous marriage, was allowed against the daughter a charge upon the land to reimburse him for this payment. So the lender of money borrowed by a corporation ultra vires may be subrogated to the rights of lawful creditors of the company who have been paid out of such money, and allowed to recover from the company to the extent of the lawful liabilities so paid off.
For the prevention of fraud, a person who advances money to pay off a mortgage, believing that it was the only lien upon the land, may be subrogated to the lien of that mortgage, as against a surety who has paid a judgment which was a lien subsequent to the mortgage, and the payment of which appeared by the record to have been otherwise provided for. Sheldon on Subrogation, pp. 30, 31, sec. 19, citing Haggerty v. McCanne, 25 N. J. Eq., 48; Brooks v. Blackburn Benefit Society, 1 App. Cases (Eng.), 857; R. R. Society v. Cunliff, 22 Ch. Div., 61; Wenlock v. River Dee Co., 19 Q. B. Div., 155.
It hqs been held that though a mere volunteer cannot, by j>aying off a mortgage, acquire an equitable lien or any right of subrogation, yet if he advances the money to redeem or pay off a mortgage at the request of one who is interested or bound to discharge it, he may be protected against such person by subrogation. Sheldon on Subrogation, p. 31; Gans v. Thieme, 93 N. Y., 225, and other eases cited by Sheldon in note 6, p. 31.
In the case of Gans v. Thieme, supra, the Court said: “It is no doubt true, however, as the learned counsel for the re*487spondent argues, that a volunteer cannot acquire either an equitable lien or the right to subrogation (Sandford v. McLean, 3 Paige, 122; Wilkes v. Harper, 1 N. Y., 586; 2 Barb. Ch., 338) ; but one who, at the request of another, advances his money to redeem or even to pay off a security in which that other has an interest, or to the discharge of which he is bound, is not of that character, and in the absence of an express agreement, one would be implied, if necessary, that it shall subsist for his use, and it will be so enforced. But the doctrine of substitution may be applied although there is no contract, express or implied. It is said to rest ‘on the basis of mere equity and benevolence’ (Cheeseborough v. Millard, 1 Jons. Ch., 409; 1 Story’s Equity Jurisprudence, sec. 493), and is resorted to for the purpose of doing justice between the parties. ... It will subserve the purposes of justice and violate no rulé of law to subrogate them to the lien of the mortgage as against any of ‘the parties to this action, since their title was affected by it (Barnes v. Mott, 64 N. Y., 397; 21 Am. Rep., 625), and no wrong can be done to either by putting the plaintiffs in the place of the original creditor.”
Bispham on Equity, at p. 45lj states that where a debtor borrows money for the purpose of discharging a lien, the person thus advancing the money may be subrogated by the debtor to the creditor’s rights, and is not to be deemed a volunteer. And this result may follow in certain cases even where no such express agreement for subrogation exists. No general rule, in short, can be laid down. Each case must be decided on its own merits, citing H. L. B. Association v. Fire Association, 180 Pa., 522.
Let us consider for a moment the elementary conception of subrogation and its primary elements. It is the substitution of another person in the place of a creditor, so that the person in whose favor it is exercised succeeds to the rights of the creditor in relation to the debt. The doctrine is one of equity and benevolence, and, like contribution and other similar equitable rights, was adopted from the civil law, and its basis is the doing of complete, essential, and perfect justice between all the *488parties without regard to form, and its object is the prevention of injustice. The right does not- necessarily rest on contract or privity, but upon principles of natural equity, and does not depend upon the act of the creditor, but may be independent of him and also of the debtor. While subrogation is not founded on contract, there must, in every case where the doctrine is invoked, in addition to the inherent justice of the case, concur therewith some principle of equity jurisprudence as recognized and enforced by courts of equity. Where the right of sub-rogation exists, it is subject to prior equities and all the rules of equity. The subrogation just described is very generally referred to as legal subrogation to differentiate it from conventional subrogation or subrogation arising from express contract 'between the payer and the debtor or creditor that the payer shall be subrogated, rather than from the automatic operation of a rule of law upon a given set of circumstances. Conventional subrogation or subrogation by act of parties may take place by the debtor’s agreement that one paying a claim shall stand in the creditor’s shoes, and furthermore can arise only by reason of an express or implied agreement between the payer and either the debtor or the creditor, and the agreement, like other agreements, must be supported by a consideration. It is not essential to subrogation by convention that the creditor should be a party to the agreement between the debtor and a third party, provided no intervening rights to the -security have occurred; but subrogation by convention is not applicable where it would prejudice the rights of innocent parties. 37 Cyc., pp. 363 et-seq. The nature and grounds of subrogation are very clear. The difficulties arise in its application to the innumerable complications of business. The courts incline, however, rather to extend than restrict the principle, and the doctrine has been steadily growing and expanding in importance, and is becoming more general in its application to various subjects and classes of persons, the principle being modified 'to meet the circumstances of cases as they have arisen. 37 Cyc., p. 373. The doctrine has been applied much more extensively, it has been said, in-the courts of this country than in English *489jurisprudence, under the initial guidance of Chancellor Kent.
Applying these principles to our case, and the right of the plaintiff to this equity clearly appears. There was good ground for it to believe that Mr. Moore was acting within his authority, either personal or representative, and the plaintiff acted in good faith, believing ¶ that it was acquiring a perfect title to the machine; it made the note for the purpose of being discounted, so that the proceeds might be applied.to the payment of the notes then due, and they were so applied; it paid the notes in the protection of the interest in the property which it then believed would pass to it under the contract with Mr. Moore. It acted prudently and not rashly, in view of the facts and circumstances as they then appeared to be. Mrs. Moore has received and she and defendant now enjoy the benefit of the payment.
Sheldon almost states our case at section 19: “Where a person advances money to pay off a mortgage debt under an agreement (express or implied) with the owner of the equity of redemption or his representative that he shall hold the mortgage as security for his advance, but the mortgage, instead of being-assigned to him, is discharged in whole or in part, he is yet entitled as against subsequent parties in interest to be subro-gated to the rights of the mortgagee and to enforce the mortgage.”
Cases in our own reports illustrate the doctrine that though the party who makes the payment may, in "fact, have ílo real or valid legal interest to protect, he may yet be subrogated when he acts in good faith, in the belief that he had such interest. An administrator who had paid the debts of his intestate to a larger amount than the assets in his hands was, in equity, substituted to the rights of the creditors whose claims he had thus satisfied, and recovered of the heir the sum overpaid. Williams v. Williams, 17 N. C., 69. The Court said his act was not officious nor the act of a mere stranger who endeavors to make one his debtor by payments on his account which were made against his will and without his request. He was not an intermeddler, if he acted in good faith, nor was it a *490mere act of “unauthorized forwardness” beyond his known obligations and duty. Sanders v. Sanders, 17 N. C., 262. And so, in Scott v. Dunn, 21 N. C., 425, where an executor had sold lands of his testator without any authority to do so and under a mistake of his power, and applied the proceeds to the,payment of the debts, and the purchaser was evicted by the devisee, the land was subjected, in equity, to indemnify the purchaser to the extent of the'payment on the debts, and so far as the personal property was not sufficient to pay them. Judge Q-aston said, at p. 427: “As between Dunn and the plaintiffs, if their money were yet in his hands, he. could not retain it with a safe conscience, and would be obliged to refund it. And it seems to us clear that if he could rightfully reclaim it from his co-defendants, he might be compelled to assert.this right, or permit the plaintiffs to assert it in his name, in order that it might be refunded. The court would do this upon the same principle by which the surety, on making satisfaction to the creditor, becomes entitled to demand every means of enforcing payment which the creditor himself had against the principal debtor: a principle which, when traced to its origin, is founded on the plain obligations of humanity which bind every one to furnish to another those aids to escape from loss which he can part with without injury to himself. (Home’s Prin. of Equity, 84.)” See, also, Springs v. Haven, 56 N. C., 96; Perry v. Adams, 98 N. C., 167; Smith v. Brown, 101 N. C., 349.
In Springs v. Haven, supra, Judge Pearson, referring to an unauthorized sale by Lewis Dinkins, as executor of Thomas Kendrick, said: “To mend this difficulty, the plaintiffs must have recourse to another well established doctrine of this Court, namely, that of ‘substitution.’ According to this doctrine, the plaintiffs (as purchasers).are not entitled to the land, but have 'an equity to be substituted in the place of the creditors of Kendrick, whose debts were paid with the money received from Lewis Dinkins, arising from the sale of the land. That money discharged debts for which the land was liable, and as the defendants take the land, of course they take it subject to the repayment of the money by means of which the land was exoner*491ated. Scott v. Dunn, 1 Dev. and Bat. Eq., 425, is in point as to the application of the principle, and also as to the mode of redress. There it is said: 'The doctrine of substitution is not founded on contract, but on the principle of natural justice. Unquestionably the devisees cannot be injured by the mistake of the executor as to the extent of his power over the land, but that mistake should not give them unfair'gain/ ”
In our case the principles of equity require, in order to do justice, that plaintiff should be substituted pro tanto to the rights of the mortgagee as against the property now in the hands of the defendant, unless the other objection of defendant should be allowed to prevail.
It is contended that a payment of a part of the secured debt is not sufficient to induce the court to act in behalf of the plaintiff. But this is an erroneous view of the principle invoked, in its application to the facts. The general principle undoubtedly is that such a payment will not be sufficient, but there are exceptions to this rule.
37 Oye., p. 409, thus states this doctrine and its limitations: “A pro tanto assignment or subrogation will not be. allowed, and the same rule applies to an indorser. But although the rule is sometimes narrowly stated that the surety is not entitled to subrogation until he has paid the entire debt, if a surety pays part of the debt and the principal the balance, the surety will be subrogated to all the benefits which the creditor had against the principal to the extent of his payment, and in general it is sufficient if the balance of the creditor’s debt has been otherwise satisfied. Nor is it essential that the surety should have paid the full amount of the debt in 'money, provided the creditor be' satisfied; if he has discharged the burden, leaving in the creditor nothing further to demand, he will be entitled to sub-rogation, but only for indemnity to the extent of the money paid or value of the property applied.”
It will be seen that this principle of pro tanto subrogation applies except where it interferes with the rights of the creditor holding the security, and a part payment is sufficient as against the debtor and mortgagor to raise the equity in behalf of the *492one who bas made the partial payment. He is entitled to the benefit of the equity, but subordinate to the creditor’s prior light, and the latter must not be prejudiced by allowing it. 37 Cyc., 409 and 410. At the latter page it is said: “Only a creditor holding the securities can object to a subrogation pro tanto of a surety who has paid a portion of the debt, whether the surety has entirely satisfied the debt or not, and the creditor may allow the surety to be subrogated before the indebtedness is wholly satisfied.” “He (the party making the payment) will not be subrogated to the benefit of the mortgage as against the others who are secured thereby, by his having furnished the debtor with the means to make a partial payment of the mortgage debt, even though he holds the agreement of the mortgagor that he shall be protected by the mortgage. The mortgagor’s agreement cannot prejudice the mortgagees, though it would bind the mortgagor himself.” (Italics ours.) Sheldon, sec. 19; Cameron v. Tome, 64 Md., 507; Haven v. R. R., 109 Mass., 88. Sheldon, sec. 128, also states this principle with clearness.: “It is the creditor who is entitled to satisfaction; and neither the debtor nor any other creditors can object to any arrangement between the surety and the creditor for the subrogation of the surety, whether the latter has or has not completely satisfied the debt. ... If the principal debtor has himself paid part of the indebtedness, and the surety only the balance, yet, when dice the creditor is wholly satisfied, the same principle of equity which substitutes the surety who has paid the whole debt to the place of the creditor will equally protect the surety paying a part thereof, to the extent of his payment. A partial payment is sufficient to establish the surety’s right as against the principal, or any one standing in the place of the principal; it is only the creditor who can insist that the debt must be paid in 'full. Nor need the surety’s payment be in money; whatever is accepted by the creditor as a payment, so as to discharge the principal debtor from his liability, will operate as a payment in favor of the surety. But until the creditor has been paid in full, the surety cannot, against the will of the creditor, in any manner interfere with the latter’s rights or *493securities, so as to put him to an embarrassment in collecting tbe remainder of bis demand. If tbe surety bas made partial payments upon a debt secured by a mortgage from tbe principal debtor, then upon foreclosure any surplus proceeds over tbe amount needed to pay tbe creditor in full must be applied to repay tbe surety.” See, also, Gedge v. Matson, 25 Beav., 310; Comins v. Culver, 35 N. J. Eq., 94; Rooker v. Benson, 83 Ind., 250.
It will be seen from these authorities that thé creditor alone can object to subrogation under a partial payment, and only to tbe extent that it would impair bis preferred rights. Tbe last reference to Sheldon also answers the other objections.
Here tbe original creditor, tbe Mergentbaler- Company, bas been satisfied and retired from tbe transaction, and bas no, further interest in it, and before this occurred, it bad accepted tbe proceeds of tbe discounted note as a payment pro tanto, and this satisfied tbe debt to its amount. Tbe position of tbe defendant, that tbe note was not paid until after tbe suit was brought, and therefore there was no payment before and consequently no cause of action, is clearly untenable. It is payment to the creditor, or what be accepts as payment, and not tbe manner of raising tbe money, that brings into play tbe equity of subrogation, and it makes no difference that tbe note upon which tbe money was procured by discount bad not been paid when tbe suit was commenced. Plaintiff was liable upon it to tbe bank at which it was discounted. Equity does not regard tbe form, but tbe substance, of tbe transaction. Tbe creditor’s debt was satisfied pro tanto by tbe discount and application of tbe proceeds, even though plaintiff’s note was not paid.
Tbe principle stated in tbe authorities cited by defendant (Tan Zile on Equity Pleading and Practice, secs. 446, 448, 450; 4 Pomeroy’s Eq. Jur., sec. 923, and Sanford v. McLean, 23 Am. Dec., 773) are not at variance with thosfe expressed herein, but in perfect harmony with them, when rightly considered and applied. In tbe law of subrogation, tbe distinction between a-mere voluntary or intermeddler and one who pays in tbe protection of a right or interest, believed to be good, though it may *494turn out afterwards to be an invalid one, is well marked by tbe authorities, and the limitations of the principle, as to a partial payment, is also clearly defined.
Our conclusion is that plaintiff is entitled to subrogation as against Mrs. Moore, and her assignee, the defendant Barber, who had full notice of the equity. He has received a direct benefit in the reduction pro tanto of the debt he had to pay to the Mergenthaler Company,, as a part of the price, in the purchase of the linotype, and, besides, he has been fully indemnified against all loss, and. therefore has no ground of complaint against the decree.
The only difficulty we have had in deciding the case is upon the last question. Mrs. Moore moved to be made a party in order to protect her interests. So far as the record shows, she has parted with all of her interest in the machine, and it does not appear that she will be answerable over to the indemnitors of the defendant. So it follows that, upon the present record, as the facts now appear, she has no interest to protect. But while this is apparently true, and while we have considered the case upon the conceded facts, and her own testimony, and' it would seem to be clear, therefore, that she will not be prejudiced by the refusal of the court to make her a party, we do not see how the facts can be changed at all by her presence as a party in the case. We have held that she is bound by her husband’s apparent, if not real, authority to act as her agent in making the sale, and while, perhaps, not bound by the terms of the sale to plaintiff, under which she was to receive stock instead of cash, she cannot repudiate the invalid part of the transaction without restoring what she, has received in the way of benefit to herself. Equity requires this to be done in the adjustment "of the matter. As to the principle of subrogation, its object is, as we have seen, to place the ultimate liability where, in equity and good conscience, it should rest, that is, upon the person who should discharge it, and that is the effect of our decision. So that, upon the real merits of the controversy, in any view of it, the law is against the defendant. The *495reason for the rule of subrogation, that the burden should rest upon the person ultimately liable, was strikingly illustrated in the recent case of Barber v. Hanie, 163 N. C., 588.
No error.