When a lien is foreclosed, this wipes out all junior liens but does not affect liens, which are senior to the one being foreclosed. As the Court of Appeal said, “A valid foreclosure terminates all interests in the real estate junior to the mortgage being foreclosed (see, e.g., Sumitomo Bank v. Davis (1992) 4 Cal.App.4th 1306, 1314, 6 Cal.Rptr.2d 381), but it does not terminate interests senior to the mortgage. (See, e.g., R-Ranch Markets # 2, Inc. v. Old Stone Bank (1993) 16 Cal.App.4th 1323, 1327, 21 Cal.Rptr.2d 21.” Vallley Investments, L.P. v. BancAmerica Commercial Corp. (2001) 88 Cal. App. 4th 816, 824.

Thus, when a junior lien forecloses, the party who buys the property at the foreclosure sale acquires the property, with the senior liens still against it. When a senior lien forecloses, however, the buyer takes the property free and clear of all previously existing junior liens.