Selling a long-lived asset

When an asset is sold, depreciation is brought up to date, the asset and its accumulated depreciation are removed, and the difference between the cash received and the book value is a gain or a loss.

From Financial Accounting.