Investors & landlords

You must recapture the depreciation taken or allowed even if the Sch E ran at a loss  since you have a gain on the sale.