When a foreclosed home is sold, lien priority in foreclosure controls the payout: administrative costs come off the top, then each lienholder is paid in full in order of priority, and whatever is left flows down to junior creditors and finally to the former owner. The senior lienholder usually recovers everything it is owed. Junior lienholders often recover a fraction, or nothing at all. If the sale generates surplus, the former homeowner is entitled to it.
The order is rigid. No one negotiates a place in line, and the amount available for each creditor depends entirely on what the sale brings in and who ranks above them.
How Recording Order Sets the Line
The baseline rule is straightforward: the lien recorded first at the county recorder’s office has the strongest position. When a lender funds a mortgage, it records a deed of trust or mortgage in the public land records, and that filing puts every later lender on notice that the property is already pledged. A second mortgage recorded later ranks behind the first, a third behind the second, and so on.
State recording laws vary in their fine points. Most states follow a race-notice system, under which a later lender takes priority only if it recorded first and had no knowledge of the earlier claim. A few use pure notice or pure race rules. Those distinctions rarely change the outcome in standard mortgage lending because institutional lenders run title searches and record promptly. They can matter when informal arrangements or delayed filings are involved.
Recording order also gets adjusted in one common situation. When a homeowner refinances a first mortgage and a home equity line or other junior lien is already recorded behind it, the new refinance loan would technically rank behind that junior lien. Courts in most states apply equitable subrogation to preserve the refinance lender’s senior position, stepping it into the priority slot of the mortgage it paid off. The junior creditor stays where it always was, and the refinance lender does not lose priority to a lien it never actually ranked behind.
Liens That Cut the Line
Certain claims override recording order and jump to the front regardless of when they were created. These super-priority liens exist because legislatures decided specific public obligations deserve preferential treatment over private lending.
Property Tax Liens
Unpaid property taxes almost universally take first priority over every other claim on the property, including the original mortgage. The taxing authority’s lien attaches automatically when taxes go delinquent, and it must be satisfied before any private creditor sees a dollar from a foreclosure sale. Delinquent tax balances also accumulate penalties and interest that vary by jurisdiction. The rationale is straightforward: local governments depend on property tax revenue to fund schools, roads, and emergency services, so their claims come first.
HOA Assessment Liens
More than 20 states give homeowners associations a limited super-lien for unpaid assessments. The super-priority portion typically covers six months of delinquent regular dues, though some states extend it to nine months or include related collection costs. Only that capped amount jumps ahead of the first mortgage. Any remaining unpaid assessments beyond the super-lien fall back into normal priority order based on recording date.
Mechanic’s Liens
Contractors and suppliers who improve property can file a mechanic’s lien if they go unpaid. In many states, the priority of that lien relates back to the date work first began on the property rather than the date the lien was filed. A contractor who started a renovation before a lender recorded a new mortgage may therefore have a lien that outranks that mortgage even though the lien paperwork came later. Lenders protect themselves by inspecting before funding construction loans, but the relation-back rule is a real risk for anyone lending against property under active improvement.
Federal Tax Liens
An IRS tax lien works differently from the super-priority liens above. A federal tax lien attaches to all of a taxpayer’s property the moment the IRS assesses the tax and the taxpayer fails to pay after demand. That lien is not valid against purchasers, holders of security interests, mechanic’s lienors, or judgment lien creditors until the IRS files a Notice of Federal Tax Lien in the public records.1Office of the Law Revision Counsel. 26 USC 6323 – Validity and Priority Against Certain Persons A mortgage recorded before the IRS files its notice will outrank the federal tax lien. If the IRS files first, its lien takes priority over later-recorded private debts.
Federal law also gives real property tax liens and special assessment liens priority over the federal tax lien if those tax liens would take priority over a pre-existing security interest under local law.1Office of the Law Revision Counsel. 26 USC 6323 – Validity and Priority Against Certain Persons The practical result is that the IRS lien falls behind both the local tax authority and a first mortgage when both were established before the IRS filed its notice.
Foreclosing on a property with a federal tax lien requires strict attention to notice rules. For a nonjudicial foreclosure to discharge the federal tax lien, the foreclosing party must send written notice to the IRS by certified mail at least 25 days before the sale date.2eCFR. 26 CFR 400.4-1 – Notice Required With Respect to a Nonjudicial Sale The notice must include copies of all filed Notices of Federal Tax Lien, a detailed property description, the sale date and terms, and the approximate amount of the senior obligation being enforced. Miss this step, and the federal tax lien survives the sale.
Even when notice is proper and the sale goes through, the IRS retains a right to redeem the property for 120 days after the sale, or a longer period if local law provides one for other secured creditors.3Office of the Law Revision Counsel. 26 USC 7425 – Discharge of Liens The redemption period begins on the date of sale and ends on the 120th day or at the expiration of a longer local redemption period, whichever comes later.4eCFR. 26 CFR 301.7425-4 – Discharge of Liens; Redemption by United States A bidder could win a property at auction and lose it to the IRS four months later.
How the Sale Proceeds Are Distributed
Administrative costs come off the top. These include the foreclosing attorney’s fees, advertising costs for the required public notices, and the trustee or sheriff’s commission for conducting the sale. Attorney fees for the foreclosing party commonly run $1,500 to $4,000, and trustee commissions are often calculated as a small percentage of the sale price. These costs vary by jurisdiction and case complexity, but they always get paid first.
After costs, the senior lienholder that initiated the foreclosure receives its full outstanding balance: principal, accrued interest, late fees, and any contractual advances it made to protect the property, such as paying delinquent taxes or hazard insurance. Only after the senior lender is made whole does money flow to the next creditor in line. Each junior lienholder must be paid in full before the next one gets anything.
The math gets grim quickly. If a second mortgage balance is $50,000 but only $30,000 remains after the senior lien is satisfied, the second lienholder receives $30,000 and absorbs the $20,000 shortfall. Nothing passes to a third lienholder or to the homeowner until every creditor ahead is paid completely.
When the sale price does exceed all liens and administrative costs, the surplus goes to the former homeowner. That money represents equity that was not consumed by debt, and returning it is required rather than optional.
What Happens to Junior Liens After the Sale
When a senior lienholder forecloses and the sale closes, junior liens on the property are extinguished. The new buyer takes the property free of those subordinate claims. Clearing title is one of the fundamental features of foreclosure: the property can be sold to a new owner without the baggage of the prior owner’s secondary debts.
There is an important qualification. A junior lienholder whose lien is extinguished only loses its security interest in the property. The underlying debt, memorialized in the borrower’s promissory note, survives. The creditor moves from being a secured lender with property as collateral to an unsecured creditor with a contractual claim against the borrower personally.
Extinguishment also depends on proper notice. A junior lienholder who is not made a party to the foreclosure action retains its rights against the property. Courts consistently hold that a foreclosure decree only cuts off the interests of parties who were properly joined or notified. If the foreclosing senior lender fails to name a junior lienholder as a defendant in a judicial foreclosure, or fails to provide required notice in a nonjudicial foreclosure, that junior lien survives the sale and remains attached to the property in the hands of the new buyer. The practical remedy for a buyer who discovers a surviving junior lien is usually to negotiate a payoff, file a quiet title action, or in some cases re-foreclose with proper notice to the omitted party.
Deficiency Judgments Against the Borrower
When a junior lienholder collects nothing from the sale, or a senior lienholder recovers less than the full debt, the unpaid balance is a deficiency. In many states, the lender can go to court and obtain a deficiency judgment against the borrower, then use standard collection tools such as wage garnishment, bank account levies, or liens on the borrower’s other property.
Not every state allows this. Roughly a dozen states have anti-deficiency statutes that restrict or prohibit deficiency judgments in certain circumstances. The restrictions vary: some bar deficiency judgments only after nonjudicial foreclosures, others only for purchase-money mortgages on owner-occupied residences, and a few prohibit them more broadly. Arizona, California, and Oregon are among the states with the most borrower-protective rules. Where deficiency judgments are permitted, lenders typically face a statute of limitations and may need to prove the property’s fair market value to prevent a windfall from a below-market foreclosure sale.
For junior lienholders wiped out by a senior foreclosure, the right to pursue a deficiency judgment can be the only path to recovering anything. Some states extend anti-deficiency protections to sold-out juniors, preventing even a wiped-out second mortgage holder from pursuing the borrower personally after a nonjudicial foreclosure. Whether a borrower faces this liability depends entirely on state law.
Claiming Surplus Funds
Surplus funds do not automatically reach the people entitled to them. Junior lienholders and former homeowners must file a claim with the court or the foreclosure trustee. The typical process involves filing a motion or application for distribution of excess funds, serving the paperwork on all parties involved in the foreclosure, and providing proof of the claim, whether a recorded lien or former ownership of the property.
Deadlines vary dramatically. Some states give as little as 60 to 90 days. Others allow up to five years. Missing the deadline usually means the funds get transferred to the state’s unclaimed property division, where they can still be recovered but with added time and bureaucracy. Anyone who held a junior lien or owned a property that went through foreclosure should check for surplus funds promptly.
Redemption Rights After the Sale
In roughly half of U.S. states, the borrower has a statutory right to reclaim the property after the foreclosure sale by paying the full sale price plus costs within a set timeframe. Redemption periods range from a few months to a year depending on the state. During the redemption period, the foreclosure buyer owns the property but faces the possibility that the former owner exercises this right. Some states also extend the right of redemption to junior lienholders, allowing them to redeem to protect their interest.
Statutory redemption is separate from the equitable right of redemption, which is simply the borrower’s right to pay off the full debt and stop the foreclosure before the sale happens. Every state recognizes the equitable right up until the sale. The statutory right, available only where states provide it, applies after the sale is already complete. It tends to depress auction prices because bidders know they may have to give the property back, and it gives financially distressed homeowners one final window to save their home.