Whether a mechanic’s lien survives foreclosure comes down to one question: was the lien senior or junior to the lien being foreclosed? A senior mechanic’s lien stays attached to the property and the foreclosure buyer inherits it. A junior mechanic’s lien is wiped out by the sale, with one notable exception for lienholders the foreclosing party failed to notice.
How Priority Is Decided
Liens are ranked by the order they were recorded in the public land records under the rule of “first in time, first in right.” The earliest recorded lien gets paid first from sale proceeds, and any foreclosure by a senior lienholder extinguishes everything below it in the chain.1Internal Revenue Service. Office of Chief Counsel Memorandum 200922049
Mechanic’s liens complicate that timeline. Most states apply some version of the relation-back doctrine, which sets a mechanic’s lien’s priority date not when the contractor files the paperwork, but when physical work first began on the property. The logic is that visible construction puts the world on notice that someone is improving the land, even before any lien is recorded. Some states trace priority back to the very first shovel in the ground on the project; others use the date the specific contractor’s work began.
The doctrine can rearrange the priority lineup dramatically. A lender might record a mortgage on March 15, and a contractor might not file a lien until May. If the contractor broke ground on February 1, the lien’s priority relates back to that date, making it senior to the mortgage despite being filed months later. Not every state applies the doctrine the same way, and some have moved away from it entirely, so local law controls the outcome.
When the Lien Gets Wiped Out
A mechanic’s lien that is junior to the foreclosing lien is eliminated by the sale. The property transfers to the buyer free of the junior claim, and this is the standard rule in both judicial and non-judicial foreclosure.2Internal Revenue Service. IRM 5.12.4 Judicial/Non-Judicial Foreclosures
A mechanic’s lien ends up junior when the mortgage was recorded before the lien’s priority date. In relation-back states, that means the mortgage was recorded before work commenced. In other states, the mortgage simply needs to predate the lien filing. Either way, the contractor’s security interest in the property disappears at the foreclosure sale. The underlying debt doesn’t vanish, but the lien backing it up does.
When the Lien Survives
A mechanic’s lien with senior priority is untouched by the foreclosure of a junior lien. The foreclosure sale of a lower-priority claim has no effect on higher-priority liens, and the buyer takes the property still encumbered by every senior lien.2Internal Revenue Service. IRM 5.12.4 Judicial/Non-Judicial Foreclosures
For the new owner, this is often an expensive surprise. A surviving senior mechanic’s lien means the contractor retains the right to foreclose on the property to collect what’s owed. The new owner didn’t hire the contractor and didn’t agree to the debt, but the lien follows the property regardless of who holds title. In practice, the new owner either pays off the lien, negotiates a settlement, or faces a foreclosure action on the property they just bought. Title searches before bidding at a foreclosure auction matter for exactly this reason.
When a Junior Lien Survives Anyway: The Omitted Party Exception
There is one scenario in which even a junior mechanic’s lien survives foreclosure: the foreclosing party fails to name the lienholder in the action. In a judicial foreclosure, the foreclosing lender must identify and serve all known lienholders. If a junior mechanic’s lienholder is left out, the foreclosure has no effect on their rights, and the lien remains attached to the property as though the foreclosure never happened.
The mistake is more common than expected on projects with multiple subcontractors and suppliers who may have filed liens. It usually can’t be fixed after the fact through a quiet title action, and the senior lienholder can’t foreclose again because the original debt was already satisfied by the sale. The buyer can end up owning property with a lien that should have been cleared but wasn’t.
Non-judicial foreclosures handle notice differently. Without a court filing that requires naming all parties, the foreclosing party typically must provide written notice to known junior lienholders within a specific timeframe before the sale. Failing to provide adequate notice can leave junior liens intact even in a non-judicial process.2Internal Revenue Service. IRM 5.12.4 Judicial/Non-Judicial Foreclosures
The Construction Loan Carve-Out
Contractors relying on the relation-back doctrine should be careful when the mortgage in question is a construction loan. Many states have carved out an exception giving construction loans priority over mechanic’s liens even when work started before the mortgage was recorded. The rationale is that the construction loan enabled the work the contractor performed, so it would be inequitable for mechanic’s liens to leapfrog the lender who funded the project.
The specifics vary. Some states grant automatic priority to construction loans where a certain percentage of the proceeds go toward construction costs. Others require the lender to follow specific recording and notice procedures. On projects financed by construction loans, the assumption that early work equals senior lien priority can fail.
What a Contractor Can Still Do When the Lien Is Wiped Out
Losing the lien is not the same as losing the debt. Two paths remain.
Claiming Surplus Funds
If the property sells for more than what’s owed on the senior lien plus foreclosure costs, the excess is called surplus funds. Junior lienholders have a right to claim those funds in the order of their priority. The process varies by state but generally involves filing a motion or claim with the court or official overseeing the foreclosure. The timeline is often short, and surplus funds that go unclaimed are eventually returned to the former property owner.
In practice, surplus is rare. Foreclosures typically happen because the owner is deeply underwater, and the sale price often doesn’t cover even the senior lien in full. But when a property has appreciated significantly since the mortgage was originated, or when the foreclosing lien is small compared to the property value, meaningful surplus can exist.
Suing on the Underlying Debt
The lien was security for an obligation, and the obligation to pay for completed work survives independently. The contractor can no longer foreclose on the property, but the owner who hired them still owes the money. The usual path is a breach of contract lawsuit. A winning judgment turns the contractor into a judgment creditor with access to wage garnishment, bank account levies, and liens on the owner’s other assets. This route is slower and less certain than foreclosing on a secured lien, and it depends on the owner actually having assets to collect against. In cases where the owner lost the property to foreclosure because of financial distress, the practical recovery may be minimal.