A federal judge in San Francisco has signed off on a $480 million settlement in a class-action shareholder lawsuit over Wells Fargo’s unauthorized-accounts scandal.

The deal, granted preliminary approval late Tuesday, would compensate Wells Fargo & Co. shareholders for losses they suffered after the bank in 2016 acknowledged it had created perhaps millions of accounts without customers’ authorization.

Shareholders, including lead plaintiff Union Asset Management, sued for securities fraud, arguing that executives had inflated the bank’s stock price by claiming for years that Wells Fargo was a leader in the practice known as cross-selling — getting customers to sign up for numerous accounts and services.

MBA BY THE BAY: See how an MBA could change your life with SFGATE's interactive directory of Bay Area programs.

Executives continued to tout the practice, the defendants argued, even after it became clear that aggressive sales goals and quotas were “corrupting, rather than reinforcing, Wells Fargo’s purported corporate values and cross-selling business model.”

The company and plaintiffs reached a settlement deal in May. Wells Fargo at the time said it had set aside funds to pay the settlement, though it denied shareholders’ allegations and said it agreed to the deal “to avoid the cost and disruption of further litigation.”

Bank spokesman Ancel Martinez said Wednesday that putting the case to rest is in the best interest of the bank’s employees, shareholders and customers.

“We are making strong progress in our work to rebuild trust, and this represents another step forward,” he said.

It’s not clear how big a payout individual Wells Fargo shareholders might get. Now that the deal has been granted preliminary approval, shareholders will have the chance to file claims.

The settlement is open to anyone who bought Wells Fargo stock between Feb. 26, 2014, and Sept. 20, 2016. During that period, Wells Fargo shares traded for as much as $53. In the following weeks, shares bottomed out at about $41.

Shares have since recovered, closing at . But Wells Fargo has underperformed compared with other banks. Since October 2016, Wells Fargo shares have climbed 43 percent, while an index of bank stocks has risen 57 percent.

Lead plaintiff Union Asset, a German investment management firm, estimated that there could be tens of thousands of eligible participants.

Attorneys in the case say they may request fees of much as $96 million, and $3.2 million more will go to cover administration costs. That will leave about $380 million for affected shareholders.

This is the second major class-action settlement the bank has agreed to in the wake of its unauthorized-accounts scandal. In May, a different federal judge signed off on a $142 million settlement that will pay an average of $35 to bank customers who paid improper fees or were otherwise harmed by the bank’s practices.

Wells Fargo continues to deal with the fallout over unauthorized accounts, including numerous inquiries — internal and external — about the bank’s practices prompted by the scandal.

Last year, the bank acknowledged it had forced auto-loan borrowers to pay for unnecessary insurance policies and charged improper fees to some mortgage borrowers.

Citing those practices, regulators in April slapped the bank with a $1 billion penalty, one of the largest levied against a U.S. bank that was not related to the financial crisis. Still, all the fines, penalties and settlements don’t amount to much for the bank, which has reported profits of $11.1 billion in the first half of this year alone.

Earlier this year, the Federal Reserve ordered the bank to stop growing while it worked to improve its corporate governance for what the central bank called “widespread consumer abuses and other compliance breakdowns.”

Executives had hoped to be out from under that order sometime this year but have since said the penalty will continue into 2019.

John James, director emeritus of Pace University’s Center for Global Governance, Reporting and Regulation, said that even if the settlement and other penalties haven’t dented Wells Fargo’s bottom line, the steady stream of bad news and the increased regulatory scrutiny have likely been enough to push the bank to clean up its act.

He cited the bank’s “Re-Established” ad campaign, which seeks to improve its reputation with consumers.

“Hopefully, with the changes they’ve made at the top, there will be an incredible new emphasis on toeing the line, with the understanding that every regulatory agency, state federal and local, will be looking over their shoulder,” James said.

James Rufus Koren is a Los Angeles Times writer.