Where any action shall be brought on any bond for payment of the money secured by mortgage, or performance of the covenants therein contained, or where any action of ejectment shall be brought in any court of record by any mortgagee or mortgagees, his, her, or their heirs, executors, administrators, or assigns, for the recovery of the possession of any mortgaged lands, tenements, or hereditaments, and no suit shall be then depending in any court of equity, for or touching the foreclosure or redeeming of such mortgaged lands, tenements, or hereditaments; if the person or persons having right to redeem such mortgaged lands, tenements, or hereditaments, and who shall appear and become defendant or defendants in such action, shall at any time, pending such action, pay unto such mortgagee or mortgagees, or, in case of his, her, or their refusal, shall bring into court where such action shall be depending, all the principal monies and interest due on such mortgage, and also all such costs as have been expended in any suit or suits at law or in equity upon such mortgage (such money for principal, interest, and costs to be ascertained and computed by the court where such action is or shall be depending, or by the proper officer by such court to be appointed for that purpose) the monies so paid to such mortgagee or mortgagees, or brought into such court, shall be deemed and taken to be in full satisfaction and discharge of such mortgage, and the court shall and may discharge every such mortgagor, or defendant, of and from the same accordingly; and shall and may, by rule or rules of the same court, compel such mortgagee or mortgagees, at the costs and charges of such mortgagor or mortgagors, to assign, surrender, or reconvey such mortgaged lands, tenements, and hereditaments, and such estate and interest, as such mortgagee or mortgagees have or hath therein, and deliver up all deeds, evidences, and writings, in his, her, or their custody, relating to the title of such mortgaged lands, tenements, and hereditaments, unto such mortgagor or mortgagors, who shall have paid or brought such monies into the court, his, her, or their heirs, executors, or administrators, or to such other person or persons, as he, she, or they, shall for that purpose nominate or appoint.
D.C. Code § 42-805