Wells Fargo has agreed to pay at least $385 million to settle a California lawsuit alleging it signed up thousands of auto loan customers for costly car insurance without their consent, resulting in many having their vehicles repossessed.

The bank filed the agreement Thursday in a federal court in Santa Ana. It still needs a judge’s approval.

Another defendant, National General Insurance, agreed to pay $7.5 million, the New York Post reported.

FILE - In this March 12, 2019, file photo, Wells Fargo CEO Timothy Sloan is questioned by the House Financial Services Committee about revelations the bank had created millions of fake bank accounts to reach their financial goals, on Capitol Hill in Washington. Wells Fargo has agreed to pay at least $385 million to settle a California lawsuit alleging it signed up thousands of auto loan customers for costly car insurance without their consent, resulting in many having their vehicles repossessed. The bank filed the agreement Thursday, June 6, 2019, in a federal court in Santa Ana, Calif. It still needs a judge's approval. (AP Photo/J. Scott Applewhite, File)
FILE – In this March 12, 2019, file photo, Wells Fargo CEO Timothy Sloan is questioned by the House Financial Services Committee about revelations the bank had created millions of fake bank accounts to reach their financial goals, on Capitol Hill in Washington. Wells Fargo has agreed to pay at least $385 million to settle a California lawsuit alleging it signed up thousands of auto loan customers for costly car insurance without their consent, resulting in many having their vehicles repossessed. The bank filed the agreement Thursday, June 6, 2019, in a federal court in Santa Ana, Calif. It still needs a judge’s approval. (AP Photo/J. Scott Applewhite, File)

San Francisco-based Wells Fargo confirmed the agreement Friday and called it “an important step in making things right.” The bank’s statement said that it will be sending checks to affected customers.

The 2017 class-action lawsuit alleged that for more than a decade, Wells Fargo tacked on insurance to customers’ car loans that they didn’t need because they had private insurance.

Some 25,000 car owners couldn’t meet the additional fees and had their vehicles repossessed, the suit alleged.

FILE - In this April 16, 2007, file photo, a customer banks from his vehicle at a Wells Fargo drive-thru ATM in the Atwater Village neighborhood of Los Angeles. Wells Fargo has agreed to pay at least $385 million to settle a California lawsuit alleging it signed up thousands of auto loan customers for costly car insurance without their consent, resulting in many having their vehicles repossessed. The bank filed the agreement Thursday, June 6, 2019, in a federal court in Santa Ana, Calif. It still needs a judge's approval. (AP Photo/Damian Dovarganes, File)
FILE – In this April 16, 2007, file photo, a customer banks from his vehicle at a Wells Fargo drive-thru ATM in the Atwater Village neighborhood of Los Angeles. Wells Fargo has agreed to pay at least $385 million to settle a California lawsuit alleging it signed up thousands of auto loan customers for costly car insurance without their consent, resulting in many having their vehicles repossessed. The bank filed the agreement Thursday, June 6, 2019, in a federal court in Santa Ana, Calif. It still needs a judge’s approval. (AP Photo/Damian Dovarganes, File)

The bank acknowledged in 2017 that $80 million in unnecessary insurance charges had been added to 800,000 auto loans.

It’s one in a series of scandals involving the banking giant, starting in 2016 with the uncovering of millions of fake checking accounts its employees opened to meet sales quotas.

That led to the resignation of CEO John Stumpf. Last year, the Federal Reserve capped the size of Wells Fargo’s assets, and Stumpf’s replacement, Tim Sloan stepped down in March. New improprieties had come to light on his watch, including the auto loan issues.

Federal regulators who lost patience with Wells Fargo’s continued bad behavior inflicted harsh punishments. Wells had to pay a $1 billion fine last year to the Consumer Financial Protection Bureau and the Office of the Comptroller of the Currency. But more importantly, the Federal Reserve stepped in and handcuffed Wells’ ability to grow its business until the bank could prove that it had gotten its house in order.

Despite the restrictions, Wells Fargo reported in March that it earned $5.86 billion and profits rose by 14% from a year earlier, helped by higher interest rates.

Wells Fargo stock closed down 29 cents Friday at $45.63 per share.