Foreclosure on commercial properties almost always means getting hit with capital gains tax since the IRS considers it to be a sale to the lender for an amount equal to the balance on the loan. There is a way to avoid the tax, however. As a CPA (now retired) with a focus on commercial real estate for over 35 years, I have consulted with numerous investors about to lose their commercial properties. There may be a way to restructure the financing such as by bringing in an equity partner. Or, in the worst case, at least avoid the tax implications.