Deductions & credits

Normally, a foreclosure is treated as a sale.  You "sold" the property to the bank, and the price is the amount the bank realized at auction (which might have left you with a deficiency of course.)

 

It sounds like this was business property, since I don't think that question will come up for the sale or foreclosure of a personal home.  If this was business property, you may owe recapture tax on depreciation you previously took, even if the property was foreclosed at a loss.  You may want professional tax advice.