LOS ANGELES (MarketWatch) — Shares of Bank of America Corp. led the financial sector higher Monday, rallying as the banking giant said it reached a settlement with Fannie Mae and Freddie Mac to repurchase troubled home loans.

The Dow Jones Industrial Average component’s shares rose 6.4% — their biggest percentage gain since early May — to $14.19 after the company BAC, +0.94% announced it agreed to buy back the loans sold by Countrywide Financial Corp., which it acquired during the financial crisis.

B. of A. said it expects to record a $2 billion charge related to the settlement. It also expects to take a provision of about $3 billion related to repurchase obligations for residential mortgage loans sold by company affiliates directly to Freddie Mac FMCC, -1.54% and Fannie Mae FNMA, -0.98% .

“These actions resolve substantial legacy issues in the best interest of our shareholders,” said Chief Executive Brian Moynihan in a press release. See more on Bank of America’s settlement.

The settlement stands as an “incremental positive” for B. of A. and other banks, wrote Deutsche Bank analyst Matt O’Connor in a research note.

Assuming that home prices don’t drop significantly and that the economic recovery continues, the move “should put to rest the put-back problems related to government-sponsored enterprises,” noted Jaime Peters at investment research firm Morningstar Inc.

Bank of America was the top-performing component for both the Dow industrials DJIA, +1.41% as well as the Financial Select Sector SPDR Fund XLF, +1.07% , which finished 2.2% higher.

What's the 0utlook for stocks?

The financial-sector fund gained about 12% in 2010 but lagged behind the S&P 500 Index SPX, +1.14% .

“Bank stocks advanced about 15% in December as near-term concerns for revenue growth gave way to renewed takeover speculation and a brighter economic outlook,” Raymond James analysts wrote in a client report Monday.

“Only until recently, in the light of improved economic data, less regulatory uncertainty and renewed takeover enthusiasm, have the banks been able to post a sustainable rally,” they added.

In economic news, U.S. manufacturing grew in December, according to a widely tracked benchmark compiled by the Institute for Supply Management. See full story on ISM.

“Economic data for year-end 2010 continue to show generally improving conditions, evident in manufacturing industries, but no improvement in house prices,” PNC economists said Monday. “We expect house prices to continue to show small declines through 2011 before improving home sales make a sufficient dent in inventories to stabilize house prices nationwide in 2012.”