Wells Fargo has agreed to a $3.7 billion settlement with the Consumer Financial Protection Bureau (CFPB).

According to a press release, the settlement will resolve “multiple issues” involving the bank over the years such as “automobile lending, consumer deposit accounts, and mortgage lending.”

“As we have said before, we and our regulators have identified a series of unacceptable practices that we have been working systematically to change and provide customer remediation where warranted. This far-reaching agreement is an important milestone in our work to transform the operating practices at Wells Fargo and to put these issues behind us,” said Charlie Scharf, Wells Fargo’s Chief Executive Officer, according to a press release. “Our top priority is to continue to build a risk and control infrastructure that reflects the size and complexity of Wells Fargo and run the company in a more controlled, disciplined way.”

A press release from Consumer Financial Protection Bureau (CFPB) states $2 billion will be allocated to consumers. The remaining $1.7 billion will be allocated to the CFPB’s Civil Penalty Fund to provide compensation to customers who were impacted by the violations. The fines will remediate difficulties for 16 million customers.

“Wells Fargo’s rinse-repeat cycle of violating the law has harmed millions of American families,” said CFPB Director Rohit Chopra in a press release. “The CFPB is ordering Wells Fargo to refund billions of dollars to consumers across the country. This is an important initial step for accountability and long-term reform of this repeat offender.”

The release also mentions Wells Fargo has caused customers to lose vehicles and homes due to their financial practices including wrongful fees and interest charges and hard payments that were not applied accordingly.

In addition, some customers had unjustified overdraft fees and inaccurate charges on their checking and savings accounts.

“The bank’s illegal conduct led to billions of dollars in financial harm to its customers and, for thousands of customers, the loss of their vehicles and homes,” the agency said in its release. “Consumers were illegally assessed fees and interest charges on auto and mortgage loans, had their cars wrongly repossessed, and had payments to auto and mortgage loans misapplied by the bank.”