This post comes from Marilyn Lewis of MSN Money.

If you're in foreclosure or are underwater on your mortgage and hoping to sell your home, you can breathe again. Despite all it didn't get done in this week's fiscal cliff deal, Congress did keep alive an important program of tax relief for troubled homeowners in the late-hour legislation.

Struggling homeowners will continue to get tax relief on mortgage debt that's been forgiven.

Image: House for sale © Ocean, Corbis
How it works

The Mortgage Forgiveness Debt Relief Act of 2007 would have expired Monday had Congress not acted. Housing experts were worried the loss would worsen the country's economy.

MarketWatch explains how the act works:

"Without the break, forgiven debt can be treated as taxable income, and already struggling homeowners would face taxes from a short sale or loan modification. For example, an underwater homeowner in the 25% tax bracket could pay $12,500 in taxes for a short sale in which his house sold for $150,000, but he previously owed $200,000. With the tax break, the homeowner would not have to pay taxes on the $50,000 of forgiven debt."

Remember, though: The act applies only to a primary residence. "Debt that's forgiven on a second home or on a home equity line of credit that wasn't used to finance home improvements is supposed to be reported to the IRS as income," says The Wall Street Journal.

A $1.3 billion subsidy

That whistling sound you hear? It's the bullet dodged by a lot of Americans.

Here's who's sleeping better now:

  • The roughly 50,000 homeowners a month who lose homes to foreclosure.
  • Some 500,000 homeowners a year who get the OK from their bank for a short sale, meaning that the bank agrees to forgive the difference when a home is for less than is owed on the mortgage.
  • An estimated 1 million homeowners who may get some mortgage debt relief from the $25 billion settlement among five big lenders and 49 state attorneys general over "robo-signing" and other lender abuses.
  • Underwater homeowners whose lenders forgive some of their mortgage balance outside the government settlement.

Subsidizing debt forgiveness isn't cheap. Extending the act will cost $1.3 billion in 2013, says CNNMoney. Now it's set to expire Jan. 1, 2014.

Don't dismiss the act as a gift solely for debt-ridden homeowners. The chances are good that mortgage-forgiveness​ debt relief benefits us all in one way or another. CNNMoney reports:

"'Allowing the act to expire would harm these families and their communities and it would run counter to current loss mitigation efforts,' wrote Tim Pawlenty, president of the Financial Services Roundtable, Mike Calhoun, president of the Center for Responsible Lending, and John Dalton, president of the Housing Policy Counsel. in a letter to the Senate Finance Committee."

(Yes, that's Tim Pawlenty, the former Minnesota governor who briefly ran for the Republican presidential nomination last year.)

Extending the act "could help distressed home sales continue moving along," says the South Florida Business Journal

Also, if the tax incentive had disappeared, troubled homeowners would have reason to fight foreclosure longer, in turn prolonging the house recovery.

Could have dragged housing down

Defenders of the act worried that its death at this point could have set back recent housing market progress:

  • Sales of new homes are rising.
  • Real estate gained roughly $1.3 trillion in value in 2012, the first year-end gain since 2006, says Zillow.
  • Homebuilders are starting back to work again.

"If there ever was a no-brainer in housing policy, this would be it," Jaret Seiberg, a policy analyst for Guggenheim Securities, told CNNMoney before the congressional vote.

More from MSN Money: