Bank of America on Wednesday posted profit that exceeded analysts' expectations on a rebound in trading revenue and as the company repurchased shares.

The bank said fourth-quarter profit was $7 billion, a 4% decline from a year earlier. But earnings per share were 74 cents, an unexpected 6% increase, helped by a reduction in outstanding shares. That exceeded the 68 cent estimate of analysts surveyed by Refinitiv. Revenue fell 1% to $22.5 billion, edging out the $22.35 billion estimate.

"In a steadily growing economy marked by solid client activity, our teammates produced another strong quarter and year, allowing us to increase investments in our customers, communities, and employees," CEO Brian Moynihan said in the release. "We also delivered for shareholders in 2019 by returning a record $34 billion in excess capital through dividends and share repurchases."

The bank's shares dropped 2% in New York trading after executives warned that net interest income would be lower in the first half of 2020 than in the fourth quarter of 2019.

Of the bank's three main divisions, only its global markets business posted a quarterly increase in profit. The Wall Street trading division had a 13% increase in earnings to $574 million as bond trading revenue surged 25% to $1.8 billion, exceeding the $1.68 billion estimate. Stock trading produced $1 billion in revenue, a 4% decline and just under the $1.07 billion estimate.

The impact of lower interest rates was felt widely at Bank of America, impacting its core lending and banking operations. Companywide net interest income fell 3% to $12.3 billion, and the bank's net interest margin fell 17 basis points to 2.35%, just under analysts' 2.36% estimate.

At the lender's giant retail bank, profit dropped 10% to $3.1 billion on the impact of lower rates. The company also cited interest rates as a reason for lower revenue in its global banking and wealth management divisions.

The second-biggest U.S. lender after J.P. Morgan Chase is among the most sensitive of large banks when it comes to changes in interest rates, according to analysts. So investors will want to hear how rates — which were cut three times last year by the Federal Reserve — impacted the quarter, as well as guidance for 2020.

Last month, Moynihan said that the U.S. economy remained strong as consumer spending continued to grow. He also said that fourth-quarter trading revenue is expected to climb 7% to 8% from a year earlier (his guidance proved conservative — trading revenue actually climbed 13% in the quarter) and that investment banking revenue was headed 3% to 4% higher.

Shares of the bank surged more than 40% last year, exceeding the 29% gain in the Standard & Poor's 500.

On Tuesday, J.P. Morgan and Citigroup posted profits that beat analysts' expectations on surging bond-trading results and strong revenue from credit-card operations. Wells Fargo missed analysts' profit estimates as it booked costs tied to its fake accounts scandal.

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

Earnings: 68 cents a share, a 2.3% decline from a year earlier, according to Refinitiv.

Revenue: $22.35 billion, a 2.4% decline from a year earlier.

Net Interest Margin: 2.36%, according to FactSet

Trading Revenue: Fixed Income $1.68 billion, Equities $1.07 billion