Wells Fargo & Co. general counsel Allen Parker, who served as interim CEO and lost his bid to make it permanent, is leaving the company March 31 "to pursue other business opportunities," the company said Thursday.

Parker, who could not be reached for comment, said in a statement, "I want to offer my sincere thanks to all my colleagues, especially our 261,000 team members, for their support and encouragement during my time at Wells Fargo. I have had a wonderful experience at this remarkable company, first as general counsel and then as interim CEO, and I will work diligently in the months ahead to assist in an effective transition to a new general counsel."

He was hired as general counsel in March 2017 to guide the bank through several scandals—a major one involved fake bank accounts. While the bank's stock prices plunged, Parker worked to settle massive litigation and to calm its turbulent relationships with regulators, who placed a cap on the bank's growth until they are satisfied with the reforms.

When the bank's CEO left under pressure in March, it named Parker interim CEO, and by all accounts he worked hard to retain the title.

But Wells Fargo chose an outsider to be CEO, banking veteran Charles Scharf, who arrived Oct. 21. Parker returned to the general counsel role with much praise from both Scharf and the board of directors.

In a statement Thursday, Scharf said, "I want to thank Allen for his dedication to Wells Fargo and his many contributions as general counsel and interim CEO. He has demonstrated exemplary leadership, both in moving the company forward during an important period in our history and in his active engagement with team members and all stakeholders. We wish him all the best as he embarks on the next chapter in his distinguished career."

The company said it will begin a search for a new general counsel immediately with the goal of having Parker assist in a smooth transition.

Among other changes, Parker revamped Wells Fargo's legal and compliance departments, bringing in experts and creating new positions, such as a chief credit and market risk officer to head a new regulatory and compliance working group.

Before joining Wells Fargo, Parker had a long career with Cravath, Swaine & Moore, where he was presiding partner from January 2013 to December 2016.