(Bloomberg) -- JPMorgan Chase & Co.’s revenue soared to a record in the second quarter, boosted by the Federal Reserve’s interest-rate hikes and its acquisition of First Republic Bank.

The firm’s $41.3 billion in revenue beat analysts’ expectations, fueled by $21.8 billion in net interest income as well as a $2.7 billion gain on its First Republic purchase, according to a statement Friday. 

JPMorgan agreed in May to acquire First Republic, beating out rivals in a government-led auction. First Republic was the fourth regional lender to collapse in a matter of weeks, and its failure was the second-largest in US history. The deal made the biggest US bank even bigger. 

The New York-based company raised its full-year guidance for NII, saying it now expects $87 billion, excluding its trading business, up from the $84 billion it predicted at its investor day in May. But net interest income will probably be “substantially below this quarter’s run rate at some point in the future, as competition for deposits plays out,” Chief Financial Officer Jeremy Barnum said on a conference call.

Shares of JPMorgan rose 1.6% to $151.23 at 9:31 a.m. in New York trading, pushing this year’s gain to 12%.

“The U.S. economy continues to be resilient,” Chief Executive Officer Jamie Dimon said in the statement. “Consumer balance sheets remain healthy, and consumers are spending, albeit a little more slowly. Labor markets have softened somewhat, but job growth remains strong.” 

Results included a $1.2 billion reserve build related to First Republic. Overall, the provision for credit losses was $2.9 billion, with a net reserve build of $1.5 billion and $1.4 billion of net charge-offs.

Trading and investment banking, while both down from a year earlier, came in ahead of analyst expectations, driven by beats in fixed-income trading and equity and debt underwriting.

Dimon said in the statement that JPMorgan expects “material capital changes with the finalization of Basel III and probable changes to come for bank liquidity,” but that “we will manage.” The firm did $1.8 billion of common stock buybacks in the second quarter.

Wells Fargo & Co. and Citigroup Inc. are also reporting results Friday, with the trio offering an early look at how banks fared through a quarter that included regional banking tumult and ongoing rate hikes as the Fed sought to combat inflation. 

--With assistance from Keith Gerstein.

(Adds CFO’s comment in fourth paragraph, updates share price in fifth.)

©2023 Bloomberg L.P.