TORONTO -- Strong returns from their capital markets businesses helped offset slowing growth in the domestic banking operations at most of the country's top lenders during the second quarter.

While debt-laden Canadian consumers have become hesitant to increase their borrowing, causing a lull in loan growth, activity on the capital markets has been heating up. That has allowed the banks to generate substantial revenues through advisory and underwriting fees.

Bank of Nova Scotia analyst Sumit Malhotra says companies raised $21.6 billion on the Toronto Stock Exchange between February and April -- almost double the quarterly average of $11.6 billion seen over the past two years.

In a note to clients, Malhotra said wholesale banking operations -- which include investment banking, corporate lending and trading -- have been outperforming the banks' Canadian retail banking segments since the start of 2012.

"Though the wholesale vs. retail trade-off is not ideal, this is less of an issue for investors as long as consumer credit quality trends hold up well," Malhotra said.

Analysts tend to view revenues from the capital markets segment as more volatile and less sustainable than those derived from personal and commercial banking.

Canadian Imperial Bank of Commerce (TSX:CM) says profits nearly tripled in the second quarter, with its wholesale banking and wealth management divisions leading the way.

The bank reported second-quarter net income of $911 million, or $2.25 per share, on Thursday -- up from $306 million or 73 cents a year ago, when the bank logged a $543-million impairment charge related to its Caribbean operations.

Adjusted net income, which filters out one-time items, was $2.28 per share, beating analyst expectations by five cents per share.

Royal Bank (TSX:RY), which also reported its quarterly results on Thursday, saw profits jump 14 per cent to $2.5 billion, or $1.68 per share, compared to $2.2 billion or $1.47 per share during the second quarter of last year. Adjusted net income was $1.63 per share -- three cents higher than analysts had predicted.

Barclays analyst John Aiken said the bank's capital markets results were "exceptional," with trading revenues up 13 per cent from the first quarter while advisory fees soared 25 per cent higher.

"As we have seen with Royal's peers this quarter, strong capital markets results were able to offset challenges facing the retail banking platform," Aiken said in a note to clients.

Meanwhile, TD Bank Group (TSX:TD) saw its net profits decline by seven per cent to $1.86 billion, or 97 cents per share, from $1.99 billion or $1.04 a share a year ago.

But after filtering out one-time items -- including a $337 million restructuring charge to trim down its operations -- adjusted earnings were up nearly five per cent to $2.2 billion, or $1.14 a per share, beating analyst expectations by three cents.

On Wednesday, the Bank of Montreal (TSX:BMO) reported net earnings of $999 million, or $1.49 per share, down from $1.08 billion or $1.60 per share a year ago.

Scotiabank will report its quarterly results Friday.