* TSX climbs 0.2 percent to end at 13,437.58
* Heavyweight resources benefit from higher oil, gold
* Potash wins brokerage upgrades (Adds details)
By Ka Yan Ng
TORONTO, Jan 28 (Reuters) - Rising energy and materials shares, spurred by surging oil and gold prices, kept Toronto's main stock index in positive territory on Friday, fending off the selloff that hit stock markets around the world in the wake of the unrest in Egypt.
Toronto's heavily weighted resource sector insulated the index from the deep equities losses in the United States and emerging markets, where investors sold in reaction to street battles between protesters and Egyptian security forces and fears that the unrest would spread. [MKTS/GLOB] [ID:nLDE70O2DA] [MKTS/GLOB] [ID:nLDE70O2DA]
While six of the Toronto index's 10 sectors were lower, the energy sector benefited from a soaring oil price and materials were boosted by safe-haven gold miners.
The Toronto Stock Exchange's S&P/TSX composite index .GSPTSE finished 27.38 points, or 0.2 percent, higher at 13,437.58.
"It really underscores Canada's position as a producer of commodities that would benefit in the event of geopolitical instability," said Elvis Picardo, analyst and strategist at Global Securities in Vancouver.
"If instability continues ... we should be supported by the weighting in energy and gold."
Gold-mining stocks reclaimed ground after a sharp decline in the previous session and steadily added to gains as the price for bullion bounced $40 per ounce off session lows. [GOL/]
The index's materials group, home to gold miners, was up 1.1 percent.
Heavyweight gainers included Barrick Gold (ABX.TO), up 2.98 percent at C$47.39, and Agnico Eagle (AEM.TO), up 2.67 percent at C$69.16. Kinross Gold (K.TO) rose 2.29 percent to C$16.99.
Other commodity-based issues were also strong advancers, with the oil and gas group up 1.64 percent. Suncor Energy (SU.TO) rose 3.87 percent to C$40.04, and fellow oil company Canadian Natural Resources (CNQ.TO) gained 2.82 percent to close at C$43.08.
Fertilizer giant Potash Corp (POT.TO) gained 1 percent to C$173.99 as a series of analyst upgrades followed strong results and the announcement of a share split earlier in the week. [ID:nSGE70R0CB] [RCH/CA]
AGF Management Ltd's (AGFb.TO) quarterly profit dropped by nearly a third, falling just short of estimates and prompting investors to sell the asset manager's shares down by more than 5 percent. It pared losses by the end of the day to finish the at C$18.03. [ID:nN28178762]
Shares of Zarlink Semiconductor Inc ZL.TO fell as much as 9 percent, a day after the Canadian chipmaker forecast fourth-quarter results below market estimates. The shares cut losses as well, ending at C$1.85. [ID:nSGE70R0C7]
Angiotech Pharmaceuticals Inc ANP.TO said it will file for bankruptcy protection under Canada's Companies' Creditors Arrangement Act to cut $250 million of its debt. Its shares were suspended from trading under a delisting review by the TSX. [ID:nSGE70R0BI]
Early support came from bullish U.S. economic data. U.S. figures showed economic growth rose in the fourth quarter as consumer spending accelerated. Also, consumer sentiment got brighter in late January, the latest survey from Thomson Reuters and the University of Michigan showed.
For the week, the index was up 1.35 percent.
Picardo noted the index has had difficulty with resistance at 13,500, a level it has risen through just a handful of times this month. It has only closed once above that level this year.
($1=$1.00 Canadian) (Editing by Jeffrey Hodgson and Peter Galloway)