Short answer. Costs of the sale are deducted first, then the proceeds go to the party foreclosing to cover the mortgage debt; any remaining balance goes to junior encumbrancers in order of priority as the court determines, and only after that does anything left over go to the mortgagor.

What the law says

The amount realized from the foreclosure sale of the mortgaged property shall, after deducting the costs of the sale, be paid to the person foreclosing the mortgage, and when there shall be any balance or residue, after paying off the mortgage debt due, the same shall be paid to junior encumbrancers in the order of their priority, to be ascertained by the court, or if there be no such encumbrancers or there be a balance or residue after payment to them, then to the mortgagor or his duly authorized agent, or to the person entitled to it.

Rule 68, Section 4 — Disposition of proceeds of sale. Read the full provision →

First in line: costs, then the foreclosing party

The distribution of proceeds from a judicial foreclosure sale follows a defined order. After the costs of the sale are deducted off the top, the remaining amount goes first to the person foreclosing the mortgage, to satisfy the mortgage debt that is actually due. Costs coming off first, ahead of even the mortgage debt itself, reflects that the sale would not have happened at all without the expense of conducting it, so those expenses are recovered before anyone's substantive claim to the proceeds is addressed.

Junior encumbrancers come next, by priority

If a balance or residue remains after the mortgage debt is paid off, that residue does not simply go back to the mortgagor right away. It is instead paid to junior encumbrancers, in the order of their priority, with the court ascertaining what that order actually is among any competing junior claims. A junior encumbrancer is someone holding a mortgage or other lien on the same property that ranks behind the foreclosing mortgage, and this step lets those subordinate claims be satisfied out of the sale proceeds before the mortgagor sees anything.

The mortgagor gets what is left, if anything

Only if there are no junior encumbrancers, or if a balance remains even after they are paid, does the residue finally go to the mortgagor, their duly authorized agent, or whoever else is entitled to it — making the mortgagor's recovery the last step in the distribution chain, not the first. This ordering follows naturally from the mortgagor's position as the party whose default triggered the sale in the first place; the mortgagor is only entitled to what is left once every claim ranking ahead of them, from sale costs down through junior liens, has already been satisfied in full.

Related provisions

Note. Statute text quoted on this page is reproduced from the official enactment and is linked to the full provision. The explanation around it is general legal information from Vivas & Nobles Law Office, not legal advice. Whether it applies to your situation depends on facts only a lawyer reviewing them can assess.