Learn the lien order before foreclosing.
When a person owes federal back taxes, the Internal Revenue Service has the right to place a lien against any property the person owns. If no prior liens exist, the IRS can foreclose on the property to pay the debt owed. However, as a creditor, if you place a lien against a home that has a prior federal tax lien, your lien may fall off unless it is a mortgage or a state income or property tax lien.
Order
All liens fall into an order. Those that are filed prior to another have a superior order. Although any of the lienholders can foreclose, those that are filed first are paid first. An IRS lien, just like other liens, follows this same list of priority, except when there is a mortgage, property tax or state income tax lien, as these must be paid by the foreclosing lienholder.
Exceptions
Generally, state income tax liens, real estate tax liens, mechanics' liens and liens for home association dues take priority over all other liens, no matter who forecloses. These liens must be paid by whatever institution forecloses, whether it be the IRS, the mortgage lender or any other lender. However this exception to the "when they attached to the property" rule is set by each state, so you should check with your state to ensure that this regulation applies in your state.
IRS Foreclosure
If the mortgage lender places a lien against the property, this lien is always the superior lien to an IRS tax lien. This is written into every mortgage contract, and if the lender places a lien on the property even after an IRS lien is placed, the mortgage lien takes precedence. If the IRS forecloses on the property, it must first pay the mortgage lender the amount owed on the mortgage.
Mortgage Foreclosure
If a mortgage lender is the lienholder that forecloses and the property also carries an IRS lien, it is the mortgage lender's responsibility to notify the IRS of the property, its location and of the impending foreclosure 30 days prior to the foreclosure proceeding. If the IRS receives the proper notification, the mortgage lender can close as the superior lienholder. However, the mortgage lender must keep the property for 120 days. If during this time the IRS decides to keep the property, it must pay off the amount owed to the mortgage lender. The IRS retains this right as there are properties with a large amount of capital, enough to satisfy the tax liens.