When a right to redeem real estate under mortgage, levy, sale on execution or for taxes or a right to a conveyance by contract is attached, the plaintiff in the action, before or after sale on execution, may pay or tender to the person entitled thereto the amount required to discharge such encumbrance or fulfill such contract. Thereby the title and interest of such person vest in the plaintiff subject to the defendant's right to redeem. Such redemption by the defendant or any person claiming under him by a title subsequent to the attachment shall not affect such attachment, but it shall continue in force and the prior encumbrance as against it shall be deemed discharged.
14 M.R.S. § 4456