While it is not lawful for banking associations, established under the U. S. St. of 1864, c. 106, to purchase, hold and convey real estate except in certain specified cases, among these exceptions are included such real estate “ as shall be mortgaged to it in good faith by way of security for debts previously contracted; such as shall be conveyed to it in satisfaction of *156debts previously contracted in the course of its dealings; such as it shall purchase at sales under judgments, decrees or mortgages held by such association, or shall purchase to secure debts due to said association.” Under the latter clause it cannot be deemed that the only authority given to such associations is to purchase only to the exact amount of the debts which may be owing to them, but they are entitled to purchase such real estate as may be necessary in order to secure the debts due to them so long as the security of such debts is the real object of the purchase.
Upon advancing $3000 for the purchase of the mortgage ' which had been assigned to the South Reading Agricultural & Mechanic Association, Emerson himself paid $1500 of the debt of $4500 which the mortgage was originally given to secure, and consented that the bank should hold the mortgage to secure the sum of $3000 thus advanced, and also three notes amounting to about $911 then due from him to the bank. The claim that this was a loan of money upon real estate security or a purchase of real estate, is not maintained when it is found as a fact that the inducement to this transaction was the agreement that the mortgage and the real estate upon which it was secured should be held for the antecedent debt due to the bank.
The objection that such an oral agreement could not be put in evidence cannot be maintained. While an indebtedness, other than that for which the mortgage was given, cannot legally be attached to such mortgage, yet it is competent, in answer to a bill in equity to redeem a mortgage, for the defendant to show that it would be inequitable to allow the plaintiff to do so upon payment of the amount apparently due thereon, inasmuch as the defendant had for valuable consideration orally agreed that it should not thus be discharged, but should remain as security for other debts. Joslyn v. Wyman, 5 Allen, 62. Stone v. Lane, 10 Allen, 74. Had any question of title arisen between the defendant and a subsequent mortgagee, attaching creditor or bond fide purchaser, ov even if an action at law had been brought by the defendant to foreclose the mortgage, it must have been decided that the defendant could enforce the mortgage only for that portion of the $3000 now actually due. But, if the present bill had been brought by Emerson, he could not have been allowed *157to obtain a release or discharge of the mortgage from the defendant, to whom it has been assigned, except upon the performance of his oral agreement with the defendant in relation to his antecedent debt. Joslyn v. Wyman, ubi supra. Stone v. Lane, ubi supra.
By the assignment in bankruptcy, the assignee has succeeded to all the rights of Emerson, but his rights here are not superior to those of Emerson. He has come into a court of equity to seek its aid in obtaining those rights, and is, therefore, to do what Emerson would have been compelled to do. In order to obtain a decree for the redemption of the mortgage, he must perform the oral agreement that the debt of $911 due the bank should be paid, as well as pay the balance of the $3000 which is now due. Decree accordingly.