A mechanic’s lien survives foreclosure only when it is senior in priority to the lien being foreclosed. If the mechanic’s lien outranks the foreclosing mortgage, it stays attached to the property and the buyer at the sale takes title subject to it. If the mechanic’s lien is junior, the foreclosure sale wipes it out and the contractor loses the security interest, though not the underlying debt. So the real question behind “do mechanics liens survive foreclosure” is a priority question, and priority for mechanic’s liens does not always track the recording date the way other liens do.
How Priority Gets Decided
The baseline rule is “first in time, first in right.” Liens are ranked by when they were recorded, and the earliest recorded lien gets paid first from any sale proceeds.1Internal Revenue Service. Office of Chief Counsel Memorandum 200922049 A mortgage recorded in January outranks a judgment lien recorded in March.
Mechanic’s liens don’t always follow that timeline. Most states apply some version of the relation-back doctrine, which sets a mechanic’s lien’s priority date not when the paperwork is filed, but when physical work first began on the property. Some states trace this to the first shovel in the ground on the overall project; others use the date the specific contractor’s work began. The theory is that visible construction puts the world on notice that someone is improving the land, even before anything is recorded.
That doctrine can rearrange the lineup. A lender might record a mortgage on March 15, and a contractor might not file a lien until May. If work broke ground on February 1, the lien’s priority relates back to that earlier date and sits ahead of the mortgage. Not every state applies relation-back the same way, and some have moved away from it, so the result turns on local law.
When a Mechanic’s Lien Gets Wiped Out
A junior mechanic’s lien is extinguished by the foreclosure of a senior lien. The property transfers to the buyer free of all claims below the foreclosing lien in the priority chain. 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 started. 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 sale. The debt itself survives; the lien that secured it does not.
When a Mechanic’s Lien Survives
A senior mechanic’s lien is untouched by the foreclosure of a junior lien. The sale of a lower-priority claim has no effect on anything above it, 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 keeps the right to foreclose on the property to collect what’s owed. The new owner never hired the contractor and never agreed to the debt, but the lien follows the property. In practice, the owner pays the lien, negotiates a settlement, or faces a foreclosure action on the property they just bought. A thorough title search before bidding at a foreclosure auction is the only reliable defense.
The Omitted-Lienholder Exception
There is one scenario where even a junior mechanic’s lien survives: when the foreclosing party fails to bring the lienholder into the process. In a judicial foreclosure, the foreclosing lender must identify and serve all known lienholders. If a junior mechanic’s lienholder is left out of the action, the foreclosure has no effect on their rights, and the lien stays attached as though the sale never happened.
This mistake is more common than people assume, especially on projects with multiple subcontractors and suppliers who may have filed their own liens. It usually can’t be fixed after the fact, and the original lender can’t go back and foreclose again because the underlying debt was already satisfied by the sale. The buyer ends up with a property carrying a lien that should have been cleared.
Non-judicial foreclosures handle notice differently. Without a court filing that requires naming all parties, the foreclosing party typically has to send written notice to known junior lienholders within a specific window before the sale. Inadequate notice can leave junior liens intact in that process too.2Internal Revenue Service. IRM 5.12.4 Judicial/Non-Judicial Foreclosures
The Construction Loan Exception
Relation-back sounds like a windfall for contractors, but many states carve out a major exception for construction loans. When a lender finances the construction itself, the mortgage securing that loan frequently gets priority over mechanic’s liens even if work began before the mortgage was recorded. The reasoning is that the loan funded the very work the contractor performed, so it would be inequitable for the liens to leapfrog the lender.
Details vary. Some states grant automatic priority where a certain percentage of the loan proceeds go toward construction costs. Others condition priority on specific recording and notice steps by the lender. Contractors on construction-loan projects should not assume their lien will outrank the mortgage, regardless of when work began.
If Your Lien Gets Wiped Out, What’s Left
Losing the lien does not erase the debt. The lien was security for an obligation, and the obligation to pay for completed work survives on its own. 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 suit against the property owner. A judgment opens up standard collection tools: wage garnishment, bank 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 reach. If the owner lost the property because of financial distress, practical recovery may be minimal.
There is also sometimes money from the foreclosure sale itself. If the property sells for more than the senior lien plus foreclosure costs, the excess is surplus funds, and junior lienholders can claim it in order of their priority. The claim process varies by state and the timeline for filing is often short, so a contractor who holds a wiped-out lien should monitor the proceeding and move quickly if a surplus appears. Surplus is rare in practice, because foreclosure usually happens on properties that are underwater, but it does exist on properties that have appreciated or where the foreclosing debt is small relative to value.
On commercial and public projects, a payment bond may offer another source of recovery that doesn’t depend on the property or the owner’s solvency. Bond claims run on their own deadlines, which are often shorter than lien deadlines, so this needs to be evaluated early.
If the Owner Files Bankruptcy
An owner’s bankruptcy filing freezes the picture. The automatic stay under federal law halts almost all collection activity against the debtor the moment the petition is filed, including filing or enforcing a mechanic’s lien, foreclosing on the property, or suing the owner.3Office of the Law Revision Counsel. 11 USC 362 – Automatic Stay The stay lasts until the case is closed or dismissed, or until the court lifts it on request.
State-law filing deadlines keep running during bankruptcy, and missing them means losing lien rights permanently. Federal law provides a narrow exception that lets a contractor perfect a lien during bankruptcy by giving proper notice within the deadline state law requires, but the process has to be handled carefully.4Office of the Law Revision Counsel. 11 USC 546 – Limitations on Avoiding Powers A lien that was properly perfected before the filing is generally treated as a secured claim in the bankruptcy. An unperfected lien is treated as unsecured, which in most cases means receiving little or nothing.