(Bloomberg) -- Royal Bank of Canada posted earnings highlighting its strength at home a day after striking the company’s largest deal ever to bolster the business.

Rising loan balances and widening lending margins in the Canadian retail business helped lift Royal Bank’s total net interest income 24% to C$6.28 billion ($4.64 billion) in the fiscal fourth quarter. Overall profit topped analysts’ estimates.

Royal Bank, Canada’s largest lender, increased loans to consumers and businesses in the country in the three months through October as the economy continued to grow despite the rising odds of a recession. At the same time, the company’s net interest margin expanded 4 basis points from the previous three months to 1.56%, helped by a large base of low-cost deposits.

“Royal Bank’s underlying performance was strong, particularly in its domestic retail and wealth-management operations,” Barclays Plc analyst John Aiken said in a note to clients. “With very few complaints, we would expect the results to be well-received.”

Net income slipped 0.3% to C$3.88 billion, or C$2.74 a share, the Toronto-based company said in a statement Wednesday. Excluding some items, profit was C$2.78 a share. Analysts estimated C$2.69, on average.

Royal Bank on Tuesday announced plans to acquire HSBC Canada for C$13.5 billion ($10 billion), putting to use the large stockpile of capital it built up during the early phase of the pandemic. The purchase, slated for completion late next year, will give Royal Bank 130 branches and C$134 billion in assets while expanding its presence in commercial banking and among high-net-worth individuals.

Royal Bank’s Canadian banking franchise already is benefiting from rising rates and a still-steady pace of borrowing. The segment’s revenue rose 17% from a year earlier, helped by gains on both the personal and business-banking sides of the unit. The division’s net interest margin widened 10 basis points from the third quarter to 2.7%.

Royal Bank shares rose 0.2% to C$134.05 at 9:33 a.m. in Toronto. The stock had declined 0.4% this year through Tuesday, compared with a 7.6% drop for the S&P/TSX Commercial Banks Index.

Royal Bank’s capital-markets division also is weathering a turbulent period in its markets. The unit’s total revenue rose 0.7% from a year earlier to C$2.31 billion. Trading revenue was up 35% from a year earlier and more than double the third quarter’s total, helped by gains in interest-rate and credit products as well as currencies and commodities.

Corporate and investment banking revenue fell 4.7% from a year earlier, but was up 87% from the third quarter.

By contrast, National Bank of Canada’s capital-markets division faltered last quarter after a stronger run than many peers this year. Revenue from trading activity slid 24%, and the division’s profit slumped 14% to C$205 million. The Montreal-based bank’s overall profit also missed analysts’ estimates.

Still, the bank’s Quebec-focused personal and commercial division benefited from widening margins and continued loan growth. Net income in the unit rose 13% to C$351 million. National Bank shares slid 2.3% to $96.20.

(Updates with share prices in eighth, final paragraphs.)

©2022 Bloomberg L.P.