Bank of America Corp, Wells Fargo & Co, JPMorgan Chase & Co, Citigroup Inc and Ally Financial Inc agreed to the settlement after 16 months of negotiations with state attorneys general and federal agencies, including the U.S. Justice Department and the U.S. Department of Housing and Urban Development.