By John Kell 

Bank of America Corp. on Wednesday said it would pay about $9.5 billion to settle all litigation by a top U.S. federal regulator over mortgage securities sold to Fannie Mae and Freddie Mac.

The second-largest U.S. lender by assets warned the settlement would trim first-quarter profit by about $3.7 billion before taxes, or 21 cents a share after tax.

The Federal Housing Finance Agency, which controls the government-backed mortgage giants, sued Bank of America and 17 other financial institutions in 2011 seeking unspecified damages on about $200 billion of mortgage-backed securities.

Write to John Kell at john.kell@wsj.com

Access Investor Kit for Bank of America Corp.

Visit http://www.companyspotlight.com/partner?cp_code=A591&isin=US0605051046

Access Investor Kit for Federal Home Loan Mortgage Corp.

Visit http://www.companyspotlight.com/partner?cp_code=A591&isin=US3134003017

Access Investor Kit for Federal National Mortgage Association

Visit http://www.companyspotlight.com/partner?cp_code=A591&isin=US3135861090

Subscribe to WSJ: http://online.wsj.com?mod=djnwires