TORONTO (Reuters) - Royal Bank of Canada (>> Royal Bank of Canada), the country's top lender, posted a better-than-expected quarterly profit on Wednesday, driven by significant gains in its personal and commercial banking and capital markets businesses.

The results boosted its stock and, combined with stronger-than-expected earnings from National Bank of Canada (>> National Bank of Canada), improved sentiment toward Canadian banks in general. Investors had sold off the sector on Tuesday after Bank of Montreal (>> Bank of Montreal) reported weaker-than-expected results.

RBC, which also hiked its dividend, said net income at its capital markets business rose 18 percent to C$594 million ($477.84 million) as the impact of last year's surprise oil price drop became clearer to traders.

"There was a shock on the oil prices, but then the impact it had on other markets was a little more measured, in that once people digested the information, it sort of went back to normal spreads," Chief Financial Officer Janice Fukakusa told Reuters. "That's sort of good volatility."

RBC shares rose almost 3 percent to C$77.25 in Toronto, while National shares gained 2 percent to C$47.92.

RBC's net income rose to C$2.46 billion, or C$1.65 a share, in its first quarter, ended Jan. 31, from C$2.09 billion, or C$1.38 a share, a year earlier.

The bank said its cash diluted earnings per share were C$1.67. Analysts, on average, had expected C$1.58, according to Thomson Reuters I/B/E/S.

"The net result is that (Royal) still handily beat consensus, which is still a positive against BMO’s results," Barclays Capital analyst John Aiken said in a note to clients.

RBC said personal and commercial banking net income jumped 17 percent to C$1.26 billion. Fukakusa said the bank wants to see expenses at this division increase at a slower pace than revenue, and would use such measures as not replacing some retiring and departing workers to help achieve this.

She added that while there was a slowdown in some consumer lending markets, the bank is not relaxing its underwriting standards.

Wealth management net income fell 2 percent to C$230 million, hurt by additional restructuring costs related to RBC's U.S. and international wealth management businesses.

RBC said it had set aside C$270 million for credit losses, 8 percent less than a year earlier.

The bank raised its quarterly dividend payout by 2 Canadian cents a share to 77 Canadian cents.

(With additional reporting by Euan Rocha in Toronto and Sayantani Ghosh in Bangalore; Editing by Savio D'Souza, W Simon and Peter Galloway)

By Jeffrey Hodgson