Wells Fargo & Co. said on Thursday Tim Sloan will resign immediately as its chief executive, becoming the second CEO to leave the bank in the fallout of a wide-ranging sales practices scandal.

The board said in a statement it concluded it was best to seek an outside candidate. The bank's general counsel, C. Allen Parker, will serve as interim chief executive.

"The board has concluded that seeking someone from the outside is the most effective way to complete the transformation at Wells Fargo," Board Chair Betsy Duke said in a statement.

As recently as a week ago, the board reiterated its unanimous support for Sloan.

Sloan, a 31-year veteran at the bank, took the helm of the company in October 2016 after John Stumpf resigned following revelations that the bank opened potentially millions of unauthorized consumer accounts. Prior to serving as CEO, Sloan served as chief operating officer and head of the wholesale bank.

Sloan had become a target for regulators and politicians who repeatedly called for his removal. Senators Elizabeth Warren and Sherrod Brown recently called for his resignation. Earlier this month, he was grilled by the House Financial Services Committee.

Sloan's departure came two weeks before the fourth-largest U.S. bank by assets was due to report first-quarter results and a month before its annual shareholder meeting.

In 2016, the bank agreed to pay $185 million to the U.S. Consumer Financial Protection Bureau and other agencies, the largest fine of its kind, to settle a sales practice scandal in its consumer retail bank.

Two weeks ago, the bank said Sloan received a 5 percent pay raise for 2018, with base salary of $2.4 million, $14 million in stock awards and a $2 million bonus based on the bank's financial performance.