TORONTO, Dec 2 (Reuters) - Royal Bank of Canada posted an 11 percent rise in fourth-quarter profit that topped market expectations on Wednesday as gains in retail banking and capital markets more than offset bad loans in the oil and gas sector.

For the year, the lender, Canada’s most valuable company by market capitalization, recorded C$10.03 billion ($7.49 billion) in earnings, the first time a Canadian company has topped C$10 billion in a fiscal year.

Shares of RBC rose in the morning session but were down slightly in afternoon trading.

Canadian banks have managed to largely shrug off a soft domestic economy, concerns about the housing market and fallout from an oil price slump.

But Barclays analyst John Aiken cautioned he expects RBC’s domestic operations to come under pressure next year because of a weak outlook for the Canadian economy.

“When we look into 2016, it doesn’t dissuade our thesis that there will be ongoing challenges,” he said.

The oil price slump has had a mixed effect on Canadian bank results. Bank of Nova Scotia reported a rise in bad energy-sector loans for the quarter, while the number was essentially flat for Bank of Montreal.

RBC’s gross impaired loans in the oil and gas sector slipped to C$156 million in the fourth quarter from C$183 in the third, though the number was sharply higher than a year earlier.

The lender has been conducting stress tests on energy companies that have borrowed money and added eight new companies to its energy watch list in the quarter for closer monitoring.

“We saw some deterioration in some borrowers, so we reduced credit availability,” said Chief Financial Officer Janice Fukakusa, adding that about 1 percent of RBC’s oil and gas portfolio is on the watch list.

However, a pickup in merger-and-acquisition activity in the energy sector could offset the broader weakness, she said in an interview.

RBC is seeing early signs of stress in Alberta and noticed a slight increase in auto and credit card delinquencies, Chief Risk Officer Mark Hughes said on a conference call.

RBC’s net income rose to C$2.59 billion, or C$1.74 per share, for the quarter ended Oct. 31. Excluding special items, earnings were C$1.77 per share. Analysts, on average, expected C$1.64 a share, according to Thomson Reuters I/B/E/S.

The latest quarterly results were also supported by a lower effective tax rate that the company attributed to favorable income tax adjustments. ($1 = 1.3398 Canadian dollars) (Additional reporting by Anet Josline Pinto in Bengaluru; Editing by Saumyadeb Chakrabarty and Jeffrey Benkoe)