WASHINGTON (AP) — Consumer banking giant Wells Fargo agreed to pay $3.7 billion to settle charges that it harmed consumers by charging illegal fees and interest on auto loans and mortgages, as well as incorrectly applied overdraft fees against savings and checking accounts.

The Consumer Financial Protection Bureau on Tuesday ordered Wells to repay $2 billion to consumers and enacted a $1.7 billion penalty against the bank. It’s the largest fine to date against Wells, which has spent years trying to rehabilitate itself after a series of scandals tied to its sales practices.

The bureau says the bad behavior by the bank impacted more than 16 million customers. In addition to improperly charging its auto loan customers with fees and interest, in some cases the bank wrongfully repossessed borrowers’ vehicles. The bank also improperly denied thousands of mortgage loan modifications.

Wells Fargo has been repeatedly sanctioned by U.S. regulators for violations of consumer protections law going back to 2016, when Wells employees were found to have opened millions of accounts illegally in order to meet unrealistic sales goals. Since then, Wells has repeatedly said it’s cleaning up its act, only to be fined for additional violations of consumer protection law.

Back in 2018, Wells paid a $1 billion penalty to cover widespread consumer law violations.

The bank remains under a Federal Reserve order forbidding it from growing any larger until the Fed deems that its corporate culture problems are resolved. That order, originally enacted in 2018, was expected to last only a year or two.

In a statement, CEO Charles Scharf said the agreement with the CFPB is part of the effort to “transform operating practices at Wells Fargo and to put these issues behind us.”