Fish, J.
The record before us presents for decision the single question, whether or not the plaintiff in the court below could invoke in his behalf the doctrine of equitable subrogation, Doubtless, under the circumstances disclosed, he may be in need of the protection sought; yet, as this is not the criterion which should be applied in determining his right to demand the aid of the courts, we will, before undertaking to deal with the peculiar facts of this case, enter upon a brief discussion of the general principles upon which equitable jurisdiction in this class of cases is based, with a view to ascertaining his attitude as regards the other parties at interest. As defined in 24 Am. & Eng. Ene. L. 187, “ Subrogation is the substitution of another person in the place of. a creditor or claimant, to whose rights he succeeds in relation to the debt or claim asserted, ■which has been paid by him not voluntarily, and contemplates some original privilege on the part of him to whose place sub*56stitution is claimed.” To afford relief and protection to a mere volunteer — an uninvited intermeddler in the affairs of others —is not remotely contemplated by the doctrine under discussion. Sheldon on Subrogation (2d ed.), §240; Harris’s Law of Subrogation, §792; 3 Pomeroy’s Eq. Jur. §1212; 24 Am. & Eng. Enc. L. 281. On the contrary, “It is only in those cases where the person advancing money to pay the debt of a third party stands in the situation of a surety, or is compelled to pay it to protect his own rights, that a court of equity, as a matter of course and without any agreement to that effect, substitutes him in the place of the creditor.” Sanford v. McLean, 3 Paige, 117, cited approvingly in Shinn v. Budd, 14 N. J. Eq. 234, 238; Watson v. Wilcox, 39 Wis. 643, 650; Ætna Life Ins. Co. v. Middleport, 124 U. S. 534, 550, as laying down the correct rule. This rule, it will be observed, distinctly recognizes the right of one parting with his money to expressly stipulate that he shall be substituted for and occupy the position of another whose rights in the premises he seeks to acquire ; and all the authorities above cited agree that a special contract of this nature, whenever it contemplates what is commonly known as “conventional subrogation,” is perfectly legitimate and enforceable. “ This convention or agreement may be made with either the debtor or creditor.” 24 Am. & Eng. Ene. L. 291. Albeit a person thus advancing his money at the instance of the debtor or creditor may have had no prior connection with the transaction between them, or any interest therein it may be necessary for him to protect, he “is in no true sense a mere stranger and volunteer.” 3 Pomeroy’s Eq. Jur., supra. He acquires, by contract, an immediate concern in the matter, to an extent equal to that of the person to whose rights it is expressly agreed he shall succeed, and consequently is entitled to claim all the privileges necessarily incident to a realization of the fruits of his bargain. Harris’s Law of Subrogation, cited above. Thus, “One who advances money to pay off an encumbrance, upon an agreement with the debtor that the security shall be assigned to him, or a new one given to him, will be subrogated to the rights of the encumbrancer; and if the new security turns out to be defective, he will be substituted to the benefit of the prior *57encumbrance, unless the superior or equal equities of others would be prejudiced thereby.” 24 Am. & Eng. Ene. L. 292-294. The theory upon which a court of equity proceeds, in ■an instance such as that just cited, would seem to be that where one expressly contracts with a debtor for security which will secure, the fact that he does not actually get it is immaterial, unless equal or superior rights of third persons have intervened ; for, as against the debtor himself and all parties whose rights will not be injuriously affected, the contract between him and the person in good faith advancing his money should be given effect, and consequently that will be considered done which ought to have been done. In other words, such person will be ■deemed to occupy the situation in which he would have been placed had the contract been executed in strict conformity to the express agreement between the parties, and his rights will be measured accordingly, whenever protection of him does not also involve a disregard of the rights, legal or equitable, -of others concerned.
Considered in the light of the principles above enunciated, we see no merit in the contention, insisted upon by the Merchants and Mechanics Bank in the present case, that Tillman, who claims to have advanced his money upon the distinct un•derstanding that he was to acquire a first lien on the property in question, is to be regarded as a mere volunteer. Jefferson, the debtor of the bank and the owner of land bought subject to a security-deed in favor of Larned, procured Tillman to advance the money necessary to remove this encumbrance. At the time, the bank was the holder of a junior mortgage lien upon the same • premises, Jefferson having previously executed a mortgage in its favor to secure his debt to it. Of the existence of this mortgage.lien Tillman had no actual knowledge. Therefore, when he accepted the papers executed with a view to giving him the first and highest lien on the ¡property, it can not be said that he made a mistake of law as to the legal effect of these clocumonts, and consequently can not complain, for the reason that he got exactly what he bargained for. Had it not been for the bank’s mortgage, of which Tillman was ignorant, the security accepted by him would have fully come up to that contracted *58for, and he would have succeeded to the rights of Larned, which seems clearly to have been in contemplation of all the parties; to the arrangement by which his security-deed was canceled. Tillman agreed that this security-deed should be canceled of record, but he did so upon the understanding that papers should be immediately executed the effect of which would be to continue in him a lien of the rank of the one thus sacrificed. The-present case is therefore similar to that of Union Mortgage,, Banking & Trust Co. v. Peters & Trezevant, 72 Miss; 1058, relied on by defendants in error, wherein it was held that: “Where money is loaned under an agreement that it is to be used in paying off a*first lien on the borrower’s property, and that the lender is to have a mortgage thereon as primary security, the borrower representing that the holder of a second mortgage had agreed that the new mortgage should have priority, and it turns, out that this is untrue, if the money advanced is applied in the payment of the first encumbrance, and mortgage is taken by the lender as agreed, he will, as against the borrower and the holder of the second mortgage, be subrogated to the lien of the prior-encumbrance, which will be kept alive for his protection, although it was not expected or intended that he would be subrogated thereto, and although the first mortgage was canceled as agreed.” The decision was put upon the ground that “the holder of the second mortgage, being placed in no worse position by the transaction, can not complain of the subrogation.” This reasoning applies with equal force to the junior encumbrancerin the present case, i. e. the bank. Unquestionably Jefferson had a right, as against the bank, to agree with Tillman that if' the latter should pay off the Larned encumbrance, he should be secured to the extent of the money advanced by a lien superior to that held by the bank. Accordingly, the bank can not complain if Tillman is accorded the benefit of his agreement with Jefferson for a first lien on the property, notwithstanding such agreement was not actually carried out in such manner as to effectuate the result in contemplation. No contract right of the bank will be disturbed or affected by giving this direction to the case, nor will the bank be deprived of any advantage save that resulting from the mistake of Tillman, which, under-*59the circumstances, it would be unconscionable to assert. The bank can not, as matter of right, insist that the present status of the parties remain unchanged. True, the senior encumbrance appears of record canceled. Yet, a court of equity has power to annul the cancelation of this instrument. Cobb v. Dyer, 69 Me. 494. Or, in determining the merits of Tillman’s claim that he is entitled to be subrogated to the rights incident to this prior encumbrance, it may, without formal order annulling its cancelation, be considered as still in existence, to the end that his right to the remedy invoked may not be defeated by a circumstance which has no real bearing on this issue.
■It is urged by the plaintiff in error that this remedy, the writ of injunction, is a harsh one and should be granted only where absolutely demanded. But what other recourse is open to Tillman? The bank refuses to recognize that he is entitled to a lien superior to its mortgage, which it is proceeding to foreclose. If a sale of the property takes place thereunder, he will not be in a position to file a claim in a court of law to the proceeds realized from the sale, and the bank will thus be enabled to gain an undue advantage over him. The reply is made to this, that he does not affirmatively show that he will suffer irreparable loss, as he holds other security for his claim, of a character apparently as good or better than the land itself. This argument, however, fails to fully meet the issue. Tillman undertakes to show that, as between himsélf and the bank, he is entitled to first be paid out of the land in question, and if so, the mere fact that he holds other security will not defeat this right, or furnish any excuse for the bank to disregard the same. On the contrary, the bank may, and should, be restrained from seeking to gain an inequitable advantage over Tillman by an attempt to enforce its lien as the apparently senior, though in point of fact the junior, encumbrance upon the property. The present action has for its object merely the adjudication of the question whether or not the claim of Tillman should, in equity and good conscience, take precedence over the lien being asserted by the bank. Whether Jefferson is or is not insolvent can have no bearing upon this issue, which involves only the determination of the relative dignity of the two liens relied on, *60respectively, by Tillman'and the bank. He is entitled, under the evidence submitted in support of his petition, to have his declared the superior of the two. If, after his rights have thus been established, it should appear that Jefferson is insolvent and the proceeds realized from a sale of the land will be insufficient to discharge both claims against him, the bank might, in an appropriate equitable proceeding, compel Tillman to first exhaust the other security held by him before going upon the land to the bank’s prejudice; but in no other event can the bank defeat the right of Tillman to assert the superiority of his demand against Jefferson and subject the land to the extinguishment of the same.
Again, it is insisted that Tillman is not entitled to any relief, because, by the exercise of ordinary prudence, he could have discovered all the facts and taken the necessary steps to protect himself. As above pointed out, however, the mistake made by him was one of fact, not of law, in supposing the papers taken by him as security constituted a first lien on the property. He had no actual knowledge of the bank’s mortgage, though it is true he had constructive notice thereof, the same having been duly recorded. “To be sure, he might have learned the fact of the existence of [this lien] had he exercised the prudence of a man of business dealing with a stranger in relation to land ” title to which was claimed by the latter. “ But a searching of the record [was] not indispensable.” Cobb v. Dyer, supra, citing Grimes v. Kimball, 3 Allen, 518, 522. The doctrine of constructive notice is resorted to from necessity, its object being to protect the rights of innocent third persons, and should never be applied in favor of parties not entitled to the protection it affords. See cases cited in note 1, pages 791 and 792 of 16 Am. & Eng. Ene. L., under the subhead: “When the Doctrine is Applied.” Obviously, culpable neglect on the part of one seeking the aid of a court of equity never constitutes a valid defense to the action which his adversary can set up as matter of right. The attention of the court may very properly be called to the fact that the plaintiff is chargeable with an improvident omission to take care of himself; but the refusal of the court to lend him aid always proceeds upon the *61idea that it is under no duty to afford him relief against his-own unpardonable blunders, and is never predicated upon the theory that the defendant has a right to excuse his own alleged wrong-doing upon any such 'ground. If follows that it must plainly appear that the person seeking the aid of the court has-by his own culpable neglect forfeited all claim to its protection; and if any doubt upon this score exists, it should be decided in his favor rather than in that of the opposite party. So far as the present case is concerned, we can not say, as matter of law, that Tillman’s omission to avail himself of the opportunity afforded'him by the public records to become informed of the bank’s mortgage constituted such culpable neglect as to cut him off from the relief he seeks, to which, upon the substantial merits of the case, he apparently is entitled. Accordingly we hold that, under the pleadings and the evidence upon which the trial judge based the judgment complained of, there was no-error in granting an interlocutory injunction, the effect of which is merely to preserve the status until the final hearing of the case before a jury.
Judgment affirmed.
All the Justices concurring, except Lumpkin, P. J, and Little, J., absent.