SAN FRANCISCO — Former Wells Fargo chief executive John Stumpf has captured $54.9 million in gains by exercising Wells Fargo stock options, the bank stated Wednesday in a regulatory filing.

Stumpf left the San Francisco-based bank in October, after a scandal surfaced over bogus bank accounts. The new disclosure that he gained from stock options marks a potential setback for the bank in its efforts to restore its reputation.

“Stumpf walks away with a truckload of cash,” said Ken Thomas, a Miami-based independent bank analyst. “This won’t go over well in Congress and with the bank’s customers. This will rub salt in the wounds for a lot of people.”

Current Wells Fargo CEO Timothy Sloan received $13 million in total direct compensation during 2016, a 17.9 percent increase from his pay during 2015, the bank’s filing with the Securities and Exchange Commission also showed.

Stumpf, who presided over the bank as CEO during the years when employees opened up to 2.1 million checking and credit accounts without the permission of customers, also received $4.8 million in total direct compensation during 2016, after the bank’s compensation committee rescinded his long-term compensation from 2014, 2015 and 2016.

The compensation in 2016 represented a steep decline from the total direct pay of $19.3 million that Stumpf received during 2015.

Carrie Tolstedt, who headed the Wells Fargo community banking unit that employed numerous workers who illegally opened the unwanted accounts, forfeited unvested equity awards worth about $19 million and lost her bonus for 2016.

“Mr. Stumpf and Ms. Tolstedt received no severance payments or retirement enhancements in connection with their 2016 departures from our company, other than a part-time driver available to Mr. Stumpf for security purposes,” Wells Fargo stated in the SEC filing.

John Shrewsberry, Wells Fargo’s chief financial officer, received $9.3 million in total direct compensation in 2016, up 2.3 percent from 2015.

The SEC filings show that Stumpf exercised a series of stock options that produced the gain of nearly $55 million for the ex-CEO.

Current CEO Sloan also gained $5.4 million by exercising multiple stock options, the SEC filing disclosed.

“It’s not surprising that the former CEO was able to cash out shares that he had previously vested,” said Michael Yoshikami, a banking industry expert and president of Walnut Creek-based Destination Wealth Management. “He did forgo a significant percentage of his stock awards, but that obviously did not apply to the previously awarded grants and shares.”

The gains on the way out the door for Stumpf might also stoke a fresh debate over how companies should compensate their chief executives and other top managers.

“This will certainly give ammunition to those that say executives should be more accountable in a direct way for corporate losses,” Yoshikami said. “This is often talked about, but in our current free-market economy, that has been difficult to implement.”

The compensation and gains from stock options might particularly irk the bank’s middle-class and low-income customers who may be struggling to make ends meet or are happy to get any sort of pay increase each year, Thomas said.

“People will be wondering where is the accountability,” Thomas said. “But it’s a different world with the too-big-to-fail banks like Wells Fargo.”