Bank of America Corp agreed to pay $2.8 billion to mortgage finance giants Fannie Mae and Freddie Mac to settle claims over soured mortgages, signaling the bank may be closer to containing its out-sized housing losses.

The settlement was far less costly to Bank of America than many analysts had feared. Investors have been pressing banks to buy back bad mortgages, in a battle over who will bear the brunt of losses from the mortgage crisis.

But if Bank of America is paying Fannie Mae and Freddie Mac less than many had expected, that means the taxpayer-supported mortgage finance companies are receiving less money than expected, which could further hurt their weak balance sheets.

This is a gift to Bank of America, said Christopher Whalen, senior vice president and managing director at research firm Institutional Risk Analytics.

Bank of America shares closed up 6.3 percent, or 85 cents, at $14.19 on the New York Stock Exchange. The deal triggered hopes that other banks may soon agree to similar settlements, and shares of Citigroup Inc and JPMorgan Chase & Co, two other large home lenders, also rose.

Some analysts had reckoned the banking industry could lose between $50 billion and $100 billion from settlements over bad home loans, with investors including Fannie Mae, Freddie Mac and portfolio managers who bought mortgage bonds.

Dick Bove, bank analyst with Rochdale Securities LLC, said he previously estimated Bank of America would pay $5 billion annually for the next four years on mortgage buybacks, but now he expects it will pay less.

Fannie Mae, Freddie Mac and others have accused banks of selling them bad loans that did not meet the investors' specifications -- for example, loans made to people who could not verify their income.

Banks' failure to meet specifications may entitle investors to force lenders to buy back bad loans at 100 cents on the dollar, well above their market value.

Alan Villalon, a senior bank analyst at Chicago-based Nuveen Investments, said, I think 2011 will see the issue hopefully behind us. Nuveen funds own Bank of America shares.

GOOD TIMES, BAD TIMES

The agreement with Fannie Mae and Freddie Mac resolves the bulk of Bank of America's exposure to those government-sponsored enterprises (GSEs).

Fannie Mae and Freddie Mac still have to settle their claims with other major U.S. mortgage lenders. Fannie Mae said that this deal addresses about 44 percent of the $7.7 billion of its buyback requests.

The government took over the GSEs in 2008 during the subprime mortgage crisis. In a few weeks, the Obama administration is expected to announce its proposal for changing the way Fannie Mae and Freddie Mac are structured.

I honestly don't think (this settlement) has much, if any, implications for the broader GSE reform debate, said Thomas Lawler, a housing policy consultant in Leesburg, Virginia.

The Bank of America agreement is similar to a much smaller, $462 million settlement between Ally Financial Inc and Fannie Mae announced on December 27.

In the Bank of America settlement, Fannie Mae and Freddie Mac are effectively receiving about 40 cents on the dollar on their original repurchase claims of $6.8 billion, according to analysts.

The regulator for Fannie Mae and Freddie Mac, the Federal Housing Finance Agency, suggested other banks may be forced to follow suit.

While these agreements are an important step, the Enterprises (Fannie Mae and Freddie Mac) have other outstanding claims across a range of counterparties and they are being pursued, said Edward DeMarco, acting director of the FHFA.

Q4 LOSS LOOMING?

Bank of America paid $1.28 billion to Freddie Mac as part of an agreement to end all claims, including future claims, related to mortgages sold through 2008 by Countrywide, a mortgage company bought by the bank that same year.

The bank paid Fannie Mae $1.34 billion in cash and applied certain credits to reach an agreed $1.52 billion settlement on 12,045 Countrywide loans in the period 2004-2008. Fannie Mae reserved the right to bring future claims against the bank.

The payments will be split between mortgage repurchases -- in which the bank takes back the home loan -- and so-called make whole payment.

In those cases, BofA will pay Fannie or Freddie an amount that offsets the losses from a soured mortgage, making the GSE whole on the loan again. But the bank does not retake possession of the loan.

A bank spokesman said the bank did not have a breakdown of what loans will be repurchased or made whole.

Bank of America said it would set aside $3 billion in the fourth quarter to help cover the Fannie and Freddie claims.

Despite the lower-than-expected settlement, the fourth-quarter reserve likely means Bank of America will post its second straight quarterly loss when it announces fourth-quarter results on January 21.

Before the settlement, analysts projected the bank would post a profit of 25 cents per share for the quarter, according to Thomson Reuters I/B/E/S. The settlement had some analysts revising their estimates.

For example, Sandler O'Neill analyst Jeff Harte reduced his estimate from a profit of 20 cents per share to a loss of 20 cents.

The settlement does not affect the bank's Tier 1 and tangible common equity capital ratios, Bank of America said.

The bank estimates it will have $2.7 billion in outstanding repurchase requests from Fannie and Freddie not covered by the settlement. These potential losses should be covered by reserves taken through the end of the fourth quarter, Bank of America Chief Financial Officer Charles Noski said in a conference call.

The bank does not expect more losses from additional repurchase requests from Fannie Mae and Freddie Mac, Noski said.

Bank of America also said it expects to take a $2 billion charge in the quarter to write down goodwill linked to its home loans and insurance business unit, amounting to an admission that the unit is not as profitable as the bank had expected.

MORE LOSSES TO COME?

Despite the settlement, the bank still faces potential liabilities from mortgages it sold to private investors, as well as big losses from home loans it has made and kept on its books.

This doesn't get the bank completely out of trouble. They're still going to face litigation on repurchases from private-label investors, said IRA's Whalen.

Private investors, however, face a harder fight for repurchases than the GSEs, analysts said. Such investors typically had far fewer protections than Fannie Mae or Freddie Mac in purchasing mortgage securities, and have to enlist other investors in a complex and daunting litigation process to pursue repurchases.

Bank of America said during its third-quarter earnings presentation that it had received $8.7 billion in repurchase requests from outside investors and bond insurers, on $910 billion in mortgage-backed securities sold to those two groups during the housing boom.

(Reporting by Elinor Comlay in New York and Joe Rauch in Charlotte; additional reporting by Maria Aspan in New York and Corbett Daly in Washington; Editing by John Wallace, Gary Hill)