Bank of America Corp on Monday entered an $11.6 billion settlement to end Fannie Mae's claims that the bank improperly sold it mortgages that later soured, and to resolve problems with foreclosures, the companies said.

The settlement is a major step for Bank of America toward resolving claims from investors who want the bank to buy back loans that its Countrywide Financial subsidiary sold to them during the housing boom, many of which later went bad.

The agreement largely covers the $11.2 billion of claims that government-owned finance company Fannie Mae had against the bank, which represented about 44 percent of the bank's total pending claims at the end of the third quarter.

Bank of America, which bought Countrywide in 2008, still needs court approval for an $8.5 billion settlement with private investors and is locked in litigation with insurer MBIA Inc over mortgage-related claims.

The settlements, other charges, and a series of asset sales the bank also announced Monday will result in Bank of America posting only a small profit for 2012's fourth quarter. The bank is due to report results on January 17.

Bank of America is paying $3.6 billion to Fannie Mae and buying back $6.75 billion of bad loans from the mortgage company to clear up all claims that government-owned Fannie Mae had made against the bank. Bank of America is buying the loans for the value of their outstanding principle, and will immediately record a loss on them.

The bank said the pact covers loans with a current balance of about $300 billion and ends "substantially" all unresolved claims on loans sold to Fannie from Jan 1, 2000 to December 31, 2008.

Fannie Mae and its sibling, Freddie Mac, essentially buy mortgages from banks and package them into bonds for investors. But in the mortgage boom, banks sold loans to the two companies that Fannie Mae and Freddie Mac say should never have been sold, because for example, borrowers had misstated their income. The two mortgage finance companies are pushing banks to buy back the loans.

Bank of America said most of the repurchasing settlement would be covered by reserves, and another $2.5 billion, before taxes, that it set aside in the fourth quarter.

A separate settlement over foreclosure delays will result in Bank of America paying $1.3 billion to Fannie Mae, the mortgage company said. Bank of America had already set aside money to cover most of that, but took another $260 million charge in the fourth quarter to cover the balance.

Bank of America also sold the rights to collect payments on about $306 billion of loans to Nationstar Mortgage Holdings and Walter Investment Management Corp. Nationstar is paying $1.3 billion for the right to service some $215 billion of loans, while Walter Investment is paying $519 million for the right to service about $93 billion of mortgages.

Reuters first reported on Friday that Bank of America was talking to Nationstar and Walter Investment.

Bank of America is eager to reduce expenses in its mortgage servicing unit, where costs have ballooned as the bank has hired staff to work with customers behind on payments. The unit now has nearly 42,000 employees, about 15 percent of the bank's total workforce.

In a conference call with investors on Monday, Nationstar CEO Jay Bray said the company could take on workers from Bank of America as it builds staff to handle its increased workload.

At the end of December, Bank of America had 775,000 home loans that were delinquent by 60 days or more, down from 936,000 loans at the end of September. After the latest sale, the bank said this number will decline substantially.

The No. 2 U.S. bank by assets has lagged peers in recovering from the financial crisis largely due to losses from its disastrous Countrywide acquisition. The bank has paid more than $40 billion to settle lawsuits and to buy back soured loans.

Two years ago, Bank of America reached settlements with Fannie Mae and Freddie Mac over loan repurchase requests. The pact with Freddie Mac covered all outstanding claims, but the agreement with Fannie Mae covered only claims that were already in the works. Fannie Mae later began sending new claims to the bank over loans originated during the housing boom, spurring the dispute between the two companies.

Bank of America said Monday it will take an additional $2.5 billion expense in the fourth quarter for a settlement with federal regulators over improper foreclosures as well as other mortgage-related matters. The results will also include a $700 million charge related to the value of the bank's debt and a $1.3 billion tax benefit.

Analysts had been expecting the bank to report earnings per share of 19 cents in the fourth quarter, according to Thomson Reuters I/B/E/S.

Bank of America's shares were flat at $12.11 in morning trading.

(Reporting By Rick Rothacker; Editing by Dan Wilchins, Maureen Bavdek and David Gregorio)