(Bloomberg) -- Bank of America Corp. first-quarter profit beat estimates after its fixed-income traders delivered a windfall large enough to cover the rising cost of the bank’s souring loans.

Revenue from fixed-income, currencies and commodities trading unexpectedly rose almost 30% to $3.4 billion in the first quarter, the highest in a decade. That was driven by improved performance in mortgage, credit and municipal products, and increased secured-financing activity for clients, the bank said in a statement Tuesday.

“This is a good year for the macro products — that’s done very well,” Chief Financial Officer Alastair Borthwick said on a conference call with reporters. The first three months of the year also saw positive returns in credit markets overall, so Bank of America’s business was “firing on all cylinders.”

Overall, the bank’s traders beat estimates, with revenue up 9% to $5.1 billion. Equities posted a 19% decline to $1.6 billion in a quarter that saw dramatic market swings tied to rate hikes, surging inflation and recession fears.

Separately, net interest income, a key source of revenue for the bank, rose 25% to $14.4 billion in the first three months of the year. Analysts had expected a 24% increase for NII, the revenue collected from loan payments minus what depositors are paid.

Looking ahead, NII is likely to be about 2% lower in the second quarter than in the first three months of the year on a fully taxable equivalent basis, Borthwick said on a conference call with analysts.

The results offer another look at how Wall Street fared through a tumultuous quarter that saw the collapse of three smaller, regional lenders. Last week, JPMorgan Chase & Co., Morgan Stanley, Citigroup Inc. and Wells Fargo & Co. all posted gains in net interest income, with some also raising their forecasts for the rest of the year.

Shares of Charlotte, North Carolina-based Bank of America were little changed at $30.47 at 9:39 a.m. in New York, and have dropped 8.4% this year. Net income rose 15% to $8.16 billion, or 94 cents a share. Analysts had expected 82 cents a share.

Deposits fell less than expected as customers piled into the biggest US bank after the collapse of three smaller firms. The lender had $1.91 trillion in deposits at the end of March, down about $20 billion from the end of 2022 but higher than analysts’ expectations of $1.88 trillion. That means that an influx of clients seeking safety countered outflows from inflation and customers seeking higher-yielding alternatives.

The deposit base is “broad, stable and diversified,” Borthwick said on the call with analysts. “We think it’s very long-tenured.”

Bank of New York Mellon Corp. also reported total deposits for the end of the quarter that beat analysts’ estimates.

Bank of America’s non-interest expenses rose 6% from a year earlier to $16.2 billion. Costs have been a focal point for investors, with persistent inflation putting pressure on spending and spurring wage growth. BofA executives expect expenses will decline in the second half of the year, helped by attrition and an overall lower headcount.

The firm added $931 million to its loan-loss reserves, up from $30 million a year earlier while less than the $1.18 billion analysts expected. The build was driven primarily by higher-than-expected credit-card balances, while net charge-offs also increased, to $729 million, driven by cards as well.

Bank of America’s increase in lending income helped counter a continued slump in deals. Investment-banking revenue, excluding self-led deals, fell 20% to $1.2 billion, but fared better than analysts expected, as the same market tumult that drove trading up muted dealmaking. Fees for advising on mergers and acquisitions declined 23%, and revenue from equity and debt issuance dropped 25% and 23%, respectively.

At the same time, the company’s loan balances rose 5.4% to $1.05 trillion at the end of the first quarter. Lending has been a key focus for investors, with government-stimulus payments undercutting borrowing by companies and consumers during the pandemic, and rising interest rates now making loans costlier.

(Updates with NII guidance in sixth paragraph, shares in eighth.)

©2023 Bloomberg L.P.