(Reuters) - Bank of America Corp reported a higher-than-expected quarterly profit on strength in its consumer bank and cost cuts that are beginning to bear fruit after years of branch closures, staff cuts and efforts to reduce technology and paper-related expenses.

FILE PHOTO - The Bank of America building is shown in down town Los Angeles, California, U.S., March 6, 2017. REUTERS/Mike Blake

Chief Executive Officer Brian Moynihan spoke glowingly of a broad turnaround in the consumer business that began in 2009, calling its $2 billion in quarterly profit a “milestone” on a call with analysts on Tuesday.

In the midst of the Great Recession, the unit had 6,000 financial centers, 100,000 employees, two-thirds the amount of deposits and little in the way of digital banking capabilities. Regulatory changes put into place following the 2008 financial crisis soon began to curtail revenue, as did strategic decisions like cutting back on business generated from third parties.

The business recently has been benefiting from the cost cuts as well as improved technology, growth in deposits and a focus on higher-quality borrowers, Moynihan said.

In the second quarter, the division managed to increase deposits at a lower cost and use those cheaper funds to fuel loan growth, helping it to record a higher profit than any other unit.

Overall, Bank of America hit a target of spending 60 cents for every dollar of revenue it produces, down from 63 cents a year earlier. Investors have been watching that metric closely as a sign of how efficiently the bank is run.

Bank of America, the second-largest U.S. lender by assets, is working to cut annual operating expenses to $53 billion next year.

Consumer banking helped Bank of America deliver net income of $4.9 billion, or 46 cents per share, up 11 percent from the year-ago period. Analysts had been expecting 43 cents, on average, according to Thomson Reuters I/B/E/S.

The bank’s total revenue of $23.07 billion also beat the average analyst estimate of $21.78 billion.

“This was a good quarter all around for BofA,” said Evercore ISI analyst Glenn Schorr. “You really have to look hard to find a few issues to talk about.”

Moynihan and Chief Financial Officer Paul Donofrio both characterized the second quarter as one of the best in the bank’s history.

But its stock was down 1.1 percent at $23.75 at midday, following a 8.4 percent year-to-date rise through Monday’s close.

Even as big banks have reported better results, investors have been disappointed that profits are not growing faster. Last week, shares of JPMorgan Chase & Co, Wells Fargo & Co and Citigroup Inc each fell after beating analysts’ estimates, as did Goldman Sachs Group Inc on Tuesday.

Bank of America’s profit and revenue beats were overshadowed by net interest income falling short of expectations, analysts said. That metric, which rose 8.6 percent to $10.99 billion during the second quarter, helps gauge the difference between a bank’s cost of funding and the income it generates from those funds.

Bank of America is considered the most interest-rate sensitive among big U.S. banks because of the way its balance sheet is constructed in terms of loan maturities, types of funding and hedges.

Apart from its global markets unit, which suffered a downturn in trading like other Wall Street banks, Bank of America’s other business lines also produced higher profits.

Wealth and investment management reported record net income of $804 million, and a record pretax profit margin of 28 percent. Both the wealth business and retail brokerage, which sits inside the consumer business, attracted more assets.

Global banking also earned more money, with growth in corporate and commercial loans, more revenue from transaction services and higher investment banking fees related to those customers.

Non-interest expenses rose 1.7 percent, partly due to charges related to closing data centers. But the bank still managed to hit Moynihan’s efficiency target and produced 5 percentage points of “operating leverage,” which measures how well a company can maintain revenue while cutting costs.