Fannie Mae headquarters stands in Washington, D.C., U.S. (Joshua Roberts/BLOOMBERG)

Bank of America, the second-largest U.S. lender by assets, will stop selling new home loans to Fannie Mae after a dispute over faulty mortgages.

Starting this month, the Charlotte-based bank will deliver only loan modifications and refinancings to U.S. government-controlled Fannie Mae, the bank said Thursday in its annual filing with securities regulators.

Chief executive Brian T. Moynihan has been cutting expenses and jobs to revive profitability while fending off legal disputes tied to faulty home mortgages, with Fannie Mae among the biggest claimants. The bank’s 2008 acquisition of Countrywide Financial, which was the largest home lender during the U.S. housing bubble, left Bank of America responsible for shoddy loans that contributed to about $42 billion in costs.

“This decision will not affect the credit available to our customers, and we will rely on other sources of liquidity to continue to ensure we are lending to our customers and supporting the housing-market recovery,” said Jerry Dubrowski, a spokesman for the bank, in an e-mailed statement. “We remain focused on supporting our customers with loan modifications and refinancing through the Making Home Affordable program.”

The bank will either sell new loans to Freddie Mac, the other U.S.-controlled mortgage finance company, or retain them on its balance sheet, said a person with direct knowledge of the lender’s plans.

Dubrowski said the decision won’t have a material impact on its business. The bank has ended the past practices of Countrywide, “which had a significant relationship with Fannie Mae,” he said.

Concern about the mounting cost of faulty home lending weighed on the bank’s stock last year. After posting the worst performance in the Dow Jones industrial average for 2011, Bank of America is leading that 30-company benchmark this year with a 40% gain.

— Bloomberg News