The plaintiffs are entitled to a decree under the first prayer of the bill, the terms of which are to be settled in the trial court.
The defendant, as the second mortgagee, having been authorized by the power to bid at the foreclosure sale, and his bid, which was the highest, having been accepted, the deposit made and the memorandum or certificate of sale signed by the auctioneer, became the purchaser, and nothing remained by way of performance except to execute the deed to himself, and, upon deducting the expenses, to apply thepurchase price in liquidation of the mortgage debt, retaining the balance, if any, for the benefit of those who should receive it. Hall v. Bliss, 118 Mass. 554. But it appears from the answer “that he does not intend to do so” and the report states that at the hearing before the master he testified that he did not intend to take title and in so far as possible has disaffirmed the sale.
*58The power has been fully executéd. The mortgage has been regularly.foreclosed. The plaintiffs, however, rank as the third mortgagee. By the terms of the advertisement, and of sale, the property was sold subject to an outstanding first mortgage and unpaid taxes. And, the amount received having been more than sufficient to satisfy the second mortgage and costs of foreclosure, the surplus became payable to the plaintiffs, who, as the junior incumbrancers, succeeded to the rights of the mortgagor. Wiggin v. Heywood, 118 Mass. 514, 516. Mattel v. Conant, 156 Mass. 418. Bon v. Graves, 216 Mass. 440.
But notwithstanding these well settled principles, the defendant contends that, as he cannot sue himself for specific performance, the plaintiffs are remediless. It is true that execution of the deed was requisite for vesting the title, and he could not bring suit. A mortgagee nevertheless when acting under the power is a trustee, who in every particular must execute the trust with strict fidelity to the mortgagor or whoever may have his estate in the premises. As the defendant by force of the power lawfully became the purchaser, he was bound to complete the purchase as . fully and as effectually as if some other person had bought. The fact that he acted in the dual capacity of seller and purchaser conferred no additional rights, but imposed a stricter accountability when he bought for himself. The plaintiffs’ rights under the circumstances cannot be destroyed by the refusal of performance. A court of equity will treat that which ought to be done as having been done.- • The defendant, therefore, under all the authorities is to be treated as the purchaser at a valid sale, and, as between the plaintiffs and himself, it is of no consequence that- as yet no deed has been passed. Hood v. Adams, 124 Mass. 481, 483, 484. Muhlig v. Fiske, 131 Mass. 110, 114.
The present case is clearly distinguishable from Fall River Savings Bank v. Sullivan, 131 Mass. 537, where it was held that if a purchaser at the foreclosure sale is unable upon tender of the deed to comply with the terms of the sale because financially worthless, the mortgagee may again exercise the power.
Ordered accordingly.