Embattled Wells Fargo CEO John Stumpf will retire effective immediately, the company announced Wednesday, marking a stunning downfall for one of the banking industry's most powerful figures.

The Wells Fargo (WFC) boss is out in the wake of a national uproar that erupted after regulators accused the bank of creating many as two million fake bank and credit card accounts. The company admitted to firing 5,300 workers over several years.

A person familiar with the matter said that Stumpf made the decision to retire, which was welcomed by the board.

Stumpf's resignation comes after Senator Elizabeth Warren publicly condemned him for "gutless" leadership at a Sept. 20 Senate hearing. "You should resign. ... You should be criminally investigated," Warren told Stumpf during a fiery one-sided exchange.

On Wednesday, Warren applauded Stumpf's decision to leave the helm of the company, tweeting "As I said: @WellsFargo CEO Stumpf should resign, return every nickel he made during the scam, & face DOJ/SEC investigation. He's 1 for 3."

As I said: @WellsFargo CEO Stumpf should resign, return every nickel he made during the scam, & face DOJ/SEC investigation. He's 1 for 3. — Elizabeth Warren (@SenWarren) October 12, 2016

The hearing, and another similarly blistering dressing down of Stumpf before House lawmakers a week later, may have helped speed up Stumpf's demise. While the bank CEO said he was "deeply sorry" and insisted there was no "scheme" to scam customers, he struggled at times to answer lawmakers' questions. He often gave the impression he wasn't fully in charge of the company.

Jeffrey Sonnenfeld, an authority on corporate governance at Yale, said Stumpf proved to be a "deer caught in the headlights with a tin ear in understanding, addressing, and communicating the problem."

Ironically, Stumpf prided himself on Wells Fargo's work ethic. In a 2015 Fortune interview he called himself the "keeper of our company's culture."

Related: I called the Wells Fargo ethics line and was fired

Yet former Wells Fargo employees believe it was precisely the bank's pressure-cooker sales environment that spurred staffers to open thousands of fake accounts.

The scandal swelled when nearly a half-dozen ex-Wells Fargo workers told CNNMoney they believe they were fired in retaliation for calling the ethics line about improper sales tactics. "They ruined my life," said Bill Bado, who was fired in 2013 for "tardiness" after alerting HR about fake accounts.

Stumpf, 63, worked for the bank for 34 years, and has served as its CEO since 2007.

"I am grateful for the opportunity to have led Wells Fargo," Stumpf said in a statement Wednesday. "While I have been deeply committed and focused on managing the Company through this period, I have decided it is best for the company that I step aside."

Stumpf made $19.3 million in 2015. But amid the scandal, he agreed to forfeit much of his 2016 salary, including his bonus and $41 million in stock awards, as the bank launched an internal investigation into the phoney accounts.

The probe comes after employees told CNNMoney that the practice of opening fake accounts began years earlier than Wells Fargo has previously acknowledged.

At the time it was announced, Stephen Sanger, the board's lead independent director, said Stumpf and another top bank executive could face further penalties, depending on the results of the investigation. On Wednesday, the person close to the matter said the board will continue its probe, and that Stumpf's retirement does not preclude further action against him.

Tim Sloan, Wells Fargo's president, will take over as chief executive, and lead director Stephen Sanger will take over Stumpf's other duties as chairman of the board.

Before Wells Fargo was engulfed in the fake account scandal, CEO Stumpf had been widely lauded as an everyday guy from middle America. He was one of 11 kids, and grew up getting his hands dirty working on his family's dairy farm in Minnesota.

"We had tough times, and we were poor, but we got through it because we were in it together," he told Fortune, adding that he shared a bed with two of his brothers until he was 18.

Stumpf was even named Morningstar's CEO of the Year in 2015. The company applauded him for "shunning activities that put profits ahead of customers" as most big banks did leading up to the 2008 financial crisis.

Despite Stumpf's retirement, activist group Public Citizen urged the Department of Justice to continue probing the Wells Fargo scandal.

"The retirement is essentially an admission of wrongdoing that only reinforces the need to continue tough criminal investigations" of Stumpf and other top executives, said Robert Weissman, president of Public Citizen.

Investors and analysts had similar reactions.

Jaret Seiberg, a managing director at Cowen and Company, said his firm sees the executive shakeup as a "positive move," but notes the scandal is not over.

"We continue to expect that Wells Fargo will be bogged down in this controversy for the next two years," Cowen and Company said in a statement.

Wells Fargo shares were up 2% in after-hours trading.