When the claim interposed is based on a mortgage or lien, the claimant must state in his affidavit the nature of the right which he claims; and, in case such claim is sustained on the trial, the amount of it, whether then due or not, with interest to the date of the trial, must be ascertained by the jury or judge, as the case may be. The plaintiff may, within 10 days from date of said ascertainment, pay to the mortgagee or his assignee or to the lien holder the amount ascertained to be due; and in such case the property shall be sold as well for the payment of the debt secured by the mortgage or the lien, as ascertained, as for the satisfaction of the plaintiff's judgment, the proceeds of the sale to be applied first, after payment of the costs, to reimburse the plaintiff the amount so paid by him to such mortgagee or lien holder, and the claim or affidavit may be amended as provided by Section 6-6-143.
Ala. Code § 6-6-164 (1975)