When proceedings for the foreclosure of any prior mortgage of real estate have been instituted by any method provided by law, the owner of any subsequent mortgage of the same real estate or of any part of the same real estate may, at any time before the right of redemption from such prior mortgage has expired, in writing, request the owner of such prior mortgage to assign the same and the debt thereby secured to him, upon his paying to the owner of such prior mortgage, the full amount, including all interest, costs of foreclosure and such other sums as the mortgagor or person redeeming would be required to pay in order to redeem. If the owner of such prior mortgage neglects or refuses to make such assignment within a reasonable time after such written request, the owner of such subsequent mortgage may bring a civil action in the Superior Court for the purpose of compelling the owner of such prior mortgage to assign the same and the debt thereby secured, to him, the owner of such subsequent mortgage, upon making payment. If the court, upon hearing, shall be of the opinion that the owner of such prior mortgage will not be injured or damaged in his property matters and rights by such assignment, and that such assignment will better protect the rights and interests of the owner of such subsequent mortgage, and that the rights and interests of any other person in and to the same real estate, or any part thereof, will not be prejudiced or endangered thereby, the court, in its discretion, may order and decree that such prior mortgage and the debt thereby secured shall be assigned by the owner thereof to the owner of such subsequent mortgage upon his making payment. The time within which and the place where such payment shall be made shall be fixed by the court, and if the parties are unable to agree upon the amount of such payment, the court shall fix and determine the amount. The court may issue all necessary and needful process or processes to enforce any order or decree made under this section. The owner of any prior mortgage assigned under the provisions hereof shall not be holden on nor liable for the debt secured by such mortgage unless he especially agrees in writing by him signed to be so holden or liable. An appeal from any final decree may be taken as in other civil actions.
14 M.R.S. § 6205