Bank of America Corp. has reached a $16.65 billion settlement with U.S. regulators to settle charges that it misled investors into buying troubled mortgage-backed securities.

The settlement announced on Thursday by the U.S. Department of Justice calls for the second-largest U.S. bank to pay a $9.65 billion cash penalty and provide $7 billion of consumer relief to struggling homeowners and communities.

It is expected to resolve the vast majority of the Charlotte, North Carolina-based bank's remaining liabilities tied to its purchases of Countrywide Financial Corp., once the nation's largest mortgage lender, and Merrill Lynch & Co.