Bank of America on Wednesday posted profit that exceeded analysts' expectations on strength in its sprawling retail bank.

The lender said it generated $7.3 billion in second-quarter profit, an 8% increase from a year earlier, or 74 cents a share, compared with the 71 cent estimate of analysts surveyed by Refinitiv. It reported revenue of $23.2 billion, a 2.1% increase from a year earlier, matching analysts' estimate.

Shares in Bank of America rose 1.1% at 9:58 a.m. after earlier falling more than 1% in premarket trading.

Under CEO Brian Moynihan, the bank delivered record first-half profit, fueled by its retail lending operations and Moynihan's expense initiatives. It was the 18th straight quarter the company has managed to improve operating leverage, meaning it has grown revenue while cutting or holding the line on costs.

"Our commitment to responsible growth resulted in the best quarter and first-half year of earnings in our company's history," Moynihan said in the earnings release. "We see solid consumer activity across the board, with spending by Bank of America consumers up five percent this quarter over the second quarter of last year."

Still, the stock took a hit in April when Chief Financial Officer Paul Donofrio warned investors that growth of net interest income this year would be half the 6% the bank generated in 2018. Now, after the Federal Reserve recently signaled that it's likely to cut its benchmark short-term interest rate later this month, the question is, does that further slow the growth in this main profit engine for banks?

That measure may slow further to about 1% this year if the Federal Reserve cuts interest rates twice, Chief Financial Officer Paul Donofrio told analysts during a conference call.

"From here, if we were to assume stable rates, we think our NII for 2019 would now be up approximately 2% compared to 2018," Donofrio said. "If rates follow the forward curve, and the Fed funds rate were indeed to be cut twice this year starting this month, we think it would likely shave another 1 percent off NII growth for 2019."

Further, Bank of America's net interest margin, a key metric of profitability, declined 7 basis points from the first quarter to 2.44%, which is below the 2.47% estimate analysts had for the second quarter.

The stock has climbed 18% this year before Wednesday's results, but is lower than when the company made its revenue warning in April.

Profit in the firm's biggest division, consumer banking, rose 13% to $3.29 billion and revenue climbed 5% to $9.72 billion as it added deposits and loans, which led to higher net interest income. That was the strongest showing among the company's four main businesses, followed by its wealth management division, where profit rose 11% to $1.07 billion.

Profit in its global markets division fell 7% to $1.07 billion amid a slowdown in trading activity across asset classes. Fixed income trading revenue dropped 8 percent to $2.13 billion, essentially matching estimates, while equities trading fell 13 percent to $1.15 billion, just below the $1.22 billion estimate. Profit in its global banking division declined 9% to $1.93 billion on a drop in capital markets deals.

The bank had $13.27 billion in noninterest expenses, just under the $13.31 billion estimate of analysts surveyed by FactSet. The firm's efficiency ratio, which reflects how much expenses consume revenue, improved to 57.48%, edging out analysts' estimate of 57.7%.

Earlier this week, Citigroup, J.P. Morgan Chase, Wells Fargo and Goldman Sachs all beat analysts' profit expectations as the firms benefited from one-time items including a gain on the IPO of electronic trading platform Tradeweb.

Here's what Wall Street expected for Bank of America: