(Bloomberg) -- Barclays Plc’s investment bankers brought in a record haul in fees as the booming deals market extended through the second quarter, offsetting muted earnings in the trading unit.Income from capital markets and merger advisory at the London-based lender rose by almost a fifth to 873 million pounds ($1.2 billion), outperforming the average on Wall Street. This is the highest since Jes Staley took over as chief executive officer in late 2015.

Revenues from trading, though, plunged by 22% as the rally in fixed-income markets that drove record profit a year ago petered out. Overall, earnings in the second quarter were ahead of forecasts.

Barclays, the first major U.K. lender to publish earnings, also released a net 797 million pounds from last year’s provisions for loans that could turn sour during the pandemic, and said it planned to buy back shares worth as much as 500 million pounds as the economy continued to recover.“Our investment banking fees and equities businesses have delivered record income, and we are seeing encouraging signs of recovery in consumer banking,” Staley said in a statement on Wednesday.

More than five years into Staley’s tenure, the American CEO has reshaped the corporate and investment bank to provide growth during slower times at the retail bank -- a strategy that has been particularly effective during the pandemic. He has recently boosted the firm’s securities unit with senior hires from his old employer JPMorgan Chase & Co. and a raft of promotions.

The results come as European rival Deutsche Bank AG announced it also rode out the trading slump, helping it to lift revenue guidance.Barclays also announced a 321 million-pound charge as it cuts back on real estate. The lender said in June it was giving up its second office in London’s Canary Wharf financial district, moving traders and bankers into its main headquarters nearby.

©2021 Bloomberg L.P.