Tax liens are claims a governmental entity makes on property when taxes haven't been paid. Mortgages are also a form of lien, since the real estate is the collateral for the loan if you don’t pay the lender. Different governmental entities may file tax liens, ranging from a municipality for unpaid property taxes; the state for not paying sales, excise or state income taxes due; and the federal government for not paying what the IRS claims you owe. Tax liens against your property are always a matter of public record, and priority in many cases depends on who files a lien first. When several parties file liens against the same property, there may be exceptions to the general rule that the party who files first has priority. Which liens get paid first in foreclosure depends on lien priority as well; the order of payments in foreclosure is typically payments that attach to the property go first (property taxes, water and sewer bills and condo fees), and other liens, such as mortgages, are paid after in order of recording.
TL;DR (Too Long; Didn't Read)
In the event of a foreclosure, the specific order of payments will be determined by your state's laws. That being said, certain forms of liens generally are given priority over mortgages.
Property Taxes Have Lien Priority over Mortgages
Local property tax liens have priority over mortgages and any other tax liens. If you have a first mortgage on your home, the lender often includes the property taxes in your monthly payment plan and sends that amount to your municipality when due. So, if you’re not paying your property taxes directly, you’re probably not paying a mortgage, either. If foreclosure occurs, the amount owed to your municipality takes priority and must be paid ahead of everyone else. If you haven’t paid your municipal sewer and water bill, which usually operates under a different entity than your local taxing agency, the utility service can put a lien on your property and that lien may take precedence over a mortgage, although individual state laws apply in this situation.
Condo Associations May Have Super Priority Liens
If you live in a home governed by a community of homeowner's association, such as a condo, many states give these associations "super" priorities on tax liens over mortgages for a specific period, usually six months. However, your mortgage lender can avoid this problem by either paying out the relatively small amount generally owed to the community association or by foreclosing on the property quickly. Super priority legislation came about during the foreclosure crisis because the lack of payments from even one unit can have a severe financial impact on community associations, and banks were not foreclosing on such properties fast enough.
Federal Tax Liens have No Special Priority
If you fail to pay federal taxes due, the IRS may place a lien on your property by filing a Notice of Federal Tax Lien with your county clerk’s office. The IRS puts liens on all types of property, including real estate. A federal tax lien differs from an IRS levy, which is the actual seizure of the property and eventual sale to pay off your tax debt to the IRS. However, if you fail to pay your taxes and do not make good faith arrangements with the IRS to do so, a lien can turn into a levy. Avoid a federal tax lien if you cannot pay your taxes promptly and in full by working out payment options with the IRS. Once your tax lien is satisfied, the IRS will release it within 30 days of your payment. The IRS has 10 years from the date of filing the lien to collect the amount due. Once the IRS opens a lien on your property, you may find it virtually impossible to obtain credit.
Federal tax liens do not take precedence over purchase money mortgages or mortgage loans. The IRS considers a purchase money security interest or mortgage to be valid under local laws, so it is protected even though it may arise after a notice of Federal tax lien has been filed. Keep in mind that federal tax liens apply to all assets, so while such a lien does not take priority over your mortgaged home, the lien remains in place on bank and brokerage accounts and other assets. Like other liens, IRS tax liens are paid according to when they were recorded.