Wells Fargo & Co. has agreed to pay $1 billion to settle a lawsuit accusing it of defrauding shareholders over its progress in recovering from a series of scandals over its treatment of customers.

US District Judge Gregory Woods in Manhattan federal court granted preliminary approval Tuesday to the cash settlement, which had been filed the night before.

The dollar amount had been suggested by a mediator. Woods scheduled a hearing for Sept. 8 to consider final approval.

Wells Fargo has operated since 2018 under consent orders from the Federal Reserve and two other financial regulators that require it to improve governance and oversight.

The fourth-largest US bank is also subject to an asset cap by the Fed, limiting its growth and its ability to compete with larger rivals JPMorgan Chase & Co., Bank of America Corp. and Citigroup Inc.

Shareholders accused Wells Fargo of exaggerating how well it was following through on those orders, saying the bank’s market value fell by more than $54 billion during the two years ending March 2020 when the shortcomings became known.

The San Francisco-based bank denied wrongdoing and agreed to remove the burden and cost of litigation, court documents show.

«While we disagree with the allegations in this case, we are pleased to have resolved this matter,» Wells Fargo said in a statement.

Plaintiffs’ attorneys may request up to 19% of the settlement fund for legal fees.

Wells Fargo has paid or set aside several billion dollars since 2016 to resolve regulatory investigations and litigation over its business practices.

These practices included opening around 3.5 million accounts without customer permission and charging hundreds of thousands of borrowers for auto insurance they didn’t need.

Chief Executive Charlie Scharf said repairing the 171-year-old bank founded by Henry Wells and William Fargo took longer than he expected when he took over in 2019.

“When I arrived, we did not have the culture, effective processes, or proper management oversight to remedy weaknesses in a timely manner,” he said in his March 3 letter to shareholders. “Today, we approach these issues differently.”

The case is In re Wells Fargo & Co Securities Litigation, US District Court, Southern District of New York, No. 20-04494.