By Ben Eisen and Dave Sebastian

Wells Fargo & Co. said Tuesday it will replace its long-serving chief financial officer, the latest executive to leave as the bank's new CEO shakes up top management.

The bank said John Shrewsberry would retire in the fall. The 55-year-old executive will be succeeded by Mike Santomassimo, who was chief financial officer at Bank of New York Mellon Corp.

Mr. Shrewsberry, a Wells Fargo veteran of more than two decades and CFO since 2014, was one of the few top executives to stay in his position through the bank's four-year-old fake accounts scandal.

Mr. Santomassimo, 44 years old, will join Wells Fargo as the bank homes its focus on cost-cutting. The fourth-largest U.S. bank by assets reported its first loss since 2008 in the second quarter and cut its dividend. Charles Scharf, who joined Wells Fargo as chief executive officer last fall, has said the bank needs to cut $10 billion in expenses annually to be closer in line with its peers, a move that will likely result in widespread layoffs.

Evercore ISI bank analyst John Pancari said the hiring of a new CFO marks a shift toward the next phase of Mr. Scharf's turnaround plan, which involves cutting expenses and retooling the bank's business lines. Mr. Santomassimo helped Mr. Scharf bring down expenses at BNY Mellon. Wells Fargo's share price rose more than 6% Tuesday in late morning trading.

Mr. Scharf has brought in a new slate of executives as he tries to turn around the bank and improve its standing with regulators. He has hired extensively from BNY Mellon, where he was previously CEO, and JPMorgan Chase & Co., where he was also an executive.

Mr. Santomassimo became BNY Mellon's CFO in 2018. He was previously finance chief for BNY Mellon's investment services businesses, and spent 11 years at JPMorgan Chase in finance leadership roles.

Succeeding Mr. Santomassimo at BNY Mellon is Emily Portney, BNY Mellon said. She was previously an executive in the bank's asset servicing business. Before that, she served as finance chief for Barclays International and spent 22 years at JPMorgan Chase, where she was head of clearing and collateral management, among other roles.

Write to Ben Eisen at ben.eisen@wsj.com and Dave Sebastian at dave.sebastian@wsj.com