Who gets paid first in an foreclosure auction?

If a mortgage pre-exists 1 being foreclosed, would the earlier mortgage get paid 1st at auction? ?1st one may be paid off but not recorded OR current lender may not be aware they hold a 2nd. How do I protect myself?

Sometimes a “junior loan” will foreclose before a senior loan. If that’s the case, you need to proceed with eyes wide open. Laws & nomenclature vary by state – but when you buy at trustee sale (foreclosure) you must take financial responsibility for (i.e. “pay off” or if allowed by lender “bring current” & continue payments on) any obligations that are “senior to” (i.e. recorded before ) the loan you buy at auction. Simply stated–?“first in time, is first in line.” So look carefully at the document recording dates on all obligations. If the recording date and/or doc number are “earlier” in time/number than the loan you purchased at auction … then said debt(s) are “senior to” the loan you acquired, and that debt becomes your responsibility. If you fail to pay off that debt(s), you will not be able to gain clear title and would likely have difficulty reselling the property. If there is a senior loan (i.e. recorded “ahead/earlier”) that remains unpaid after you purchase a loan at auction, then you (as new owner) could find yourself subject to an immediate/full payoff demand by that lender. If you failed to, or were not able to, pay off that senior debt, then you?face the prospect of a subsequent trustee sale.?Now the good news – if there is any “junior debt” (i.e. recorded after the loan you acquire at auction) in virtually all instances that debt is “wiped out” to you, as a trustee sale buyer. The exceptions are property taxes (which must be brought current), and IRS liens (IRS has seldom used but important to consider “right of redemption”).