Shares in TD, which had the strongest beat of the two banks, hit an all-time high at C$76.81, up 1.7 percent, in early trading before dropping back to trade up 0.6 percent at 11:15 a.m. EDT. Shares in RBC were down 1.9 percent.

Barclays analyst John Aiken said RBC's earnings did not look as good as the headline beat suggested and TD's performance would be better received by the market.

Canadian authorities have introduced policies, including taxes on foreign buyers, intended to cool housing markets in Toronto and Vancouver and bring about a "soft landing," where prices stabilize gradually.

Canada's banking regulator introduced new regulations in January, requiring borrowers taking out uninsured mortgages to be stress-tested to determine their ability to make repayments at a rate 200 basis points above their contracted mortgage.

TD's Chief Financial Officer Riaz Ahmed said the bank had seen some reductions in mortgage applications in the second quarter, reflecting the slower overall market, but he remained comfortable with its previous expectation of mid-single-digit growth for the year.

"I think we're happy with how this 'soft landing' appears to be emerging at the minute. Sales activity is down and prices are down. The market cooling seems to be working," he said.

RBC's Canadian head Neil McLaughlin said his bank was also continuing to target mid-single digit mortgage growth this year. He said the bank had seen a slight improvement in new mortgage sales so far this year but expected that trend to slow down in the second half.

Canadian banks have also benefited from improved margins as the central bank has raised its key interest rate three times since July 2017, helping them offset slower mortgage growth.

In an interview, RBC's Chief Financial Officer Rod Bulger said that each time the Bank of Canada increases rates by 25 basis points, RBC expects a benefit of about C$110 million in the following year, which exceeds the expected impact if the bank's mortgage growth rate was cut in half.

RBC said net income increased by 9 percent compared with the previous year to C$3.1 billion ($2.4 billion), including 7 percent growth at its Canadian retail business, due to improved sales and margins.

Earnings per share rose to C$2.10, compared with the average analyst forecast of C$2.05, according to Thomson Reuters I/B/E/S data.

TD said earnings per share totaled C$1.62 in the quarter to March 31, compared with C$1.34 a year ago and ahead of the average analyst forecast of C$1.50.

(Reporting by Matt Scuffham; Editing by Bernadette Baum and Tom Brown)

By Matt Scuffham