* Battered oil and gas sector gains as oil recovers
* Materials sector rises but price of gold drags
* TSX ends week up 5.5 pct, biggest gain since 2002
(Updates to official closing numbers, adds details)
TORONTO, Oct 17 (Reuters) - The Toronto Stock Exchange’s main index closed sharply higher on Friday as energy stocks rose on a rebound in crude and investors shopped for bargains.
In yet another volatile day with a trading range of nearly 800 points from trough to peak, the S&P/TSX composite index .GSPTSE closed up 292.52 points, or 3.16 percent, at 9,562.49, with all of its 10 main groups higher.
The benchmark index rose 5.5 percent for the week, its biggest weekly gain since October 2002. The rise follows a 16 percent skid last week.
The energy group, which has been under pressure most of the week, gained 6.9 percent as oil rebounded $2 to $71.85 a barrel, helped by expectations OPEC would cut output at an emergency meeting next week. [ID:nN17332676]
Oil prices are off about 50 percent from the high above $147 a barrel they hit just three months ago, and the energy group has plummeted alongside them.
EnCana Corp ECA.TO rose 7.3 percent at C$49.88, while Canadian Natural Resources CNQ.TO climbed 5.5 percent to C$50.50.
The financial services group rose 1.9 percent with most banks higher after the board that sets Canadian accounting rules said it is going along with U.S. and international changes that will allow companies to reclassify some financial instruments to allow them to avoid fair-value accounting treatment. [ID:N17457317]
Canadian Imperial Bank of Commerce CM.TO rose 6.6 percent to C$58.00, while Royal Bank of Canada RY.TO was 1.3 percent higher at C$46.25.
The materials group struggled 0.33 percent higher, after being in the red for most of the morning, as base metals rose while gold slumped. First Quantum Minerals FM.TO soared 18.2 percent to C$26.01, while Barrick Gold ABX.TO fell 3.6 percent to C$28.01. ($1=$1.19 Canadian) (Reporting by Jennifer Kwan; Editing by Frank McGurty)