The far-reaching federal housing package signed into law Wednesday could help tens of thousands hold onto or buy homes across California, critical aid for the state hit hardest by foreclosures.

Three components of the Housing and Economic Recovery Act of 2008 are likely to have the most direct consumer impact: a Federal Housing Administration program authorized to insure up to $300 billion in refinanced mortgages, new caps on loans that government-sponsored enterprises Fannie Mae and Freddie Mac can buy or back, and $15 billion in housing tax breaks.

The latter two will increase demand for foreclosed homes lingering on the market as the refinancing plan prevents additional ones from reaching that point, said Beth Peerce, treasurer of the California Association of Realtors, a Los Angeles trade group.

Here's how the three components of the law will work and what impact they could have:

-- Certain struggling homeowners will be able to secure cheaper, fixed-rate loans from the FHA pool beginning in October. The agency will guarantee the mortgages if the lender agrees to take significant losses on the original loan and the borrower gives up a portion of the home's future appreciation to the government.

Lenders will often go along with the deal if the only alternative is foreclosure, because they stand to lose the difference between the original loan amount and current value anyway, Adibi said. The limiting factor could be that not every distressed borrower will qualify for a 30-year fixed loan for the necessary value, even with the declines of the last few years.

-- As of Jan. 1, the law will raise the cap on loans that Fannie and Freddie can buy in high cost areas to $625,000, up from $417,000 early this year. That means people trying to buy or refinance a home will often secure a better interest rate on loans up to the conforming amount.

The California real estate industry has long pushed for such a change because home prices here often exceed the limit. It's especially important for first-time buyers, who don't have equity to apply toward the purchase.

"This is a huge step forward for all Californians," said Fred Arnold, president of the California Association of Mortgage Brokers.

Still, he and others had hoped the cap would be set higher still. The new limit would be below the median home price in three of the Bay Area's nine counties - San Francisco, San Mateo and Marin - according to DataQuick Information Systems.

Congress this year temporarily raised limits for conforming loans to $729,750 in high-cost regions. Lenders, however, have typically charged higher interest on such mortgages and the underwriting guidelines made them more difficult to qualify for, Arnold said.

 James Temple sfchronicle.com.