If you thought a foreclosure ended the financial miseries associated with your former home, think again. You soon could be hearing from the IRS about taxes due in connection with the residence you no longer own.

"You can walk away from the big house payment, but not from the potential tax implications," says John W. Roth, senior tax analyst at CCH in Riverwoods, Ill. "And if you couldn't afford the mortgage, you probably can't afford the taxes."

As the lending crisis continues to shake out, more homeowners, particularly those who used creative mortgages to buy their houses, could be in this predicament. Even longtime homeowners who refinanced their properties based on increased value when the real-estate market was hot could find themselves in tax trouble if they lose their properties to the bank.

Forgiven but not forgotten

In many cases, the tax problem associated with a foreclosure arises from a seemingly benevolent move: The lender forgives some of the loan. This happens when a lender and a borrower negotiate a reduction in loan amount. Or when the lender forecloses on the property and sells it for less than the outstanding mortgage.

In both instances, the difference for which the borrower is no longer responsible is considered cancellation-of-debt, or COD, income. It also is called discharge-of-indebtedness income or discharge of debt. Regardless of the name, under the tax code, it's all taxable income. The tax on COD is calculated at ordinary rates, which range from 10% to 35% and depend upon your income.

"People who advise you to walk away talk about payment consequences, not the tax consequences," says Frederick M. Stein, RIA senior analyst from Thomson Tax & Accounting. "If they owe $50,000 and $10,000 is forgiven, they think of it as a gift. It may be a gift from the lender, but not from the IRS."

How much and what type of tax the IRS expects after a foreclosure depends in large part on whether the loan is "recourse" or "nonrecourse."

With a recourse loan, the debtor is personally liable for the debt. In a foreclosure, if proceeds from the home sale don't cover the outstanding mortgage, the debtor must pay the difference. This includes interest that accrues during the foreclosure process.

Nonrecourse debt is secured by the loan collateral. If money from the sale of the property doesn't cover the outstanding debt, the lender has no legal ability to get the additional funds from the debtor.

A sale is a sale is a sale

But with either type of loan, a foreclosed-upon homeowner could end up owing capital-gains taxes without ever receiving any money from the foreclosure sale.

