(Reuters) - Bank of America Corp reported quarterly profit above analyst expectations on Monday as the second-largest U.S. lender cut expenses and benefited from growth in loans and deposits on the back of a strengthening economy.

Noninterest expense dropped 5 percent in the quarter from a year earlier as the bank trimmed headcount and worked on digitizing its retail operations to lower overhead.

Revenue rose in each of the bank’s segments with the exception of global banking, where lower investment banking fees dragged revenue down 2 percent.

The bank’s shares were up 2.4 percent to $29.24 in morning trading.

During his near-decade long tenure, Chief Executive Brian Moynihan has focused on making the bank’s sprawling operations more efficient. Two years ago, he pledged to cut expenses to $53 billion by the end of this year, and the bank confirmed it is on track to meet that goal and plans to hold expenses at that level through 2020.

Banks have been broadly expected to report higher investment banking fees this year as lower U.S. corporate tax rates and a friendlier regulatory environment encourage deal making.

Moynihan acknowledged on a call with analysts that the bank is underperforming peers when it comes to earning M&A advisory fees.

“The team knows they can do a better job, and they’re after it,” he said.

The corporate tax cuts have helped boost Bank of America’s bottom line along with its Wall Street peers, while Federal Reserve interest rate hikes have padded net interest income.

FILE PHOTO: A customer uses an ATM at a Bank of America branch in Boston, Massachusetts, U.S., October 11, 2017. REUTERS/Brian Snyder/File Photo

Total loans increased 2 percent in the quarter for Bank of America, led by growth in its consumer banking and wealth management businesses.

Total loan growth continued to be weighed by its runoff portfolio of consumer real estate loans, while year-over-year growth in Bank of America’s business segments was 5 percent.

In comparison, JPMorgan Chase & Co’s core loans, which exclude consumer credit and loans to the biggest corporations, rose 7 percent in the quarter. Citigroup Inc’s total loans rose 5 percent.

Loan growth combined with higher interest rates helped push net interest income up during the quarter, but rising interest rates also increased the price the bank pays for its deposits.

The bank has increased the rate it pays for deposits in its wealth management and global banking units, Chief Financial Officer Paul Donofrio said.

Overall, Bank of America’s net income applicable to common shareholders rose 36.3 percent to $6.47 billion in the second quarter.

Excluding items, it earned 64 cents per share compared with the average expectation of 57 cents per share, according to Thomson Reuters I/B/E/S.

Net interest income rose 6 percent as the bank’s large stock of deposits and rate-sensitive mortgage securities helped it take advantage of four interest rate hikes in the past year.

Revenue, net of interest expense, fell 1 percent to $22.76 billion. Revenue in the year earlier quarter included a $793 million pretax gain on the sale of the bank’s non-U.S. consumer card business. Analysts had expected revenue of $22.29 billion.

(This version of the story corrects the day of week in the first paragraph)