After a six-month search, Wells Fargo on Friday announced its new chief executive, tasking a banking industry veteran with turning around the more than 150-year-old troubled institution.

Charles Scharf, the head of Bank of New York Mellon, will become Wells Fargo’s third CEO in three years and the first outsider to lead the bank in decades.

Traditionally, taking the helm of one of the country’s largest, most well-known and profitable financial institutions would be a coveted job. But Wells Fargo is under intense scrutiny from regulators and lawmakers after years of scandals and missteps, and it struggled to fill the position.

“We know we have a series of regulatory issues,” Scharf, 54, who will start Oct. 21, said in a conference call with analysts Friday morning. “It is clear there is a huge amount of work going on.”

Scharf is replacing Tim Sloan, who abruptly stepped down as CEO in March after 31 years at the company. Sloan had spent two years trying to persuade lawmakers and regulators that Wells Fargo has reformed itself after a succession of scandals tied to bogus bank accounts, the mistaken foreclosure on hundreds of homes and faulty repossession of thousands of cars.

Wells Fargo has paid billions in fines and settlements, and overhauled its board and management but still failed to win over its toughest critics, particularly Sen. Elizabeth Warren (D-Mass.). A turning point for Sloan came in March when lawmakers scolded the executive for hours over the company’s missteps. The next day, the bank’s board announced it was raising Sloan’s pay 5 percent, bringing his total compensation to $18.4 million, which further angered lawmakers.

Allen Parker, Wells Fargo’s general counsel, stepped in as interim CEO after Sloan resigned. Parker will remain at the company.

The lengthy search for Sloan’s replacement frustrated some investors, Betsy Duke, chair of Wells Fargo’s board, acknowledged in the call with analysts. “Everyone was going, ‘When can you tell us something?’ But the truth about this process is you can’t tell them something until you’re complete,” she said.

The company’s stock price jumped 4 percent Friday morning to about $50 a share.

Scharf comes to the job with broad banking industry experience that stretches back more than two decades, including two years as head of Bank of New York Mellon and four years as CEO of Visa — two large, well-known financial institutions. He was also a former assistant to Jamie Dimon, the current chief executive of JPMorgan Chase, the country’s largest bank, and previously worked at Citigroup and Bank One.

Wells Fargo “is a fundamentally different enterprise than anything else I have been associated with, and I am thrilled to be here,” Scharf said. He will continue to live in New York with his family but will travel frequently across the country, including to the bank’s headquarters in San Francisco, Wells Fargo said.

That broad experience makes Scharf a safe political choice, who is already well known by both regulators and lawmakers, industry analysts said. But it could also work against him.

“Yes, Scharf is an outsider to Wells Fargo,” Jaret Seiberg, a financial services analyst at Cowen Washington Research Group, wrote in a research note Friday. But “he also is another white male in the CEO seat. … What is more likely is that they [House Democrats] will define him as another Wall Street insider taking over another big bank."

Scharf will likely have a honeymoon period while he learns to navigate the complexities of a bank with nearly $2 trillion in assets, more than 200,000 employees and operations across the country, while facing growing competition from Silicon Valley and criticism from Capitol Hill.

Among his first challenges will be grappling with the cap on Wells Fargo’s growth the Federal Reserve put in place last year. The bank has already been working on having the asset freeze lifted for some time, said Ken Leon, director of equity research at CFRA Research. “The ability to grow the asset base is important to grow any business,” he said.

In 2020, Scharf will have a target annual pay package of $23 million and receive a one-time make whole award of $26 million for money he lost by leaving Bank of New York Mellon, according to Equilar, the executive compensation research and consulting firm.

“The opportunity to lead Wells Fargo, an institution that plays such an important role in the financial system, was one that I could not pass up,” Scharf said during the call with analysts.

This report has been updated.