"Foreclosure is not a sale in normal terms, but it is still treated under tax code as a sale," says Stephen Trenholm, CPA, MST (master's degree in taxation) and tax manager at Rucci Bardaro & Barrett in Boston.

"The outstanding balance of the mortgage is compared to the basis in house. If that produces a gain, it's a taxable gain. If it's a nonrecourse mortgage, it's a capital gain."

That's right: Even though you aren't selling the house and the bank is, the IRS views the transaction as if you were the seller. That means you could owe taxes on the sale. The bad news comes directly from the IRS, via Publication 544:

"If you do not make payments you owe on a loan secured by property, the lender may foreclose on the loan or repossess the property. The foreclosure or repossession is treated as a sale or exchange from which you may realize gain or loss. This is true even if you voluntarily return the property to the lender. ... You figure and report gain or loss from a foreclosure or repossession in the same way as gain or loss from a sale or exchange. The gain or loss is the difference between your adjusted basis in the transferred property and the amount realized."

The calculations take into consideration any cancellation-of-debt income and the type of mortgage. Here's an example:

Let's say a homeowner has nonrecourse mortgage debt of $110,000 and $20,000 equity, or "adjusted basis," in the home, which has a fair market value of $100,000. The owner has no ordinary tax liability for that $10,000 difference between his debt and the home's value. But what about the $90,000 difference between the mortgage debt and his basis in the house ($110,000 less $20,000)?

That is seen as taxable capital gain from the "sale or other disposition" of the home. So even though the foreclosed-upon owner didn't get any cash from the transaction, he still owes taxes on what is known as phantom income. The only good news is that the taxes are collected at the lower 15% (or 5% for lower-income taxpayers) capital-gains rate.

If that same homeowner's mortgage was recourse debt and his lender forgave the $10,000 difference between the outstanding loan and the home's fair market value, the foreclosed-upon owner would owe ordinary taxes on the 10 grand. In addition, his capital-gains bill would be based on $80,000 -- the property's fair market value of $100,000 less his $20,000 adjusted basis.

For some struggling homeowners, the taxes on forgiven debt or phantom income are all too real.

"If it's $10,000, that's a relatively small spread; $2,000 to $2,500 in federal and state taxes," says Ted Lanzaro, CPA and owner of an accounting firm in Shelton, Conn. "But it's not just the working man having this problem. Everybody's getting in over their head these days.

"If you have a $700,000 mortgage and the bank can only get $500,000 in a foreclosure sale, now you're talking about some tax liability."

And don't think the IRS won't find out. The agency has a mechanism to catch foreclosure sales. The lender is supposed to issue a 1099-C to alert the former homeowner and IRS of the canceled debt and, in certain cases, a 1099-A showing the information you need to figure your gain or loss.

"Some people are moving and the 1099 has trouble catching up," says Gary Garwitz, tax partner with BKD in Springfield, Mo. "If you're in that situation and had a mortgage you didn't pay off, make sure you get that 1099."

The IRS definitely will get its copy and expect the associated taxes. If the taxes aren't paid, penalties and interest will be added.

"The IRS is far more tenacious than most banks," says tax analyst Roth. "Their responsibility is to collect the tax on the income you have."

Home-sale exclusion still applies

There is one bit of good news for our hypothetical homeowner and others dealing with foreclosure-induced taxes. You can get out from under at least part of the IRS bill if you meet the homeownership tax-exclusion rules.

This popular tax break allows a single homeowner who sells his property under the usual circumstances to exclude up to $250,000 profit from taxes; the exclusion is $500,000 for married couples filing jointly.

The exclusion also applies in foreclosures. As long as the "seller," in this case the foreclosed-upon owner, lived in the home as his principal residence for two of the past five years, he can avoid taxes on any capital-gain profit, phantom or real.

Bankruptcy and insolvency solutions

Two other circumstances offer tax relief in foreclosures, but both could cause other financial problems.

If a homeowner can show he's insolvent before the discharge of the mortgage and turnover of the property, as well as afterward, proceeds are not taxed. However, says CPA Trenholm, "insolvency is a little tricky. There's no strict definition of what assets (go in the calculation), but for the most part, a lot of people caught in the real-estate crunch can establish that condition."

The other option is bankruptcy.

"Forgiveness debts, in these cases, are not taxed," says Roth. "They don't want the bank chasing them down, which is why many times people going through foreclosure also go through bankruptcy."

However, filing for bankruptcy has its own set of considerations. "New bankruptcy rules don't give (filers) a lot of relief," says William S. Bost, a member of the Raleigh, N.C., law firm Ragsdale Liggett. "If you have a job and are making money, the new bankruptcy rules don't give you a whole lot of help. It gives you some time, but I don't think that's necessarily the way to go.

"It used to be like going to church -- you walk in and walk out absolved -- but it's not like that anymore," says Bost. "Now, it's not worth the pain you pay the rest of your life."

One thing lending and tax experts all agree on: If you're facing foreclosure, take action as soon as you realize you're in trouble. And get professional help to determine exactly what your personal tax liability might be in the transaction.

Lanzaro has two other recommendations: "The best advice is, don't buy a house you can't afford, and don't get an adjustable-rate mortgage."

Other options

If you're stuck with more house than you can pay for, you have a couple of options in addition to foreclosure. Either is likely to reduce the stress of this terrible time and probably will do a little less damage to your credit report.

Each, however, still has tax and other potential long-term financial implications.

Short sale: This real-estate transaction has become popular among homeowners who are having problems making payments on a mortgage that is more than their house is worth. Rather than waiting for the bank to foreclose, the owner works with the lender to complete a sale of the home for less than the loan balance.

"You have a property you're just trying to get out from under," says Paul Haarman, vice president of Renaissance Mortgage in Salem, N.H. "Everybody is all lined up at the table and the buyer buys the property and the lender agrees to the price. You have a $250,000 debt, the bank nets only $220,000 and that $30,000 is written as a foreclosure shortage." 

A short sale keeps a foreclosure from showing up in your credit record, but the shortfall will appear there as a delinquent loan. It's not as bad as a foreclosure, but, says Bost, "It's on the credit report and, as a (future) borrower and consumer, it will haunt you."

Deed-in-lieu of foreclosure: In this case, says Trenholm, the homeowner basically says to the lender, "I want to save you some time, some money. How about I just turn over the property?"

This way the foreclosure process is avoided, which will help the borrower, because it won't show up on a credit record. However, it could still show up on a credit report as forgiven debt.

This process has "pretty much the same tax consequences as a foreclosure," says Trenholm. Because you are being relieved of the indebtedness on the property, for tax purposes it's still considered sale of the property.

"All it does is make it a little bit easier to go through the process," he says.

Tax liabilities remain

The argument for short sales and deeds-in-lieu is that they are beneficial to strapped borrowers. From a tax and financial perspective, however, they don't really matter.

"All of these situations are basically the same," says Stein. "The mechanics and timing may be a little different, but essentially in all of them at some point a lender is saying to the borrower you don't have to pay the rest of what you owe. When he tells the borrower that, that's cancellation-of-indebtedness income."

"The only benefit," says Bost, "is the 'It's over' factor."

By Kay Bell, Bankrate.com