UPDATE 1-CANADA STOCKS-TSX ends at 3-week high; oil gains lift energy stocks

(Adds details, updates to close) TORONTO, Feb 23 (Reuters) - Canada's main stock index closed at a three-week high on Friday, with energy companies leading gains across the board on higher oil prices.

* The Toronto Stock Exchange's S&P/TSX composite index rose 130.28 points, or 0.84 percent, to 15,638.45.

* The energy group gained 1.5 percent.

* Energy-related companies Enerplus Corp , CES

Energy Solutions Corp and Enerflex Ltd were

among the 10 biggest gainers on the index.

* U.S. crude prices were up 1.2 percent at $63.56 a barrel.

* The biggest gainer on the index was Winpak Ltd , which gained 11.5 percent after TD Securities raised its target price and CIBC raised its rating after the company reported earnings that beat expectations on Thursday.

* Royal Bank of Canada , Canada's biggest lender by market value, reported earnings per share, excluding one-off items, of C$2.05 for the quarter through Jan. 31. Analysts had on average forecast earnings of C$1.99 per share.

* Its shares reversed earlier losses to end the day up 0.4 percent.

* The financials group, which accounts for more than one-third of the weight of the TSX, rose 0.6 percent.

* The largest decliner was Maxar Technologies Ltd , which retreated 13.4 percent after RBC, CIBC, BMO and Canaccord Genuity cut their target prices. The company reported earnings that missed estimates after the bell on Thursday.

* All of the TSX's 10 main groups were higher, while the index posted six new 52-week highs and two new lows. There were 183 advancing issues, 62 declining ones and five were little changed.

* Canada's annual inflation rate cooled in January from a year earlier as consumers paid less for gasoline and vehicles, but firmer underlying prices were seen keeping the Bank of Canada on track to raise interest rates again later this year.

(Reporting by Fergal Smith; Editing by Tom Brown)