TORONTO - The Toronto stock market closed higher Friday in a broad-based advance led by mining stocks amid rising prices for metals.

But the TSX was held back by another earnings disappointment from the banking sector.

The S&P/TSX composite index gained 21.69 points to 13,797.59 while the TSX Venture Exchange was up 28.63 points to 2,100.67. The Canadian dollar was up 0.14 of a US cent to 102.32 cents US.

The financial sector was down 0.82 per cent as Royal Bank (TSX:RY) reported net income of $1.51 billion or $1 per share for the second quarter, up from earnings of $1.33 billion or 88 cents per share a year ago. Cash earnings per share were $1.03, under the average analyst estimate for a profit of $1.12 per share, according to Thomson Reuters. Royal Bank shares lost $1.79 to $57.36.

Canada's largest bank also announced a four cent increase to its quarterly dividend Friday -- its first such increase in four years -- bringing it to 54 cents per quarter.

CIBC (TSX:CM) dropped 76 cents to $80.39. CIBC, Bank of Montreal (TSX:BMO), TD Bank (TSX:TD) and National Bank (TSX:NA) have all reported earnings this week. All except National came in below analyst expectations for earnings.

"I think that expectations had gotten ahead of themselves and I think there's a sign we have to be more cautious," said John Johnston, chief strategist, The Harbour Group at RBC Dominion Securities.

"I think the banks are moving into a tough environment and they're not going to be the star performers for the next decade like they have been in the past."

The energy sector was slightly higher, down sharply from early levels as gains in oil prices moderated. A weaker U.S. dollar pushed the July contract on the New York Mercantile Exchange 36 cents higher to US$100.59 a barrel.

A weaker greenback usually helps boost oil prices, which are denominated in U.S. dollars, as it makes oil less expensive for holders of other currencies.

Suncor Energy (TSX:SU) fell 35 cents to C$40.75 and Talisman Energy (TSX:TLM) was up 19 cents to $20.40.

The base metals sector gained 0.84 per cent as metals also picked up with the July copper contract on the Nymex ahead eight cents to US$4.19. Teck Resources (TSX:TCK.B) advanced $1.17 to C$50.32 while Lundin Mining Corp. (TSX:LUN) rose eight cents to $7.16.

Bullion also nudged higher as the June contract in New York gained $13.50 to US$1,536.30 an ounce. Gold stocks also advanced and Barrick Gold Corp. (TSX:ABX) climbed 13 cents to C$46.36 while Kinross Gold (TSX:K) ran ahead 74 cents to $15.76.

The telecom sector was also a positive as the Conference Board of Canada said higher competition in the wireless industry will pull down profits at Canadian telecom companies by an estimated 9.5 per cent this year to $6.7 billion. BCE Inc. (TSX:BCE) was ahead 22 cents to $39.03.

Meanwhile, Research In Motion Ltd. (TSX:RIM) slipped a dime to $42.60 after the BlackBerry maker said Friday that a class-action lawsuit has been filed against it in the U.S., alleging that the company's leaders made materially false and misleading statements about RIM's financial condition and business prospects.

New York markets were higher amid investor disappointment with the latest pending home sales data. The number of people who signed contracts to buy homes in April plunged 26.5 per cent from a year earlier.

But balancing that data was another report showing consumer sentiment in the U.S. rose in May as expectations improved. The University of Michigan's consumer sentiment survey increased to 74.3 in May from 69.8 in April.

New York's Dow Jones industrial average gained 38.82 points to 12,441.58.

The Nasdaq composite index rose 13.94 points to 2,796.86 while the S&P 500 index gained 5.41 points to 1,331.1.

Traders also took in data showing Americans' income edged up last month.

The U.S. Commerce Department said that both personal income and spending rose 0.4 per cent in April, in line with what economists expected. Higher food and gas prices accounted for most of the spending increase.

New York markets are closed Monday for Memorial Day.

The Toronto market ended the week 145 points or 1.06 per cent higher, which still leaves the TSX down about 442 points from its highs of the year reached last month amid a growing conviction that economic growth is not as robust as it was earlier this year and worries about the European government debt crisis.

In other corporate news, aerospace and industrial products manufacturer Heroux-Devtek Inc. (TSX:HRX) reported fourth-quarter net income of $7.7 million or 25 cents per diluted share, up from $4.4 million or 14 cents in the same 2010 quarter. Sales revenue was just under $106 million, up from $84.9 million in the prior-year period. Its shares gained 38 cents to $8.80.

The first phase of Imperial Oil Ltd.'s Kearl oilsands mine will cost nearly $3 billion more to build than previously estimated as the major crude producer retools plans for the massive project north of Fort McMurray, Alta. Imperial (TSX:IMO) said the pricetag for the first 110,000 first phase of Kearl would be $10.9 billion, up from earlier estimates of $8 billion. Its shares dipped four cents to $47.88.