Matt Krantz

USA TODAY

John Stumpf, the embattled CEO of Wells Fargo (WFC), unexpectedly retired from the company on Wednesday effective immediately.

Stumpf's move comes just weeks after he was grilled by two congressional panels over the way the bank handled an alleged scam where upwards of 2 million accounts were created by employees without the knowledge of customers. The accounts were allegedly opened so thousands of employees could meet aggressive sales goals set by management. Stumpf was widely criticized for the way he handled the questioning, pushing the blame to lower-level employees and not holding upper-level executives, including himself, responsible.

Stumpf, 63, is resigning as both CEO and chairman. He has been CEO since June 2007 and has worked for the company for 34 years. The fact that Stumpf, the company's top executive, was also the chairman of the board was another point brought up by lawmakers questioning why the bank didn't act sooner to deal with the widening scandal. The roles are split, now. The company's president and chief operating officer, Tim Sloan, 55, will replace Stumpf as CEO. Sloan was head of the Wells Fargo unit that made loans to large corporate customers and not directly tied to the alleged consumer banking fraud. Stephen Sanger, a former Yoplait USA president and member of the Wells Fargo board since 2003, was named as the board's non-executive chairman.

Well Fargo's Stumpf may envy exit pay of other CEOs

"I have decided it is best for the Company that I step aside. I know no better individual to lead this company forward than Tim Sloan," Stumpf said in a statement.

While Stumpf doesn't receive a special retirement payout, executive-pay tracker Equilar estimates he'll walk with $134.1 million. The package remains that large even after Stumpf last month agreed to a $41 million clawback following a grilling he received from the Senate Banking Committee reprimanding him for not taking responsibility. He agreed to give up unvested stock, but still owns shares vested in previous years.

$134.1M! Wells Fargo CEO's retirement payout even bigger than thought

During his nearly four-hour testimony before the House Financial Services Committee last month, Stumpf was called upon several times to resign by representatives. Stumpf said at the hearing he wasn't planning to resign, and that remaining at the bank and seeing through the reforms was part of taking responsibility. He also indicated such decisions are up to the board.

Wells Fargo CEO grilled by House panel

While Stumpf walks with millions, the fraud has been much costlier for the bank's once-stellar reputation and for those who hold Wells Fargo stock. Investors have lost $23.1 billion in market value as the shares have fallen nearly 10% from when the scandal broke. Wells Fargo was formerly the most valuable U.S. bank but has since fallen behind JPMorgan Chase (JPM).

"As one of millions of Americans who has a Wells Fargo account, I found the bank’s conduct outrageous," says Carl Tobias, law professor at the University of Richmond. "The bad corporate behavior justifies what happened to him."

VIDEO: Elizabeth Warren tears into Wells Fargo CEO at Sept. 21 Senate hearing: