(Updates numbers, adds details, quotes)
TORONTO, Feb 20 (Reuters) - The Toronto Stock Exchange's main index shrugged off earlier losses to rally higher on Wednesday, led by climbing resource issues amid record-setting oil prices.
The S&P/TSX composite index .GSPTSE was up 50.79 points, or 0.38 percent, at 13,498.53 early in the afternoon, with six of its 10 main sectors in positive territory.
The energy sector, which makes up about 25 percent of the index, rose 0.4 percent after crude futures climbed back to again set record highs above $100 a barrel, before easing to $99.96.
Crude touched a record above $100 a barrel on Wednesday, which helped the TSX vault more than 200 points.
The materials sector, home to resource shares, gained traction while gold reversed course to move higher. The group was up 0.6 percent, while Agrium Inc (AGU.TO) rose C$2.13, or 3.1 percent, to C$71.13 and Inmet Mining IMN.TO added C$2.45, or 3.1 percent, to C$80.45. The subindex of gold producers edged up 0.3 percent.
The benchmark index had fallen more than 100 points just after the open, hurt by weaker commodity prices and higher than expected consumer price index in the United States.
The U.S. CPI was up 0.4 percent in January, for a second straight month, suggesting persistent inflation and stoking worries the Federal Reserve will not be able to cut interest rates further.
"(It's) a little bit of an uptick, which is a little bit concerning because while we have the Fed easing, we don't want to bleed out the other end with higher inflation because that potentially will put the Fed in a tough situation," said Paul Taylor, chief investment officer at BMO Harris Investment Management Inc.
"The absolute nightmare for the Fed is stagflation, where we have weak economic growth but we have persistent inflation."
Elsewhere, Canadian Pacific Railway (CP.TO) advanced C$1.31, or 1.8 percent, to C$73.00 after it said it will appeal a grain hopper adjustment by the Canadian Transportation Agency, which could take a bite out of its earnings.
TransAlta Corp (TA.TO) said it will sell its Mexican assets to InterGen Global Ventures for $303.5 million, which pushed its stock up 39 Canadian cents, or 1.1 percent, to C$35.04. The utilities sector rose 0.7 percent.
On the earnings front, home improvement retailer Rona Inc RON.TO slid 93 Canadian cents, or 5.7 percent, to C$15.42 after it said fourth-quarter profit was hurt by a "difficult business climate".
Tim Hortons Inc THI.TO added 30 Canadian cents, or 0.9 percent, to C$35.71 after it reported profit rose 11.5 percent amid growth in same-store sales.
$1=$1.02 Canadian Reporting by Leah Schnurr; Editing by Rob Wilson