Wells Fargo said on Wednesday that Chairman and CEO John Stumpf is retiring as chairman and CEO of the bank, effective immediately.

The stock was last up more than 1 percent in extended trading.

The news comes after it was revealed that employees in Wells Fargo's community banking division opened about 2 million accounts without customer authorization, which resulted in the bank paying $185 million in penalties. Stumpf was grilled on Capitol Hill as he defended the bank's sales practices.

NBC NEWS | Wells Fargo CEO John Stumpf Retires Effective Immediately

The company's board of directors elected Wells Fargo President and Chief Operating Officer Tim Sloan to succeed as CEO, while Lead Director Stephen Sanger will serve as the board's non-executive chairman.

Sanger said in a statement that while the retiring CEO helped create "create one of the strongest and most well-known financial services companies in the world," Stumpf "believes new leadership at this time is appropriate to guide Wells Fargo through its current challenges."

The board also said that Sloan was elected to the board and that independent director Elizabeth Duke will serve as its vice chair.