
522 P.2d 576 (1974)
86 N.M. 241
LEONARD FARMS, a partnership, Plaintiff-Appellant,
v.
CARLSBAD RIVERSIDE TERRACE APARTMENTS, INC., et al., Defendants-Appellees.
No. 9852.
Supreme Court of New Mexico.
May 17, 1974.
*577 Crouch & Parr, Las Cruces, George T. Harris, Jr., Albuquerque, for plaintiff-appellant.
Robertson & Reynolds, Silver City, for defendants-appellees.

OPINION
McMANUS, Chief Justice.
On May 9, 1972, the District Court of Luna County issued its order directing the court clerk of the county to execute a release of a mortgage to Investor Properties, Inc., appellee, and in the same order denied appellant's (Leonard Farms) request for an accounting. From this order this appeal follows.
To set the stage, appellant sold to Carlsbad Riverside Terrace Apartments, Inc. (Carlsbad) certain farms for $590,000.00. The payment of the purchase price was to be represented by an assumption of a debt evidenced by a note and a mortgage of $342,320.00 owed by appellant to Kansas City Life Insurance Company, plus the execution of a note and second mortgage of $217,680.00 to appellant and, in addition, the payment of $30,000.00 cash to appellant. Carlsbad defaulted when it failed to pay an installment on the first mortgage note to Kansas City Life, and also failed to pay on the second mortgage note to appellant. Appellant paid the Kansas City Life installment and began a foreclosure suit. Judgment was rendered in favor of appellant and on November 12, 1972, the property was ordered sold to satisfy the judgment. The foreclosure sale was held on January 24, 1972 and the property was purchased by appellant for $175,000.00. On this same date, the court entered an order extending the statutory redemption to a later date and ordered that the right of statutory redemption be subject to the continuing jurisdiction of the court. Thereafter, a judgment creditor of Carlsbad assigned its judgment (and therefore its redemption rights) to Clovis National Bank, who in turn assigned the judgment to one Robert McAnally. McAnally then assigned the judgment to Investor Properties, Inc. (appellee).
On April 28, 1972, appellee offered $189,000.00 in order to redeem the property pursuant to § 24-2-19, N.M.S.A. 1953 (Supp. 1973), and on May 1, 1972, an order was entered by the district court in which the court found that appellee had made a proper tender in good faith, that a valid question existed as to the right of the foreclosure purchaser (appellant) to recover money paid by it on the prior first mortgage (to Kansas City Life) from appellee, and that appellee should be required to deposit security (a bond) with the court sufficient to indemnify the appellant for the installment on the prior first mortgage paid by appellant, together with any interest thereon, should it be later decided that appellee-redemptioner was liable for same. The court then found that, in satisfaction of the bond, the appellee could "* * * *578 file a mortgage to the clerk * * *" of the court on property in Grant County, New Mexico. The mortgage on the Grant County land was ordered instead of a mortgage on the redeemed property since "* * * [t]he parties have understood and agreed that redemptioner (appellee) is conveying title to the property being redeemed concurrent with its redemption and that such land is conveyed without further liens or rights as to the parties of this suit as against the ultimate purchasers thereof."
The mortgage on the Grant County property was filed on May 8, 1972. On May 9, 1972, the court released to the appellant the redemption money ($189,000.00) without prejudice so that the question of determining if the appellee owed any additional amounts could be reserved for later determination.
On August 8, 1972, appellee filed a motion which was heard by the district court on December 5, 1972. At this hearing it was determined that appellee should prepare an order asserting that if appellant wished to litigate the price of redemption question, it should file suit within 60 days, and if it did not so file the court would be disposed to release the mortgage on the Grant County property.
On April 12, 1973, appellee moved for and obtained an order to show cause why the mortgage should not be released. On May 18, 1973, an order was entered releasing the mortgage. On May 31, 1973, the court entered an order denying a motion for an accounting, finding it lacked jurisdiction to determine the matter. The sole issue on appeal therefore is whether or not the district court committed error in denying the motion for an accounting because of the lack of jurisdiction.
Section 24-2-19, N.M.S.A. 1953 (Supp. 1973), provides:
"After sale of any real estate pursuant to any such judgment or decree of any court, the real estate may be redeemed by the former defendant or owner thereof, his heirs, personal representatives or assigns or by any junior mortgagee or other junior lienholder by paying to the purchaser, his personal representatives or assigns, the amount paid, with interest from the date of purchase at the rate of ten per cent [10%] a year together with all taxes, interest and penalties thereon paid by the purchaser, with interest on such taxes, interest and penalties at the rate of ten per cent [10%] a year from the date of payment, or by making deposit of like amount or amounts in cash in the office of the clerk of the district court wherein the order, judgment or decree, under which said sale was made, was entered, at any time within nine [9] months from the date of sale."
Appellee followed this section to the letter in his $189,000.00 offer to redeem the property, which sum was broken down as follows:


  Amount realized from sale               $175,000.00
  Interest to 5-1-72
    $47.95 per day for 99 days               4,747.05
  Taxes paid by purchaser on 4-26-72         8,718.69
  Interest on taxes to 5-1-72                   12.25
  Farming costs                                423.33
  Balance for good grace                        98.68
                                          ___________
                               Total      $189,000.00

The district court approved of this breakdown and we must now decide if the court was correct in going further than the statute provides by having the appellee issue to the clerk of the court a mortgage on the Grant County property. Appellee contends that the court did not have the discretion to order this mortgage. We cannot agree with this contention.
In Keel v. Vinyard, 48 Idaho 49, 279 P. 420 (1929), it was held that where a junior mortgagee purchases at his own foreclosure sale subject to senior mortgages, and during the redemption period is compelled to protect his title by making payments on the prior mortgages, such payments cannot be included under the usual statutory provisions in the amount required to redeem the property. However, the junior mortgagee is entitled to an equitable lien for such payments. Also see Equity Mortgagee Corporation v. Loftus, 323 F. Supp. 144 (E.D.Va. 1970).
*579 In the case before us, the court therefore could have exercised its authority to make a determination of an additional amount, if any, to be paid over to appellant (in effect, an accounting) when appellant so requested such a determination. As a result, we must necessarily hold that the court had the jurisdiction to impress an equitable lien and to entertain appellant's amended complaint for an accounting.
The order denying Leonard Farms' motion for an accounting is reversed.
It is so ordered.
OMAN and MONTOYA, JJ., concur.
