Years after launching an effort to make its consumer bank leaner and more profitable, Bank of America may be starting to reap the benefits.

Revenue and earnings at its consumer-banking division rose in the third quarter from a year earlier, even as the company's other main business lines reported revenue declines. The consumer unit's net income grew 5%, to $1.8 billion, as expenses held steady and revenue ticked up.

It was a bright spot in a mixed quarter for B of A, during which loan sales, cost cuts and a lower tax rate helped offset declines in revenue from trading, commercial banking and wealth management. Overall, the Charlotte, N.C., company swung to a $4.5 billion profit from a $232 million loss in the third quarter of last year, when it paid about $6 billion in litigation expenses.

Any upbeat revenue news stands out in the early going of earnings season. JPMorgan Chase — the country's largest bank and the first major financial institution to announce its results — reported a 6% decline in revenue, adding to fears that the third quarter would be a bad one for the industry.

Granted, B of A's overall revenue declined as well, falling about 2.5%, to $20.9 billion.

But Chief Executive Brian Moynihan can still claim some success in making the retail network more profitable, after years of cutting branches and investing in new technology. Consumer banking revenue ticked up 1%, to $7.8 billion, because of stronger mortgage origination and credit card lending, while expenses fell about 1%, to $4.4 billion.

On Wednesday Moynihan and new Chief Financial Officer Paul Donofrio, who replaced Bruce Thompson in July, highlighted the progress of the restructuring effort. Moynihan attributed the growth in the franchise to tech investments and changes to the branch network.

"In consumer banking, we grew revenue and earnings year over year despite the low interest rate environment," Moynihan said on a conference call Wednesday. The company has sold some branches, closed others, and changed account structures, yet "core consumer checking accounts continue to grow." 

These positive results from the largest retail bank in the country could be a good sign for the industry. B of A, like many large banks, has relied on expense cuts to fuel profit growth over the past several years, while focusing more on commercial clients as U.S. consumers reduced their debt.

The slowly improving economy may have persuaded Americans to start opening their wallets again, at least if B of A's results are an indication.

B of A's total consumer loans grew 5%, to $209 billion, and mortgage origination rose 17%, to $13.7 billion. Credit-card-purchase volume was also up 5%, to $56.5 billion.

Meanwhile, retail costs came down — which, if sustainable, would be the fruit of a long effort. Moynihan launched a makeover of the branch network called "New BAC" in 2011, essentially planning to reduce branches and employees while reinvesting in mobile and online banking.

Tangible results have been slow to materialize, but the third quarter showed encouraging signs, said Eric Oja, an analyst with S&P Capital IQ.

"It looks like a lot of the tech spending that they've had over the last five years is paying off," he said.

The consumer bank's efficiency ratio fell 96 basis points, to 56.62%, significantly lower than the 66.03% ratio for the company as a whole. It closed or sold 4% of its branches, bringing its network to 4,741.

Overall, headcount declined by about 1,500 employees, even as the company added loan officers, compliance employees and wealth management advisers, Moynihan said. Going forward, he expects that hiring and layoffs will more or less balance each other out.

"We are laser-focused on keeping [headcount] at that kind of level while we continue to invest in 1,000-plus people to go generate the business growth you are starting to see," he said.

Meanwhile, B of A's online traffic has picked up. Mobile accounts increased by 14%, to 18.4 million, and online accounts by 3%, to 31.6 million.

Outside the consumer bank, however, B of A's results were a bit lumpy. Its trading profits fell 15%, to $1.6 billion, worse than what Moynihan warned last month but still "better than feared," according to Barclays analyst Jason Goldberg.

B of A's margin, however, was worse than expected — a tough hurdle to overcome for the most rate-dependent of the large banks.

Its net interest margin contracted 19 basis points, to 2.10%. But the decline mostly stemmed from the cost of debt — loan yield remained relatively steady, at 3.64%, down 18 basis points from a year earlier and just 3 basis points from the second quarter.

In the end Bank of America's earnings per share of 37 cents were three cents above the average estimate of analysts tracked by Bloomberg, and investors appeared encouraged by the quarter, sending B of A's stock up around 1% in midafternoon trading.

The positive reaction reflects Wall Street's low expectations for megabank earnings, particularly after JPMorgan badly missed estimates on Tuesday night.